aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2014-05-11 16:35:11 -0700
committerH. Peter Anvin <hpa@zytor.com>2014-05-11 16:35:11 -0700
commitfbd3070fba255b7ec16fd8eb91abd3156916bb63 (patch)
treea0b41a98552372208b42b43177694042f49ea35e
parent837edd686efd1bb3454bd6597509f93ba0a05f30 (diff)
downloadabc80-fbd3070fba255b7ec16fd8eb91abd3156916bb63.tar.gz
abc80-fbd3070fba255b7ec16fd8eb91abd3156916bb63.tar.xz
abc80-fbd3070fba255b7ec16fd8eb91abd3156916bb63.zip
CP/M: Always clear memory beyond the BIOS
Always clear the memory beyond the BIOS. It also means we don't have to store it explicitly as a bunch of zeroes in cpm.bas. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--data/Makefile4
-rw-r--r--data/cbios.asm5
-rw-r--r--data/cpm.asm9
3 files changed, 12 insertions, 6 deletions
diff --git a/data/Makefile b/data/Makefile
index 673889c..9048cc6 100644
--- a/data/Makefile
+++ b/data/Makefile
@@ -56,7 +56,9 @@ chargen.mif : chargen.bin $(BIN2MIF)
videoram.bin: video.txt genvideo.pl
$(PERL) genvideo.pl -40 < $< > $@ || ( rm -f $@ ; exit 1 )
-cpm.bin: cpm.asm cbios.bin
+cpm.bin: cpm.asm cbios.bin stripzero.pl
+ $(Z80ASM) -o$@ -l$*.lst $<
+ $(PERL) stripzero.pl $@
cpm.bas: cpm.bin
$(PERL) bin2poke.pl $< 32768 100 'Z%=CALL(32768%)' > $@ \
diff --git a/data/cbios.asm b/data/cbios.asm
index 3d30a63..caaa382 100644
--- a/data/cbios.asm
+++ b/data/cbios.asm
@@ -553,8 +553,6 @@ bootmsg: db "CP/M BIOS (H. Peter Anvin, 2014-05-09)\r\n"
;---------------------------------------------------------------------------------------------------------------
-
-
; scratch RAM used by BIOS
curdisk: db 0
cursector: db 0
@@ -572,6 +570,3 @@ chk00: ds 0 ; check vector for disk 0 (must be CKS bytes long)
chk01: ds 0 ; check vector for disk 1 (must be CKS bytes long)
chk02: ds 0 ; check vector for disk 2 (must be CKS bytes long)
chk03: ds 0 ; check vector for disk 3 (must be CKS bytes long)
-
-db "</bios>"
-; we point the stack at 0x0000 on restart, so that may overwrite the very end of RAM.
diff --git a/data/cpm.asm b/data/cpm.asm
index 1299aec..061a3c3 100644
--- a/data/cpm.asm
+++ b/data/cpm.asm
@@ -36,6 +36,15 @@ _start:
ld bc,bios_size
ldir
+ ; Zero memory above the BIOS
+ ld l,e
+ ld h,d
+ inc de
+ ld bc,CPMCURSOR-(CPMBIOS+bios_size)-1
+ xor a
+ ld (hl),a
+ ldir
+
jp CPMBIOS
bios: