XA formatted Zero Page Routine

Here you can ask questions or provide insights about how to use efficiently 6502 assembly code on the Oric.
User avatar
Twilighte
Game master
Posts: 819
Joined: Sat Jan 07, 2006 12:07 am
Location: Luton, UK
Contact:

XA formatted Zero Page Routine

Post 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?
User avatar
Dbug
Site Admin
Posts: 4437
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Post 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
 .)
Post Reply