summaryrefslogtreecommitdiff
path: root/emucpm.z80
blob: 495afc9ecfc6448e8d635b9b48b5132b2534529b (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
33
34
35
36
37
38
39
40
;
; Quick hack to emulate some CPM bdos calls (well, enough to make it work)
;
        option  output-file, emucpm.hex
        option  output-format, hex

	org	0
	halt

	org	5
	jp	cpm

	org $f000
cpm:
	push	af
	push	bc
	push	de
	push	hl
	ld	a,9
	cp	c
	call	z,print_string
	ld	a,2
	cp	c
	call	z,print_char
	pop	hl
	pop	de
	pop	bc
	pop	af
	ret

print_string:
	ld	bc,$0082
	out	(c),a
	ret

print_char:
	ld	a,e
	ld	bc,$0080
	out	(c),a
	ret