Classic Computer Magazine Archive PROGRAM LISTING: 89-10a/MEMCLR.M65


10 ;ROUTINE TO CLEAR EXTENDED RAM
20 ; FOR LINE COUNTERS USED BY
30 ;  THE PROFILER.
40 ;
50 ; 130XE VERSION BY ERIC WOODRUFF
60 ; (c) 1989, ANTIC PUBLISHING, INC.
70 ;
80 ; DEFINITIONS:
90 MEMPTR =  $CB     ;Pointer to RAM.
0100 BANK =  $CD     ;Bank to select.
0110 PORTB = $D301   ;For bank selection.
0120 ;
0130     *=  $3000   ;Relocatable.
0140     PLA 
0150     LDA #3      ;Bank to select.
0160     STA BANK
0170     LDX PORTB   ;Save PORTB.
0180 CLR LDA BANK
0190     ASL A
0200     ASL A       ;Bank * 4.
0210     CLC 
0220     ADC #193    ;Plus 193.
0230     STA PORTB   ;Switch to it.
0240     LDY #0
0250     LDA #$40    ;Set starting
0260     STA MEMPTR+1 ;location to
0270     TYA         ;clear from.
0280     STA MEMPTR
0290 LOOP STA (MEMPTR),Y
0300     INC MEMPTR
0310     BNE LOOP
0320     INC MEMPTR+1
0330     BPL LOOP    ;Done?
0340     DEC BANK
0350     BPL CLR
0360     STX PORTB   ;Restore PORTB.
0370     RTS 


Back to previous page