XA formatted Zero Page Routine

Here you can ask questions or provide insights about how to use efficiently 6502 assembly code on the Oric.
Post Reply
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 » Mon Sep 14, 2009 4:46 pm

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: 2324
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Post by Dbug » Mon Sep 14, 2009 6:14 pm

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

Who is online

Users browsing this forum: No registered users and 1 guest