Jump to content
IGNORED

Memoirs of an X register - Memory Fill Routine


RSS Bot

Recommended Posts

After much deliberation, I finally managed to get the memory clear/fill function debugged.

 

CODE

;

; FILL PAGES MACRO

;

; %1 = beginning page to fill

; %2 = number of pages to fill (should be - 1)

; %3 = byte to fill with (e.g. $00)

;

; $CC = 00 for top of page boundary

; $CD = page currently being filled

; $D5 = corresponding to ending page

;

.MACRO CLRP

STCL LDA %1

STA $CD

LDA #00

STA $CC

LDY #0

LDA $CD

ADC #%2

STA $D5

CRLP LDA %3

DEY

STA ($CC),Y

BNE CRLP

INC $CD

LDA $CD

CMP $D5

BEQ CRLP

BCC CRLP

.ENDM

 

 

So, what do you guys think? How can I make this so that it can fill regions of memory that don't end on nice page boundaries? Should I need to do that?

 

-Thom

 

http://www.atariage.com/forums/index.php?a...&showentry=1597

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...