blob: d75f7d2ac70aa0e22e8de168d762f38557e77dfa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
org 0 ; This code must be position-independent
BOFA: equ 65052
offset: equ 0xeeee ; Length of the BASIC prefix
LOAD: equ 0xdddd ; Load address
ENTRY: equ 0xbbbb
ld hl,(BOFA)
ld bc,offset ; offset <= 255
add hl,bc
ld de,LOAD
; Get data block length
loop:
ld a,-8
add (hl)
jp nc,ENTRY ; END is a shorter line than any data line
; Skip length byte + line number (2 bytes) + string opcode (3 bytes)
ld c,6
add hl,bc
; Copy remaining data
ld c,a
ldir
; Skip return + CR
inc hl
inc hl
jr loop
|