
; Byte References

B_09	equ	09h	;  9
B_08	equ	08h	;  8
B_03	equ	03h	;  3
B_00	equ	00h	;  0
B_0A	equ	0Ah	;  10
B_FF	equ	0FFh	;  -1
B_30	equ	30h	;  '0'  48
B_3A	equ	3Ah	;  ':'  58
B_0F	equ	0Fh	;  15
B_41	equ	41h	;  'A'  65
B_5B	equ	5Bh	;  '['  91
B_01	equ	01h	;  1
B_64	equ	64h	;  'd'  100
B_1C	equ	1Ch	;  28
B_20	equ	20h	;  ' '  32
B_2A	equ	2Ah	;  '*'  42
B_FC	equ	0FCh	;  '|'+128  -4
B_02	equ	02h	;  2
B_3C	equ	3Ch	;  '<'  60
B_18	equ	18h	;  24
B_2F	equ	2Fh	;  '/'  47
B_61	equ	61h	;  'a'  97
B_7B	equ	7Bh	;  '{'  123
B_1F	equ	1Fh	;  31

; Displacement References

D_00	equ	0	;  000h

; Word References

W_0080	equ	0080h	;  128
W_8001	equ	8001h	;  -32767
W_007F	equ	007Fh	;  127
W_0006	equ	0006h	;  6
W_0C01	equ	0C01h	;  3073
W_0000	equ	0000h	;  0
W_0003	equ	0003h	;  3
W_BB84	equ	0BB84h	;  -17532
W_447C	equ	447Ch	;  17532
W_0C00	equ	0C00h	;  3072
W_2420	equ	2420h	;  9248

; Unclassified Symbols (read from file)
;   (probably same value as another symbol; or, never used)


; Undefined Label References 
;   (probably from data as program; or, to outside program area)

L_0050	equ	0050h	; undefined label
L_0000	equ	0000h	; undefined label
L_0005	equ	0005h	; undefined label

	ORG	0100h

	jmp	L_0139
	DB	043h,04Fh,050h,059h,052h,049h,047h
	DB	048h,054h,020h,031h,039h,038h,035h
	DB	02Ch,020h,053h,04Fh,046h,054h,057h
	DB	041h,052h,045h,020h,032h,030h,030h
	DB	030h,020h,049h,04Eh,043h,02Eh,020h
	DB	028h,056h,045h,052h,053h,049h,04Fh
	DB	04Eh,020h,030h,031h,02Fh,030h,032h
	DB	02Fh,038h,035h,029h,020h
L_0139	lxi	sp,W_0658
	lxi	de,W_05CD
	call	L_02CC
	lxi	hl,W_0080
	mov	a,m
	ora	a
	jz	L_0251
L_014A	call	L_0290
	lxi	de,W_0577
	call	L_02CC
	lxi	hl,W_0080
	mov	c,m
	inx	hl
	xchg	
	lhld 	W_05E8
	call	L_02D2
	call	L_02AF
	jrnz	L_0192
	call	L_0290
	call	L_02AF
	jrnz	L_0174
	lxi	de,W_05D0
	call	L_02CC
	jmpr	L_0180
L_0174	lxi	de,W_05BA
	call	L_040B
	lxi	de,W_05BA
	call	L_02CC
L_0180	lxi	de,W_05DA
	call	L_02CC
	mvi	a,B_09
	call	L_02B8
	jrnz	L_014A
	call	L_0290
	jmpr	L_019A
L_0192	shld	W_05E8
	lxi	hl,W_05E4
	bset	0,m
L_019A	lxi	de,W_0577
	call	L_02CC
	lxi	de,W_05BA
	lhld 	W_05E8
	call	L_040B
	lxi	de,W_05BA
	call	L_02CC
	lxi	de,W_05CD
	call	L_02CC
	call	L_0297
	lxi	de,W_057F
	call	L_02CC
	lxi	de,W_05E5
	lxi	hl,W_05C4
	call	L_053E
	lxi	de,W_05C4
	call	L_02CC
	lxi	de,W_05DB
	call	L_02CC
	mvi	a,B_08
	call	L_02B8
	jrnz	L_01DF
	call	L_0297
	jmpr	L_01F4
L_01DF	mvi	b,B_03
	lxi	hl,W_05E5
L_01E4	mvi	m,B_00
	inx	hl
	djnz	L_01E4
	lxi	hl,W_0080
	mov	c,m
	inx	hl
	lxi	de,W_05E5
	call	L_04DD
L_01F4	lxi	de,W_05E5
	lxi	hl,W_05C4
	call	L_053E
	lxi	de,W_057F
	call	L_02CC
	lxi	de,W_05C4
	call	L_02CC
	lxi	hl,W_05E4
	bset	1,m
	lxi	de,W_05CD
	call	L_02CC
	lda 	W_05E4
	ani	B_03
	jrz	L_028D
	call	L_02AA
	lda 	W_05E4
	bit	0,a
	jrnz	L_0228
	shld	W_05E8
L_0228	lda 	W_05E4
	bit	1,a
	jrnz	L_023B
	mov	a,b
	sta	W_05E7
	mov	a,e
	sta	W_05E6
	mov	a,d
	sta	W_05E5
L_023B	lhld 	W_05E8
	lda 	W_05E5
	mov	d,a
	lda 	W_05E6
	mov	e,a
	lda 	W_05E7
	mov	b,a
	mvi	c,B_09
	call	L_0050
	jmpr	L_028D
L_0251	call	L_0290
	lxi	de,W_0577
	call	L_02CC
	lxi	de,W_05BA
	lhld 	W_05E8
	call	L_040B
	lxi	de,W_05BA
	call	L_02CC
	lxi	de,W_05CD
	call	L_02CC
	call	L_0297
	lxi	de,W_057F
	call	L_02CC
	lxi	de,W_05E5
	lxi	hl,W_05C4
	call	L_053E
	lxi	de,W_05C4
L_0284	call	L_02CC
	lxi	de,W_05CD
	call	L_02CC
L_028D	jmp	L_0000
L_0290	call	L_02AA
	shld	W_05E8
	ret
L_0297	call	L_02AA
	ora	a
	jrnz	L_02C7
	mov	a,b
	sta	W_05E7
	mov	a,e
	sta	W_05E6
	mov	a,d
	sta	W_05E5
	ret
L_02AA	mvi	c,B_0A
	jmp	L_0050
L_02AF	push	hl
	lxi	de,W_8001
	ora	a
	dsbc	de
	pop	hl
	ret
L_02B8	lxi	hl,W_007F
	mov	m,a
	xchg	
	mvi	c,B_0A
	call	L_0005
	lda 	W_0080
	ora	a
	ret
L_02C7	lxi	de,W_05AB
	jmpr	L_0284
L_02CC	mvi	c,B_09
	call	L_0005
	ret
L_02D2	shld	W_05EA
	mov	b,c
	mvi	c,B_FF
	push	de
	push	bc
	lxi	hl,W_05EC
	mvi	m,B_00
	mov	d,h
	mov	e,l
	inx	de
	lxi	bc,W_0006
	ldir
	pop	bc
	pop	de
	inr	b
	dcr	b
	jz	L_0381
L_02EE	ldax	de
	inx	de
	cpi	B_30
	jrc	L_034D
	inr	c
	dcr	c
	jrz	L_0313
	jp	L_0333
	lxi	hl,W_05EC
	cpi	B_3A
	jrnc	L_0313
	ani	B_0F
	mov	l,a
	lda 	W_05F1
	add	a
	mov	h,a
	add	a
	add	a
	add	h
	add	l
	sta	W_05F1
	jmpr	L_034D
L_0313	mvi	c,B_00
	cpi	B_3A
	jrc	L_0333
	call	L_0562
	cpi	B_41
	jrc	L_034D
	cpi	B_5B
	jrnc	L_034D
	push	de
	xchg	
	lxi	hl,W_05EF
	dsbc	de
	xchg	
	pop	de
	jrc	L_034D
	mov	m,a
	inx	hl
	jmpr	L_034D
L_0333	mvi	c,B_01
	cpi	B_3A
	jrnc	L_034D
	ani	B_0F
	mov	l,a
	lda 	W_05F2
	add	a
	mov	h,a
	add	a
	add	a
	add	h
	add	l
	cpi	B_64
	jnc	L_0406
	sta	W_05F2
L_034D	djnz	L_02EE
	lda 	W_05EC
	ora	a
	jrz	L_0381
	dcr	c
	push	psw
	lxi	de,W_0587
	lxi	bc,W_0C01
L_035D	lxi	hl,W_05EC
	push	de
L_0361	xra	a
	cmp	m
	jrz	L_0379
	ldax	de
	call	L_0562
	cmp	m
	inx	hl
	inx	de
	jrz	L_0361
	pop	de
	inx	de
	inx	de
	inx	de
	inr	c
	djnz	L_035D
	pop	psw
	jmp	L_0406
L_0379	pop	de
	mov	a,c
	sta	W_05F0
	pop	psw
	jrz	L_039F
L_0381	lhld 	W_05EA
	call	L_0462
	lda 	W_05F0
	ora	a
	jrnz	L_0393
	lda 	W_05F3
	sta	W_05F0
L_0393	lda 	W_05F1
	ora	a
	jrnz	L_039F
	lda 	W_05F4
	sta	W_05F1
L_039F	lda 	W_05F1
	ora	a
	jrz	L_0406
	mvi	b,B_1C
	lda 	W_05F2
	ani	B_03
	jrnz	L_03AF
	inr	b
L_03AF	mov	a,b
	sta	W_056C
	lxi	de,W_056A
	lhld 	W_05F0
	mvi	h,B_00
	dad	de
	lda 	W_05F1
	dcr	a
	cmp	m
	jrnc	L_0406
	lda 	W_05F0
	lhld 	W_05F1
	mvi	h,B_00
	mvi	d,B_00
	lxi	ix,W_056B
L_03D1	dcr	a
	jrz	L_03DC
	mov	e,D_00(ix)
	dad	de
	inx	ix
	jmpr	L_03D1
L_03DC	push	hl
	lxi	de,W_0000
	lxi	hl,W_0003
	lxi	bc,W_05B5
	lda 	W_05F2
L_03E9	dcr	a
	jm	L_03F3
	dad	bc
	jrnc	L_03E9
	inx	de
	jmpr	L_03E9
L_03F3	srlr	e
	rrar	h
	rrar	l
	srlr	e
	rrar	h
	rrar	l
	pop	de
	dad	de
	lxi	de,W_BB84
	dad	de
L_0405	ret
L_0406	lxi	hl,W_8001
	jmpr	L_0405
L_040B	push	de
	call	L_0462
	pop	hl
	lda 	W_05F4
	ora	a
	jrz	L_043D
	call	L_0553
	mvi	m,B_20
	inx	hl
	push	hl
	lhld 	W_05F3
	mvi	h,B_00
	dcx	hl
	mov	d,h
	mov	e,l
	dad	de
	dad	de
	lxi	de,W_0587
	dad	de
	pop	de
	lxi	bc,W_0003
	ldir
	xchg	
	mvi	m,B_20
	inx	hl
	lda 	W_05F2
	call	L_0553
	jmpr	L_0444
L_043D	mvi	b,B_09
L_043F	mvi	m,B_2A
	inx	hl
	djnz	L_043F
L_0444	ret
	sta	W_05F1
	mov	a,e
	sta	W_05F0
	mov	a,d
	sta	W_05F2
	jmp	L_039F
	call	L_0462
	lda 	W_05F2
	mov	d,a
	lda 	W_05F3
	mov	e,a
	lda 	W_05F4
	ret
L_0462	xchg	
	lxi	hl,W_8001
	ora	a
	dsbc	de
	jz	L_04C8
	lxi	hl,W_447C
	dad	de
	mvi	e,B_00
	dad	hl
	jrnc	L_0477
	inr	e
	inr	e
L_0477	dad	hl
	jrnc	L_047B
	inr	e
L_047B	lxi	bc,W_05B5
	mvi	a,B_FF
L_0480	inr	a
	ora	a
	dsbc	bc
	jrnc	L_0480
	dcr	e
	jp	L_0480
L_048A	call	patch2k
	dad	bc
	mov	a,l
	ani	B_FC
	ora	h
	jrnz	L_049A
	lda 	W_05F2
	dcr	a
	jmpr	L_048A
L_049A	srlr	h
	rrar	l
	srlr	h
	rrar	l
	mvi	b,B_1C
	lda 	W_05F2
	ani	B_03
	jrnz	L_04AC
	inr	b
L_04AC	mov	a,b
	sta	W_056C
	lxi	bc,W_0C00
	mvi	d,B_00
	lxi	ix,W_056B
L_04B9	mov	e,D_00(ix)
	ora	a
	dsbc	de
	inx	bc
	inx	ix
	jrc	L_04D3
	jrz	L_04D3
	djnz	L_04B9
L_04C8	xra	a
	sta	W_05F4
	sta	W_05F3
	sta	W_05F2
	ret
L_04D3	dad	de
	mov	a,c
	sta	W_05F3
	mov	a,l
	sta	W_05F4
	ret
L_04DD	mvi	b,B_03
	xra	a
	sta	W_05F5
L_04E3	lda 	W_05F5
	cpi	B_02
	jrz	L_0520
L_04EA	call	L_0528
	jrz	L_0527
	jrnc	L_04F9
	lda 	W_05F5
	ora	a
	jrz	L_04EA
	jmpr	L_0520
L_04F9	push	bc
	mov	c,a
	lda 	W_05F5
	ora	a
	jrnz	L_0502
	stax	de
L_0502	inr	a
	sta	W_05F5
	ldax	de
	mov	b,a
	add	a
	add	a
	add	b
	add	a
	add	c
	pop	bc
	cpi	B_3C
	jrnc	L_0527
	push	bc
	dcr	b
	dcr	b
	dcr	b
	pop	bc
	jrnz	L_051D
	cpi	B_18
	jrnc	L_0527
L_051D	stax	de
	jmpr	L_04E3
L_0520	inx	de
	xra	a
	sta	W_05F5
	djnz	L_04E3
L_0527	ret
L_0528	inr	c
	dcr	c
	rz
	mov	a,m
	inx	hl
	cpi	B_30
	jrc	L_0538
	cpi	B_3A
	cmc
	jrc	L_0538
	sui	B_30
L_0538	dcr	c
	rnz
	dcr	c
	mvi	c,B_00
	ret
L_053E	ldax	de
	inx	de
	call	L_0553
	mvi	m,B_3A
	inx	hl
	ldax	de
	inx	de
	call	L_0553
	mvi	m,B_3A
	inx	hl
	ldax	de
	call	L_0553
	ret
L_0553	mvi	b,B_2F
L_0555	inr	b
	sui	B_0A
	jp	L_0555
	mov	m,b
	inx	hl
	adi	B_3A
	mov	m,a
	inx	hl
	ret
L_0562	cpi	B_61
	rc
	cpi	B_7B
	rnc
	sui	B_20
W_056A	ret
W_056B	DB	01Fh
W_056C	DB	01Ch,01Fh,01Eh,01Fh,01Eh,01Fh,01Fh
	DB	01Eh,01Fh,01Eh,01Fh
W_0577	DB	00Dh,044h,061h,074h,065h,03Ah,020h
	DB	024h
W_057F	DB	00Dh,054h,069h,06Dh,065h,03Ah,020h
	DB	024h
W_0587	DB	04Ah,061h,06Eh,046h,065h,062h,04Dh
	DB	061h,072h,041h,070h,072h,04Dh,061h
	DB	079h,04Ah,075h,06Eh,04Ah,075h,06Ch
	DB	041h,075h,067h,053h,065h,070h,04Fh
	DB	063h,074h,04Eh,06Fh,076h,044h,065h
	DB	063h
W_05AB	DB	04Eh,065h,074h,077h,06Fh,072h,06Bh
	DB	020h,065h,072h
W_05B5	DB	072h,06Fh,072h,007h,024h
W_05BA	DB	000h,000h,000h,000h,000h,000h,000h
	DB	000h,000h,024h
W_05C4	DB	000h,000h,000h,000h,000h,000h,000h
	DB	000h,024h
W_05CD	DB	00Dh,00Ah,024h
W_05D0	DB	05Fh,05Fh,05Fh,05Fh,05Fh,05Fh,05Fh
	DB	05Fh,05Fh,024h
W_05DA	DB	008h
W_05DB	DB	008h,008h,008h,008h,008h,008h,008h
	DB	008h,024h
W_05E4	DB	000h
W_05E5	DB	000h
W_05E6	DB	000h
W_05E7	DB	000h
W_05E8	DB	041h,01Fh
W_05EA	DB	000h,000h
W_05EC	DB	000h,000h,000h
W_05EF	DB	000h
W_05F0	DB	000h
W_05F1	DB	000h
W_05F2	DB	000h
W_05F3	DB	000h
W_05F4	DB	000h
W_05F5	DB	000h,000h,000h,000h,000h,000h,000h
	DB	000h,000h,000h,000h,000h,000h,000h
	DB	000h,000h,000h,000h,000h,000h,000h
	DB	000h,000h,000h,000h,000h,000h,000h
	DB	000h,000h,000h,000h,000h,000h,000h
	DB	000h
L_0619	DB	000h,000h,000h,000h,000h,000h,000h
	DB	000h,000h,000h,000h,000h,000h,000h
	DB	000h,000h,000h,000h,000h,000h,000h
	DB	000h,000h,000h,000h,000h,000h,000h
	DB	000h,000h,000h,000h,000h,000h,000h
	DB	000h,000h,000h,000h,000h,000h,000h
	DB	000h,000h,000h,000h,000h,000h,000h
	DB	000h,000h,000h,000h,000h,000h,000h
	DB	000h,000h,000h,000h,000h,000h,000h
W_0658	DB	000h,000h

patch2k	cpi	100
	jm	storeit	; < 100
	sbi	100	; adjust
storeit sta	w_05f2	; save to display
	ret
