[Coco] lwtools assembler difference

Dave Philipsen dave at davebiz.com
Wed Sep 2 13:53:03 EDT 2015


Ok, so I found out that the disk images in the official repository have 
been assembled correctly with the default operation of the lwasm 
assembler to generate the 5-bit offset machine code ONLY when forced by 
a literal "0" such as in ldb 0,x.  For some reason, the disk image that 
I received from a a guy whose cousin knows a friend of another person 
who generated his own NitrOS9 disk image must have been generated 
incorrectly because when I compare the Krn module generated by asm to a 
dump from that image there are twelve places where the 5-bit offset was 
forced making it different than my Krn module.

The good news is that at least with REL, Boot, and Krn the source code 
will pretty much assemble just as well with the stock OS9 assembler as 
with lwasm.  I think the only changes I had to make were to add some 
equates to define the target machine etc., manual padding (the lwasm 
appears to have an assembler directive for this whereas asm does not), 
and maybe a couple of other very minor issues.  Whoever is 'in charge' 
of maintaining the source files on the repo has done a great job in 
making sure that these modules are being kept as compatible as possible 
with the stock assembler.


Dave Philipsen


On , Dave Philipsen wrote:
...
> However, the lwtools assembler (evidently) assembles in machine code 
> as:
> 
> E6 00
> 
> which is the indexed addressing mode with a 5-bit offset with the
> offset being zero.
> 


More information about the Coco mailing list