[Coco] NitrOS-9 Technical Reference

Greg Law glaw at live.com
Sat Apr 5 20:01:20 EDT 2014

From: William Astle

>> On 14-04-05 12:06 PM, Greg Law wrote:
> > On another note, does anyone know of a way to preprocess the defs files
>> with the actual values emitted in the assembler listing? I was hoping I
>> could use lwasm –l –P os9.d or mamou –p –l os9.d to have it emit the RMB
>> values so I don’t have to do it by hand, but I haven’t been able find the
>> magic incantation to make either assembler to do this. This would make it
>> significantly easier to pull out documentation for the remainder of the 
>> defs
>> files.
> I'm not sure I understand exactly what you're trying to do when you say 
> "rmb values".
> If you're just trying to get the values associated with symbols, try 
> "--list --symbols". That will give a symbol table at the end of the 
> listing.
> If you're looking for clean source that has all the conditionals sorted 
> out and removed, that's something that's theoretically doable but is not 
> currently supported by lwasm. There are some "interesting" corner cases 
> created by macros, though, and those would have to be handled somehow in 
> the result. If someone wants to work out how to implement it, I'm willing 
> to entertain patches.

What I mean is that the asm assembler has the ability to preprocess a file 
and output a formatted listing that contains the line number, type, and 
resolved offsets. In other words, typing something like:

asm -l os9defs >os9defs.lst

asm would then output the formatted assembly listing of OS9Defs with the 
resolved offsets for each statement something like this:

00072 D 0000 F$Link     RMB 1 Link to Module
00073 D 0001 F$Load    RMB 1 Load Module from File
00074 D 0002 F$UnLink RMB 1 Unlink Module
00115                       ORG  $27
00116 0027 F$VIRQ RMB 1     Install/Delete Virtual IRQ

Essentially, this is a very handy formatted assembly listing to have because 
I can brows to a specific symbol (say E$Unit) and immediately know that 
E$Unit is $F0 without having to meticulously count by hand from a known ORG 

I tried this with lwasm, but apparently lwasm outputs the symbol table only 
after a full assembly and it would be more useful to have the resolved 
offsets inline with the formatted listing. This way I don't have to look up 
F$AProc to get the comment, then jump down to the symbol table to get the 

More information about the Coco mailing list