• Please review our updated Terms and Rules here

MS-DOS Reading keyboard port (60 61) without interrupts

Just wondering how did so many programs that used to directly access keyboard via port 60h work on PC/ATs? I guess they failed and their programmers must have released AT compatible versions?
 
I can only speak about what worked for my code. Chain interrupt 9 and collect the data.
Something like this:
Code:
        xor     cx,cx
GetKey2:
        in      al,pkeystat
        test    al,2                    ; see if ready
        loopnz  GetKey2                 ; if not
        mov     al,0adh
        out     pkeystat,al             ; send it
        xor     cx,cx
GetKey4:
        in      al,pkeystat             ; get a stroke
        test    al,2                    ; see if still full
        loopnz  GetKey4                 ; wait...
        in      al,pkeydata             ; get the keystroke
        push    ax                      ; save the data
        xor     cx,cx
GetKey6:
        in      al,pkeystat
        test    al,2
        loopnz  GetKey6                 ; wait...
        mov     al,0aeh
        out     pkeystat,al             ; send enable
 
Back
Top