home *** CD-ROM | disk | FTP | other *** search
- 1000 ;********************************
- 1002 ;* source code for basic reloc. *
- 1004 ;* by james hosek *
- 1006 ;********************************
- 1008 ;
- 1020 *= 2063; assemble program into rem statement
- 1021 j = 25; offset for new location
- 1023 k = 27; temp. zero page pointer
- 1024 l = 29; temp. zero page pointer
- 1025 txttab = 43; pointer to start of basic program
- 1026 vartab = 45; pointer to end of program
- 1040 ldy 41082; get a zero from rom
- 1060 sec: lda memto: sta txttab+1; point txttab to new location
- 1065 sbc #8: sta j; calculate offset
- 1070 clc: lda vartab: sta k: sta l; get lo byte of top of program
- 1075 lda vartab+1: sta k+1: adc j: sta l+1; set up transfer pointers
- 1077 sta vartab+1; point vartab to new location
- 1080 loop lda k: bne cont1: dec k+1: dec l+1
- 1090 cont1 dec k: dec l; decrement pointers
- 1100 lda (k),y: sta (l),y; transfer one byte of memory
- 1110 lda k: bne cont1: lda k+1: cmp #8: bne loop; check if done (k = $0800)
- 1120 inc l; set up 'l' to look at pointer to next basic line, in the first line
- 1160 loop2 lda (l),y: iny: ora (l),y: beq out; check for end of program
- 1170 clc: lda (l),y: adc j: sta (l),y: sta 2; recalculate pointer with offset
- 1180 dey: lda (l),y: sta l: lda 2: sta l+1: jmp loop2; point to the next line
- 1200 out ldx 41070; get a $0d from rom
- 1205 stx 632: stx 635: ldx #49: stx 631; set up keyboard queue
- 1210 ldx #82: stx 633: ldx #117: stx 634: ldx #5: stx 198: rts
- 1220 memto .byte 16; page to transfer to
- 1230 .byte 34 0 0 0; set up end of line
- 1300 .end relocater.src
-