debug: print register name when changing register
This commit is contained in:
parent
8407275ba9
commit
d264404bb1
@ -1,8 +1,10 @@
|
||||
; Print AL
|
||||
space: mov al, ' '
|
||||
putc: xor bx, bx
|
||||
putc: push bx
|
||||
xor bx, bx
|
||||
mov ah, 0x0e
|
||||
int 0x10
|
||||
pop bx
|
||||
ret
|
||||
|
||||
; Print code string CS:SI
|
||||
@ -27,9 +29,6 @@ crlf: mov al, 0x0A
|
||||
jmp putc
|
||||
|
||||
print16:
|
||||
; setup bx and ah for int 10h call
|
||||
xor bx, bx
|
||||
mov ah, 0x0e
|
||||
mov cl, 4
|
||||
; this double-call is essentially a 4 times repeating loop
|
||||
call .c1
|
||||
@ -44,11 +43,10 @@ print16:
|
||||
add al, 0x30
|
||||
; if result is larger than '9', ...
|
||||
cmp al, 0x3a
|
||||
jl .noadj
|
||||
jl putc
|
||||
; ... add 7 so we continue at 'A'
|
||||
add al, 7
|
||||
.noadj: int 0x10
|
||||
ret
|
||||
jmp putc
|
||||
|
||||
; Read character
|
||||
getc: xor ax, ax
|
||||
@ -90,7 +88,8 @@ getch: call getcu
|
||||
; Read string into inbuf
|
||||
; IN ingetc ptr to getc function
|
||||
; inlen max number of chars
|
||||
gets: mov di, inbuf
|
||||
gets: push bx
|
||||
mov di, inbuf
|
||||
; calculate max pointer for writing
|
||||
mov dx, [inmin]
|
||||
.loop: call [ingetc]
|
||||
@ -125,6 +124,7 @@ gets: mov di, inbuf
|
||||
jmp .loop
|
||||
; ctrl+c: return with carry set
|
||||
.can: stc
|
||||
pop bx
|
||||
ret
|
||||
; enter: if enough chars, return
|
||||
.enter: mov bx, di
|
||||
@ -133,4 +133,5 @@ gets: mov di, inbuf
|
||||
jc .loop
|
||||
xor al, al
|
||||
stosb
|
||||
pop bx
|
||||
ret
|
||||
|
@ -168,6 +168,11 @@ cmd_r: cmp byte [si], 0
|
||||
je printregs
|
||||
call eat_register
|
||||
jc .err
|
||||
mov al, [cs:bx+rnames]
|
||||
call putc
|
||||
mov al, [cs:bx+rnames+1]
|
||||
call putc
|
||||
call space
|
||||
call edit_word
|
||||
call crlf
|
||||
ret
|
||||
|
Loading…
Reference in New Issue
Block a user