comment %

support file for debug purposes.



%
_debug1 macro
        ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        ; debugger
        ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

        push    edi
        push    si

        mov     edi, gs:[4f0h]

        mov     si,"!!"
        mov     gs:[edi], si
        add     edi, 2

        mov     si,"XA"
        mov     gs:[edi], si
        add     edi, 2
        
        mov     si," ="
        mov     gs:[edi], si
        add     edi, 2

        push    ax
        xchg    al, ah
        mov     gs:[edi], ax
        add     edi, 2
        pop     ax


        mov     si,"XB"
        mov     gs:[edi], si
        add     edi, 2

        push    bx
        xchg    bl, bh
        mov     gs:[edi], bx
        add     edi, 2
        pop     bx


        mov     si,"XC"
        mov     gs:[edi], si
        add     edi, 2

        push    cx
        xchg    ch, cl
        mov     gs:[edi], cx
        add     edi, 2
        pop     cx

        mov     si,"XD"
        mov     gs:[edi], si
        add     edi, 2

        push    dx
        xchg    dl, dh
        mov     gs:[edi], dx
        add     edi, 2
        pop     dx


        mov     si,"SE"
        mov     gs:[edi], si
        add     edi, 2


        mov     gs:[edi], es
        add     edi, 2
        mov     gs:[4f0h], edi
        pop     si
        pop     edi

        ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        ; debugger off
        ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        
endm

_DEBUG2 macro
        ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        ; debugger
        ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

        push    edi
        push    si
        mov     edi, gs:[4f0h]

        mov     si, "=="
        mov     gs:[edi], si             ;flag for return
        add     edi, 2

        push    ax
        mov     ax, es:[bx]
        mov     gs:[edi], ax
        add     edi, 2

        mov     ax, es:[bx+2]
        mov     gs:[edi], ax
        add     edi, 2

        mov     ax, es:[bx+4]
        mov     gs:[edi], ax
        add     edi, 2
        pop     ax

        mov     gs:[4f0h], edi          ; save pointer
        pop     si
        pop     edi

        ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        ; debugger off
        ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

endm

