[Coco] Direct page register question

Ciaran Anscomb cocomalt at 6809.org.uk
Tue Oct 30 16:10:35 EDT 2018


William Astle wrote:
>        LDA SYMBOL
> SYMBOL EQU $85
> 
> This will probably use extended addressing because during pass one, the
> assembler hasn't seen the definition of SYMBOL yet when it gets to the
> LDA instruction so it has to assume full 16 bit addressing.
> 
> [...]
> 
> This is actually one of the reasons you should define your variables at
> the start of the program, especially if the direct page is going to be
> used.

Or use an n-pass assembler which generates another pass if addressing
isn't stable!  Native assemblers likely going to be limited, but a
cross-assembler might do it.  e.g., asm6809 output:

4000                          org $4000
4000                          setdp $00
4000  9685                    lda symbol
0085                  symbol  equ $85

(*parp*)

..ciaran


More information about the Coco mailing list