Re: A85: What's wrong with this code


[Prev][Next][Index][Thread]

Re: A85: What's wrong with this code




use the '&' for any relative address in the program.  a relative
address is one that resides somewhere inside the code (like a .db or a
function label).  in zshell, you had to add the program address.
anytime the address is an absolute address (where you write the exact
location of the address in memory, such as TEXT_MEM is ALWAYS = $80DF
or call's to functions in the ROM or the OS) you don't need to use an
'&'.

InitClipping:
   ld    a, (SomeByte)
   ld    hl, ClipLeft
   ld    b, 4
   CALL_(SplitByte)

becomes:

InitClipping:
   ld    a, (&SomeByte)
   ld    hl, ClipLeft
   ld    b, 4
   call  &SplitByte
   ld

-mike pearce


References: