[Coco] Direct page register question

William Astle lost at l-w.ca
Tue Oct 30 17:14:04 EDT 2018


On 2018-10-30 3:08 p.m., Salvador Garcia via Coco wrote:
> Now I am officially confused.
> 
> I believed that using direct addressing produced opcodes for LDA, for example to be one byte less because the 16 bit address did not have to be specified, yet below it says that the instruction is expanded to include DP's value? Is that correct?
> 
> Then there is the SETDP directive defining whether direct or extended addressing is used. So if LDA $4085 assembles as direct addressing, does that mean that the DP doesn't come into play here?

For those who are still confused:

SETDP affects what the *assembler* does. The contents of DP affects what 
the CPU does at run time.

SETDP is how the assembler decides to use direct or extended addressing. 
The CPU only sees whichever the assembler picked and only references DP 
if the direct mode was picked by the assembler.

That means the value of SETDP at assembly time *could* be different from 
the value of DP at runtime. That's not necessarily an error but it would 
definitely be confusing if you didn't do it intentionally.


More information about the Coco mailing list