Page 1 of 1

XA formatted Zero Page Routine

Posted: Mon Sep 14, 2009 4:46 pm
by Twilighte
Hi My brain melted sometime ago and since then i've forgotten how to write an XA compliant routine that i will then copy to zero page.
The routine will contain branches and most likely some self-mod-code.

Any suggestions?

Posted: Mon Sep 14, 2009 6:14 pm
by Dbug
Something like that perhaps ?

Code: Select all

#define ZERO_START $50
 .zero
*=ZERO_START 
ZeroStart
 .(
   lda #23
   sta $bb80
   rts
 .)
ZeroEnd

 .text

CopyToZero
 .(
 ldx #ZeroEnd-ZeroStart
.loop
 lda ZeroStart,x
 sta ZERO_START,x
 dex
 bcc .loop
 rts
 .)