aboutsummaryrefslogtreecommitdiff
path: root/src/test/cpm.1
blob: 7f46637fdb0cee386ead5f3fccb9365c3906b9b2 (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
41
42
43
44
45
	;
	; CP/M example (macro test)
	;
	cpu	z80
	option	output-file,x.com

BDOS:	equ	5
CONOUT:	eq	9

strout:	macro	addr
	ld	de,@addr
	ld	c,CONOUT
	call	BDOS
	endm

strout1:macro
	ld	de,str
	ld	a,'$'
	ld	c,CONOUT
.loop
	ex	de,hl
	cp	(hl)
	ex	hl,de
	jr	z,end_str
	call	BDOS
	inc	de
	inc	de
	jr	loop

.str	defb	\*,0
.end_str

	endm


	; Main code
	;
	org	$100

	strout	str
	strout1	"Bye world", 13, 10, '$$'

	ret

str:	defb	"Hello World",13,10,'$'