|
|
@ -125,14 +125,14 @@ keyprint: |
|
|
|
dump_stack_registers: |
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
|
|
push si |
|
|
|
lea si, [.string_1] |
|
|
|
lea si, [.string_sp] |
|
|
|
call print |
|
|
|
|
|
|
|
push ax |
|
|
|
mov ax, sp |
|
|
|
call dumpax |
|
|
|
|
|
|
|
lea si, [.string_2] |
|
|
|
lea si, [.string_bp] |
|
|
|
call print |
|
|
|
|
|
|
|
mov ax, bp |
|
|
@ -141,8 +141,8 @@ dump_stack_registers: |
|
|
|
|
|
|
|
pop si |
|
|
|
ret |
|
|
|
.string_1: db 13, 10, "SP:", 0 |
|
|
|
.string_2: db ", BP:", 0 |
|
|
|
.string_sp: db 13, 10, "SP:", 0 |
|
|
|
.string_bp: db ", BP:", 0 |
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
|
|
dump_general_registers: |
|
|
@ -187,4 +187,58 @@ dump_general_registers: |
|
|
|
.string_dx: db 13, 10, "DX:",0 |
|
|
|
.string_bx: db ", BX:",0 |
|
|
|
.string_si: db 13, 10, "SI:",0 |
|
|
|
.string_di: db ", DI:",0 |
|
|
|
.string_di: db ", DI:",0 |
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
|
|
dump_dx_as_two_chars: |
|
|
|
; IN dh: first char |
|
|
|
; IN dl: second char |
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
|
|
push ax |
|
|
|
mov ah, 0xE |
|
|
|
mov al, dh |
|
|
|
int 0x10 |
|
|
|
mov al, dl |
|
|
|
int 0x10 |
|
|
|
pop ax |
|
|
|
ret |
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
|
|
dump_status_flags: |
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
|
|
pushf |
|
|
|
push ax |
|
|
|
push dx |
|
|
|
|
|
|
|
; Move flags into ah |
|
|
|
lahf |
|
|
|
mov al, ah |
|
|
|
test al, (1<<7) ; Sign flag |
|
|
|
jz .S1 |
|
|
|
mov dx, ('S'<<8)|'f' |
|
|
|
call dump_dx_as_two_chars |
|
|
|
.S1: |
|
|
|
test al, (1<<6) ; Zero flag |
|
|
|
jz .S2 |
|
|
|
mov dx, ('Z'<<8)|'f' |
|
|
|
call dump_dx_as_two_chars |
|
|
|
.S2: |
|
|
|
test al, (1<<4) ; Adjust flag |
|
|
|
jz .S3 |
|
|
|
mov dx, ('A'<<8)|'f' |
|
|
|
call dump_dx_as_two_chars |
|
|
|
.S3: |
|
|
|
test al, (1<<2) ; Parity flag |
|
|
|
jz .S4 |
|
|
|
mov dx, ('P'<<8)|'f' |
|
|
|
call dump_dx_as_two_chars |
|
|
|
.S4: |
|
|
|
test al, (1<<0) ; Carry flag |
|
|
|
jz .S5 |
|
|
|
mov dx, ('C'<<8)|'f' |
|
|
|
call dump_dx_as_two_chars |
|
|
|
.S5: |
|
|
|
pop dx |
|
|
|
pop ax |
|
|
|
popf |
|
|
|
ret |