2021-01-03 19:11:41 +01:00
|
|
|
section .text
|
|
|
|
|
|
|
|
getc: call conin
|
2021-01-02 04:45:03 +01:00
|
|
|
test al, al
|
|
|
|
jz getc
|
|
|
|
ret
|
|
|
|
|
2021-01-03 19:11:41 +01:00
|
|
|
putc: ; flag checking here
|
|
|
|
conout: mov al, dl
|
2021-01-02 04:45:03 +01:00
|
|
|
mov ah, 0x0e
|
|
|
|
xor bx, bx
|
|
|
|
int 0x10
|
|
|
|
ret
|
2021-01-03 19:11:41 +01:00
|
|
|
|
|
|
|
conio: cmp dl, 0xFF
|
|
|
|
jne conout
|
|
|
|
conin: call const
|
|
|
|
test al, al
|
|
|
|
jz .ret
|
|
|
|
mov al, 0
|
|
|
|
int 0x16
|
|
|
|
.ret: ret
|
|
|
|
|
|
|
|
const: mov ah, 1
|
|
|
|
int 0x16
|
|
|
|
jz .emp
|
|
|
|
.rdy: mov ax, 0xFF
|
|
|
|
ret
|
|
|
|
.emp: mov al, 0
|
|
|
|
ret
|