]> cloudbase.mooo.com Git - ddt180.git/blobdiff - ddt180.z80
optimize mainloop; cmd_H: remove +- expression2
[ddt180.git] / ddt180.z80
index 0890182e269b204d3c7d2d2fc6470c70cbd2cb2a..da5cfe6c3134079ea81f06facabc5a881332236f 100644 (file)
@@ -208,6 +208,7 @@ mainloop:
        call bp_clr_temporary\r
        ld hl,(cmd_rpt)\r
        ld de,mainloop\r
+       push de\r
        call cp_hl_de\r
        ld a,'>'\r
        call outchar\r
@@ -216,7 +217,8 @@ mainloop:
        call get_line\r
        call skipbl\r
        jr z,exe_hl\r
-       ld hl,mainloop\r
+       pop hl\r
+       push hl\r
        ld (cmd_rpt),hl\r
        inc de\r
        sub '@'\r
@@ -232,8 +234,7 @@ mainloop:
        ld l,a\r
 \r
 exe_hl:\r
-       call CALL_HL\r
-       jr mainloop\r
+       jp (hl)\r
 \r
 ;-------------------------------------------------------------------------------\r
 \r
@@ -1189,6 +1190,7 @@ p_cpustat:
 l063eh:\r
        call p_regs\r
        djnz l063eh\r
+       call outbl6\r
        push hl\r
        push de\r
        ld iy,(reg.pc)\r
@@ -1261,12 +1263,6 @@ p_regs:
        inc hl\r
        ld d,(hl)\r
        ex de,hl\r
-       dec a\r
-       jr z,l06d9h\r
-       call out_hl\r
-       call z,outbl6\r
-       jr l06e2h\r
-l06d9h:\r
        call out_hl\r
        jr l06e2h\r
 l06deh:\r
@@ -2130,7 +2126,6 @@ l0d8ah:
 ;      Input a byte from port\r
 \r
 cmd_I:\r
-       ld hl,cmd_I\r
        ld (cmd_rpt),hl\r
        ld hl,(last_I)\r
        call get_lastarg_def\r
@@ -2150,7 +2145,6 @@ cmd_I:
 ;      Output a byte to a port\r
 \r
 cmd_O:\r
-       ld hl,cmd_O\r
        ld (cmd_rpt),hl\r
        ld hl,(last_O_val)\r
        call get_arg_def\r
@@ -2242,30 +2236,11 @@ cmdm_up:
 ;      off all loaded files, and Top address of available memory\r
 ; > H expression\r
 ;      evaluate expression and display result in hex, decimal and other formats\r
-; > H expression expression\r
-;      display sum und difference of expressions\r
 \r
 cmd_H:\r
        call expr\r
        jp c,p_max_high0\r
-       call next_arg\r
-       push hl\r
-       call expr\r
-       push af\r
        call assert_eol\r
-       pop af\r
-       ex de,hl\r
-       pop hl\r
-       jr c,l0e5eh\r
-       push hl\r
-       push de\r
-       add hl,de\r
-       call l0e5eh\r
-       pop de\r
-       pop hl\r
-       and a\r
-       sbc hl,de\r
-l0e5eh:\r
        call out_hl\r
        call outbl2\r
        call out_hl_neg\r
@@ -2445,7 +2420,6 @@ l0f42h:
 ;      Display memory in hex and ASCII\r
 \r
 cmd_D:\r
-       ld hl,cmd_D\r
        ld (cmd_rpt),hl\r
        ld hl,(last_D)\r
        ld bc,128\r
@@ -2959,7 +2933,6 @@ l1773h:
 ;      List disassembled code\r
 \r
 cmd_L:\r
-       ld hl,cmd_L\r
        ld (cmd_rpt),hl\r
        call expr\r
        jr nc,l18dbh\r
@@ -4192,7 +4165,6 @@ l2113h:
 ;     trace over Calls [No list] [Jumps only] /.While./.Until.\r
 \r
 cmd_C:\r
-       ld hl,cmd_C\r
        ld a,1\r
        jr cmd_tc\r
 \r
@@ -4204,7 +4176,6 @@ cmd_C:
 \r
 cmd_T:\r
        xor a\r
-       ld hl,cmd_T\r
 cmd_tc:\r
        ld (cmd_rpt),hl\r
        ld (trace_call_flag),a\r