]> cloudbase.mooo.com Git - ddt180.git/commitdiff
disas/cmd_L: print hex code
authorLeo C <erbl259-lmu@yahoo.de>
Fri, 28 Feb 2020 21:24:27 +0000 (22:24 +0100)
committerLeo C <erbl259-lmu@yahoo.de>
Fri, 28 Feb 2020 21:24:27 +0000 (22:24 +0100)
ddt180.z80

index 3f356f2f4f29215df8092f8e0f4b597126d9d3e1..80e423ab9686d3785a1e11cc181767ee3ae905f2 100644 (file)
@@ -571,8 +571,6 @@ CALL_HL:
 crlf:\r
        call    pstr_inl\r
        dc      CR,LF\r
-       xor a\r
-       ld (con_col),a\r
        call inchar\r
        jr c,mainloop\r
        ret\r
@@ -682,6 +680,14 @@ l0242h:
        ld a,'.'\r
        jr outchar\r
 \r
+out_hl_bl2:\r
+       call    out_hl\r
+       jr      outbl2\r
+\r
+out_hex_bl:\r
+       call    out_hex\r
+       jr      outbl\r
+\r
 outbl6:\r
        call outbl2\r
 outbl4:\r
@@ -700,8 +706,6 @@ outchar:
        and 07fh\r
        ld      c,a\r
        call    conout\r
-       ld hl,con_col\r
-       inc (hl)\r
        pop af\r
        pop bc\r
        pop de\r
@@ -710,14 +714,6 @@ outchar:
        pop ix\r
        ret\r
 \r
-p_goto_col:\r
-       ld      a,(con_col)\r
-       cp      c\r
-       ret     nc\r
-       ret     z\r
-       call    outbl\r
-       jr      p_goto_col\r
-\r
 ;-------------------------------------------------------------------------------\r
 \r
 incharw:\r
@@ -1485,10 +1481,10 @@ l063eh:
        push hl\r
        push de\r
        ld de,(reg.pc)\r
+       or a\r
        call p_disas_instr\r
        pop de\r
        pop hl\r
-       call crlf\r
        call p_f2\r
        call outbl2\r
        ld b,7\r
@@ -1769,8 +1765,7 @@ bp_print:
        jr z,bp_pr_cont\r
        ld l,(ix+002h)\r
        ld h,(ix+003h)\r
-       call out_hl\r
-       call outbl2\r
+       call out_hl_bl2\r
        inc     c\r
 bp_pr_cont:\r
        call bpl_next\r
@@ -2328,8 +2323,7 @@ l0dedh:
        call out_hex\r
        call outbl2\r
        ld a,c\r
-       call out_hex\r
-       call outbl\r
+       call out_hex_bl\r
        ex de,hl\r
        call out_hl\r
        ex de,hl\r
@@ -2372,8 +2366,7 @@ cmd_H:
        call expr\r
        jp c,p_max_high0\r
        call assert_eol\r
-       call out_hl\r
-       call outbl2\r
+       call out_hl_bl2\r
        call out_hl_neg\r
        call outbl4\r
        call out.hl.dec\r
@@ -2530,14 +2523,12 @@ sub_0f58h:
        push hl\r
        push af\r
 l0f5ch:\r
-       call out_hl\r
-       call outbl2\r
+       call out_hl_bl2\r
        ld de,0\r
 l0f68h:\r
        ld a,(hl)\r
        inc hl\r
-       call out_hex\r
-       call outbl\r
+       call out_hex_bl\r
        dec bc\r
        inc e\r
        ld a,e\r
@@ -2699,13 +2690,13 @@ p_max_high:
        call pstr_inl\r
        DC      'High = '\r
        ld hl,(high_load)\r
-       call out_hl\r
+       call out_hl_bl2\r
        call pstr_inl\r
-       DC      '  Max = '\r
+       DC      'Max = '\r
        ld hl,(max_load)\r
-       call out_hl\r
+       call out_hl_bl2\r
        call pstr_inl\r
-       DC      '  Top = '\r
+       DC      'Top = '\r
        ld hl,ddtz_base-1\r
        call out_hl\r
        jp crlf\r
@@ -2762,20 +2753,33 @@ l190fh:
 \r
 cmdl_p_line:\r
 ;      push    hl\r
-       call out_hl\r
-       call outbl2\r
-       sub a\r
-       ld (con_col),a\r
+       call    out_hl_bl2\r
        ex      de,hl\r
-       call p_disas_instr\r
-       call    crlf\r
+       scf\r
+       call    p_disas_instr\r
        ex      de,hl\r
        ld      (last_L),hl\r
        ret\r
 \r
 p_disas_instr:\r
+       push    af\r
        call    dis_decode\r
-       jp      pstr                            ;print instruction text\r
+       pop     af\r
+       jr      nc,pdinstr_1\r
+       ld      a,3\r
+       sub     b\r
+       jr      c,pdinstr_1\r
+       inc     a\r
+       ld      b,a\r
+       add     a,b\r
+       add     a,b\r
+       ld      b,a\r
+pdinstr_0:\r
+       call    outbl\r
+       djnz    pdinstr_0\r
+pdinstr_1:\r
+       call    pstr                            ;print instruction text\r
+       jp      crlf\r
 \r
 ;-------------------------------------------------------------------------------\r
 \r
@@ -2786,7 +2790,9 @@ dis_decode:
        PUSH    BC\r
        pop     iy\r
        PUSH    BC                      ;workspace (4 bytes)\r
+       rl      c                       ;carry to c.0\r
        PUSH    BC\r
+       ld      c,b\r
        ADD     iy,SP                   ;workspace pointer to iy\r
 \r
        LD      HL,GROUP3\r
@@ -3277,6 +3283,7 @@ i_opc_bli equ     opc_index
 ;      B:  operand index\r
 ;      DE: Address of next instruction byte\r
 ;      HL: Address of next free byte in output buffer\r
+;      (iy+0): Bit = 1: Print opcodes\r
 ;      (iy+1): index register flag (1=IX, 2=IY, else 0)\r
 ;      (iy+2): displacement for any indexed instruction\r
 ;      (iy+3): no. of instraction bytes fetched\r
@@ -3556,6 +3563,9 @@ COPY:
 ;-------------------------------------------------------------------------------\r
 \r
 FETCH:\r
+       LD      A,(DE)\r
+       bit     0,(iy+0)\r
+       call    nz,out_hex_bl\r
        INC     (iy+3)\r
        LD      A,(DE)\r
        INC     DE\r
@@ -3802,11 +3812,6 @@ user_go1:
 \r
 ;-------------------------------------------------------------------------------\r
 \r
-con_col:\r
-       db      0\r
-\r
-;-------------------------------------------------------------------------------\r
-\r
 b_21e2_start:\r
        db      0\r
 trace_cnt_or_ptr:\r