aboutsummaryrefslogtreecommitdiffstats
path: root/data/bacldr.asm
blob: 2a232c105d17dd2066b73f5dd95f1012bdb3b875 (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
32
	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 de,offset
	add hl,de

	ld de,LOAD
	ld b,0

	; 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