🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.atari.st
Article #39238

Fix for Sozobon assembler

#39238
From: Michal Jaegermann
Date: Tue, 06 Jun 1989 15:01
53 lines
2804 bytes
   It was already reported here a number of times, in particular by
David Brooks, that 'btst' instruction with an immediate operand has
problems in a Sozobon jas assembler.  The assembler inserts into
produced machine code an extra word creating slight indigestion.  The
instruction does not seem to be produced by a Sozobon compiler so an
impact of this bug appears to be limited.  Still Dale Shumacher was
recently posting dLibs fixes.  Some of them were just skipping 'btst'
in assembler modules.
 
   I turns out that exactly the same problem affects not only
'btst', but also 'bchg', 'bclr' and 'bset'.  A reason for it seems
to be a simple typo in a file opcodes.h.  To fix it replace the
following lines from that file (they are NOT consecutive)
 
 {"bchg$s",     O_IMM,  O_DN,   S_L,    "x0o41%1e",     F_L },
 {"bclr$s",     O_IMM,  O_DN,   S_L,    "x0o42%1e",     F_L },
 {"bset$s",     O_IMM,  O_DN,   S_L,    "x0o43%1e",     F_L },
 {"btst$s",     O_IMM,  O_DN,   S_L,    "x0o40%1e",     F_L },
 
respectively with
 
 {"bchg$s",     O_IMM,  O_DN,   S_W,    "x0o41%1e",     F_W },
 {"bclr$s",     O_IMM,  O_DN,   S_W,    "x0o42%1e",     F_W },
 {"bset$s",     O_IMM,  O_DN,   S_W,    "x0o43%1e",     F_W },
 {"btst$s",     O_IMM,  O_DN,   S_W,    "x0o40%1e",     F_W },
 
Recompile jas.ttp (makefile supplied with a source) and the bug is gone.
 
   I cannot guarantee 100% that this fix does not have any nasty side
effects.  The author seems to be from school "If it was hard to write
it should be hard to understand" :-( and comments in sources are
rather sparse.  Hence it is hard to be sure that everything is OK.  My
limited testing so far did not uncovered any surprises.  If you will
find one - please tell us all.
 
    Just to keep things in order - here is an excerpt from a header:
/*
 * Copyright (c) 1988 by Sozobon, Limited.  Author: Joseph M Treat
 *
 * 2) Modified versions must be clearly marked as such.
 *
 */
So mark your fixed version accordingly! 
================================================================
Michal Jaegermann
Myrias Research Corporation
Edmonton, Alberta, CANADA
...{ncc, alberta}!myrias!mj
================================================================
P.S.  I did not check other addressing modes, so I do not know if they
work correctly.  From the way things look it appears that they should.
Anybody with 68000 assembler test suite on hand? 
Technical Details
Message-ID: <1242@myrias.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!ncc!myrias!mj

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!ncc!myrias!mj
From: mj@myrias.UUCP (Michal Jaegermann)
Newsgroups: comp.sys.atari.st
Subject: Fix for Sozobon assembler
Keywords: jas, Sozobon, btst
Message-ID: <1242@myrias.UUCP>
Date: 6 Jun 89 15:01:31 GMT
Organization: Myrias Research, Edmonton
Lines: 53