From 923159516d6538caae865dda0563a7ff9eb48b79 Mon Sep 17 00:00:00 2001 From: Leo C Date: Thu, 6 Jun 2019 16:33:15 +0200 Subject: [PATCH] cmd_R: don't allow loading over ddtz address space, but everywhere else. --- ddt180.z80 | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/ddt180.z80 b/ddt180.z80 index 20d7a14..adbe46f 100644 --- a/ddt180.z80 +++ b/ddt180.z80 @@ -35,8 +35,8 @@ bitmap_size equ (prog_size+7)/8 ;------------------------------------------------------------------------------- cseg -start:: -ddtz_base:: +start: +ddtz_base: jr reloc nop l0003h: @@ -136,7 +136,7 @@ reloc_next: ;------------------------------------------------------------------------------- -init:: +init: LD SP,stack if CPM @@ -466,7 +466,7 @@ cswr_wait: ;------------------------------------------------------------------------------- -CMDTAB:: +CMDTAB: ; dw ERROR ;cmd_@ ;examine/substitute the displacement register @ ; dw ERROR ;cmd_A ;Assemble dw cmd_B ;Breakpoints display/set/clear @@ -499,7 +499,7 @@ ERROR: call pstr_inl dc '?',CR,LF ;fall thru -mainloop:: +mainloop: ld sp,stack ld hl,(reg.pc) call bp_clr_temporary @@ -2635,12 +2635,14 @@ i.getchar: i.storebyte: push af push de - ld de,TPA ;lowest allowed load address + ld de,ddtz_base ;don't load over ddtz call cp_hl_de - jr c,error2 - ld de,(BDOS+1) ;highest allowed load address + jr nc,ist_1 + + ld de,ddtz_end+bitmap_size-1 call cp_hl_de jr nc,error2 +ist_1: ld de,(high_load) call cp_hl_de jr c,l1157h @@ -4004,7 +4006,7 @@ pbl_loop_adr: ;------------------------------------------------------------------------------- -conbuf:: +conbuf: ds CONBUF_SIZE+1 ;------------------------------------------------------------------------------- @@ -4012,7 +4014,7 @@ conbuf:: rept (STACK_SIZE+3)/4 db 0deh,0adh,0beh,0efh endm -stack:: +stack: reg.l2: db 000h reg.h2: db 000h reg.e2: db 000h @@ -4040,12 +4042,12 @@ reg.iff: reg.pc: dw TPA cmd_rpt:dw mainloop - + db 0ffh,0ffh,0ffh ;------------------------------------------------------------------------------- ddtz_size equ $-ddtz_base prog_size equ $-start -ddtz_end:: +ddtz_end: ;------------------------------------------------------------------------------- -- 2.39.2