[Coco] Direct page register question

Dave Philipsen dave at davebiz.com
Wed Oct 31 15:59:27 EDT 2018


> On Oct 31, 2018, at 2:40 PM, Salvador Garcia via Coco <coco at maltedmedia.com> wrote:
> 
> I want to understand this fully.
> 
> LDA $85
> 
> When will this be assembled as direct page and when as extended addressing?

The only time it would be assembled as extended is if you SETDP to something other than page zero. 

> 
> I understand the use of SETDP and the less than symbol (<), 
> 
> Why is the following assembled as extended?
> 
>     LDA  #$40
>     TFR  A, DP
> 
>     SETDP $40
>      LDA $85

Because the $85 is interpreted as $0085 and it’s no longer in the direct page. 

> 
> Would this be assembled as direct page?
> 
>     LDA  #$22
>     TFR  A, DP
> 
>     LDA $85

Yes, given that you haven’t told the assembler that the direct page has changed from the default of $00. 

> 
> Thanks! Salvador
> 
> 
>    On Tuesday, October 30, 2018, 2:50:54 PM CDT, William Astle <lost at l-w.ca> wrote:  
> 
> <snip>
> 
> Since Dave didn't mention it explicitly and it might surprise some 
> people, I should mention here that if you do use SETDP to something 
> other than 0, then "LDA $85" will assemble as extended addressing.
> 
> So if you do "SETDP $40", then "LDA $4085" would assemble as direct 
> addressing but "LDA $85" would assemble as extended.
> 
> 
> <snip>  
> 
> -- 
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco



More information about the Coco mailing list