Implement int 0x21 AH = 0x02, write character to stdout
This commit is contained in:
parent
1d4ffb023b
commit
d115299508
|
@ -7,9 +7,23 @@
|
||||||
; outputs:
|
; outputs:
|
||||||
; AL: character read from stdin
|
; AL: character read from stdin
|
||||||
rdin_echo:
|
rdin_echo:
|
||||||
push ax
|
|
||||||
mov ah, 8
|
mov ah, 8
|
||||||
int 0x21
|
int 0x21
|
||||||
; TODO does echo go to stdout or to screen?
|
; TODO does echo go to stdout or to screen?
|
||||||
pop ax
|
ret
|
||||||
|
|
||||||
|
; AH = 0x02
|
||||||
|
; write character to stdout
|
||||||
|
; inputs:
|
||||||
|
; DL: character
|
||||||
|
; outputs:
|
||||||
|
; AL: last character output
|
||||||
|
wrout:
|
||||||
|
; TODO handle ^C and stuff
|
||||||
|
; TODO handle stdout properly
|
||||||
|
push bx
|
||||||
|
mov al, dl
|
||||||
|
mov bl, 0x70
|
||||||
|
call print_character
|
||||||
|
pop bx
|
||||||
ret
|
ret
|
||||||
|
|
17
src/vga.s
17
src/vga.s
|
@ -1,3 +1,20 @@
|
||||||
|
; print a character to the screen
|
||||||
|
; inputs:
|
||||||
|
; AL: ASCII character
|
||||||
|
; outputs:
|
||||||
|
; none
|
||||||
|
print_character:
|
||||||
|
push ax
|
||||||
|
push bx
|
||||||
|
|
||||||
|
mov ah, 0x0E
|
||||||
|
mov bh, 0x00
|
||||||
|
int 0x10
|
||||||
|
|
||||||
|
pop bx
|
||||||
|
pop ax
|
||||||
|
ret
|
||||||
|
|
||||||
; print a string to the screen
|
; print a string to the screen
|
||||||
; inputs:
|
; inputs:
|
||||||
; DS:SI: pointer to '$'-terminated string
|
; DS:SI: pointer to '$'-terminated string
|
||||||
|
|
Loading…
Reference in New Issue