aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/cpm.144
-rw-r--r--src/test/z80.15
2 files changed, 49 insertions, 0 deletions
diff --git a/src/test/cpm.1 b/src/test/cpm.1
new file mode 100644
index 0000000..60ec8c2
--- /dev/null
+++ b/src/test/cpm.1
@@ -0,0 +1,44 @@
+ ;
+ ; 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
+ 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,'$'
diff --git a/src/test/z80.1 b/src/test/z80.1
index d41828e..732d1cb 100644
--- a/src/test/z80.1
+++ b/src/test/z80.1
@@ -221,6 +221,11 @@ exchange:
ex (sp),hl
ex (sp),ix
ex (sp),iy
+ ex hl,de
+ ex af',af
+ ex hl,(sp)
+ ex ix,(sp)
+ ex iy,(sp)
ldi
ldir
ldd