diff options
author | Ian C <ianc@noddybox.co.uk> | 2021-11-20 10:01:52 +0000 |
---|---|---|
committer | Ian C <ianc@noddybox.co.uk> | 2021-11-20 10:01:52 +0000 |
commit | 607668671eb6d10e7ca036df81b3f288bce57339 (patch) | |
tree | df5973eb6e5828aede9948bac0e6d728fdd82fdc /src/example | |
parent | 38e9dd313001142ae36254cc6c8ef79d369dc109 (diff) |
Added Intel HEX output handler
Diffstat (limited to 'src/example')
-rw-r--r-- | src/example/Makefile | 5 | ||||
-rw-r--r-- | src/example/emucpm.z80 | 40 |
2 files changed, 44 insertions, 1 deletions
diff --git a/src/example/Makefile b/src/example/Makefile index a76a21f..700e9e5 100644 --- a/src/example/Makefile +++ b/src/example/Makefile @@ -21,7 +21,7 @@ # ALL = spectrum.tap t64.t64 zx81.p gb.gb vcs.bin snes.sfc nes.nes cpc.cdt \ - prg.prg + prg.prg hex.hex CASM = ../casm all: $(ALL) $(CASM) @@ -58,6 +58,9 @@ nes.nes: nes.asm tiles.chr nes.pal $(CASM) prg.prg: prg.asm $(CASM) $(CASM) prg.asm +hex.hex: emucpm.z80 $(CASM) + $(CASM) emucpm.z80 + clean: rm -f $(ALL) diff --git a/src/example/emucpm.z80 b/src/example/emucpm.z80 new file mode 100644 index 0000000..0920a86 --- /dev/null +++ b/src/example/emucpm.z80 @@ -0,0 +1,40 @@ +; +; Quick hack to emulate some CPM bdos calls (well, enough to make it work) +; + option output-file, hex.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 |