[Slackers] New slangb1.20 up

Steve Judd sjudd at ffd2.com
Wed May 31 08:42:15 CDT 2006


Hey Jaymz,

I wasn't able to build-wor.sh -- missing sprite.inc file.  I wanted to
compile it to see what's going on, but maybe the following would be good
enough:

> .C:5b9e   A9 00      LDA #$00
> .C:5ba0   85 6C      STA $6C
> .C:5ba2   20 94 96   JSR $9694  <----- right here

Can you show me the code at $9694 as well?  Alternatively, can you show
the output of the linker (I'd like to see what address core.l is being
linked to).

Also, I assume you re-compiled the wor program before linking?

Thanks,

-S

P.S. The way a REL file works is fairly straightforward.  The idea is to
make a relocatable module.  This is done by compiling the code (to 0000),
and including some additional info with the file to tell the linker how to
fix up addresses.

The only addresses which matter are labels (regular, not EQUates).  There
are three types of labels which matter: regular labels, ENT labels, and
EXT labels.

For regular labels -- say, JSR Blah or LDA table1,x -- what's assembled in
the file is the label _offset_ from the beginning of the code (because the
code is assembled to 0000).  At link time, the linker simply loads in the
REL module to some address, and adds that address to the offset already in
the code.  So for regular labels in a REL file you'll see them assembled
as an offset from the beginning of the code, and there will be an entry
associated with it at the end of the code (all those bytes output after
the code is done assembling).

ENT labels work the same, except there is an additional entry in the link
tables at the end of the code, containing the label name and its offset.

EXT labels -- like core routines such as multiplication -- don't need any
offset information.  The label value is resolved at link time.  All the
linker needs to know is the address to store the value at.  So at the end
of the REL file, you should see an entry like

core]mult16 offset

where "offset" is the address $1ba2 in the code you printed.


More information about the Slackers mailing list