code	segment word public
assume	cs:code
public _getc
_getc:
; Returns keypress in AX, or -1 if none available
; note this returns an INT, not a CHAR!!
        push  dx
        mov   ah,06h
        mov   dl,0ffh
        int   21h
        jz    L1
        mov   ah,0
        pop   dx
        ret
L1:
        mov   ax,-1
        pop   dx
        ret
code ends
end
