From ZG65Mon.lst:
Code:
00F004 1 ;load 4K of data from EPROM to RAM
00F004 1 loop0:
00F004 1 BD 00 F0 LDA $f000,x
00F007 1 9D 00 70 STA $7000,x
00F00A 1 E8 INX
00F00B 1 D0 F7 BNE loop0
00F00D 1 loop1:
00F00D 1 BD 00 F1 LDA $f100,x
00F010 1 9D 00 71 STA $7100,x
00F013 1 E8 INX
00F014 1 D0 F7 BNE loop1
00F016 1 loop2:
00F016 1 BD 00 F2 LDA $f200,x
00F019 1 9D 00 72 STA $7200,x
00F01C 1 E8 INX
00F01D 1 D0 F7 BNE loop2
00F01F 1 loop3:
00F01F 1 BD 00 F3 LDA $f300,x
00F022 1 9D 00 73 STA $7300,x
00F025 1 E8 INX
00F026 1 D0 F7 BNE loop3
00F028 1 loop4:
00F028 1 BD 00 F4 LDA $f400,x
00F02B 1 9D 00 74 STA $7400,x
00F02E 1 E8 INX
00F02F 1 D0 F7 BNE loop4
00F031 1 loop5:
00F031 1 BD 00 F5 LDA $f500,x
00F034 1 9D 00 75 STA $7500,x
00F037 1 E8 INX
00F038 1 D0 F7 BNE loop5
00F03A 1 loop6:
00F03A 1 BD 00 F6 LDA $f600,x
00F03D 1 9D 00 76 STA $7600,x
00F040 1 E8 INX
00F041 1 D0 F7 BNE loop6
00F043 1 loop7:
00F043 1 BD 00 F7 LDA $f700,x
00F046 1 9D 00 77 STA $7700,x
00F049 1 E8 INX
00F04A 1 D0 F7 BNE loop7
00F04C 1 loop8:
00F04C 1 BD 00 F8 LDA $f800,x
00F04F 1 9D 00 78 STA $7800,x
00F052 1 E8 INX
00F053 1 D0 F7 BNE loop8
00F055 1 loop9:
00F055 1 BD 00 F9 LDA $f900,x
00F058 1 9D 00 79 STA $7900,x
00F05B 1 E8 INX
00F05C 1 D0 F7 BNE loop9
00F05E 1 loopa:
00F05E 1 BD 00 FA LDA $fa00,x
00F061 1 9D 00 7A STA $7a00,x
00F064 1 E8 INX
00F065 1 D0 F7 BNE loopa
00F067 1 loopb:
00F067 1 BD 00 FB LDA $fb00,x
00F06A 1 9D 00 7B STA $7b00,x
00F06D 1 E8 INX
00F06E 1 D0 F7 BNE loopb
00F070 1 loopc:
00F070 1 BD 00 FC LDA $fc00,x
00F073 1 9D 00 7C STA $7c00,x
00F076 1 E8 INX
00F077 1 D0 F7 BNE loopc
00F079 1 loopd:
00F079 1 BD 00 FD LDA $fd00,x
00F07C 1 9D 00 7D STA $7d00,x
00F07F 1 E8 INX
00F080 1 D0 F7 BNE loopd
00F082 1 loope:
00F082 1 BD 00 FE LDA $fe00,x
00F085 1 9D 00 7E STA $7e00,x
00F088 1 E8 INX
00F089 1 D0 F7 BNE loope
00F08B 1 loopf:
00F08B 1 BD 00 FF LDA $ff00,x
00F08E 1 9D 00 7F STA $7f00,x
00F091 1 E8 INX
00F092 1 D0 F7 BNE loopf
00F094 1
00F094 1 4C 97 70 JMP *+3-$8000 ;continue execute this program in RAM
Is there any reason for not stuffing it all into one big loop, saving 45 bytes?
Code:
00F004 1 ;load 4K of data from EPROM to RAM
00F004 1 loop0:
00F004 1 BD 00 F0 LDA $f000,x
00F007 1 9D 00 70 STA $7000,x
00F00A 1 BD 00 F1 LDA $f100,x
00F00D 1 9D 00 71 STA $7100,x
00F010 1 BD 00 F2 LDA $f200,x
00F013 1 9D 00 72 STA $7200,x
00F016 1 BD 00 F3 LDA $f300,x
00F019 1 9D 00 73 STA $7300,x
00F01C 1 BD 00 F4 LDA $f400,x
00F01F 1 9D 00 74 STA $7400,x
00F022 1 BD 00 F5 LDA $f500,x
00F025 1 9D 00 75 STA $7500,x
00F028 1 BD 00 F6 LDA $f600,x
00F02B 1 9D 00 76 STA $7600,x
00F02E 1 BD 00 F7 LDA $f700,x
00F031 1 9D 00 77 STA $7700,x
00F034 1 BD 00 F8 LDA $f800,x
00F037 1 9D 00 78 STA $7800,x
00F03A 1 BD 00 F9 LDA $f900,x
00F03D 1 9D 00 79 STA $7900,x
00F040 1 BD 00 FA LDA $fa00,x
00F043 1 9D 00 7A STA $7a00,x
00F046 1 BD 00 FB LDA $fb00,x
00F049 1 9D 00 7B STA $7b00,x
00F04C 1 BD 00 FC LDA $fc00,x
00F04F 1 9D 00 7C STA $7c00,x
00F052 1 BD 00 FD LDA $fd00,x
00F055 1 9D 00 7D STA $7d00,x
00F058 1 BD 00 FE LDA $fe00,x
00F05B 1 9D 00 7E STA $7e00,x
00F05E 1 BD 00 FF LDA $ff00,x
00F061 1 9D 00 7F STA $7f00,x
00F064 1 E8 INX
00F065 1 D0 9D BNE loop0
00F067 1
00F067 1 4C 6A 70 JMP *+3-$8000 ;continue execute this program in RAM
??? If ZP is available right away, you can save 72 additional bytes with (ZP),Y:
Code:
txa
sta $80
sta $82
tay
lda #$70
sta $83
lda #$f0
sta $81
loop0:
lda ($80),y
sta ($82),y
iny
bne loop0
inc $83
inc $81
bne loop0
jmp *+3-$8000
_________________
Got a kilobyte lying fallow in your 65xx's memory map? Sprinkle some
VTL02C on it and see how it grows on you!
Mike B.
(about me) (learning how to github)