Category : Modula II Source Code
Archive   : TASKING.ZIP
Filename : BIOSKEYB.MOD

 
Output of file : BIOSKEYB.MOD contained in archive : TASKING.ZIP
IMPLEMENTATION MODULE BIOSKeyboard;
FROM SYSTEM IMPORT SWI, SETREG, GETREG, AX, BX, CODE;

PROCEDURE Read(VAR ch, scan: CHAR);
VAR
tmp: CARDINAL;
BEGIN
SETREG(AX, 0);
SWI(16H);
GETREG(AX, tmp);
ch := CHR(tmp MOD 100H);
scan := CHR(tmp DIV 100H);
END Read;

PROCEDURE Check(VAR ch, scan: CHAR; VAR avail: BOOLEAN);
VAR
tmp: CARDINAL;
flags: BITSET;
BEGIN
SETREG(AX, 100H);
SWI(16H);
CODE(
9CH, (* push flags *)
5BH); (* pop bx *)
GETREG(AX, tmp);
GETREG(BX, flags);
avail := NOT(6 IN flags); (* test zero flag *)
IF avail THEN
ch := CHR(tmp MOD 100H);
scan := CHR(tmp DIV 100H);
END;
END Check;

PROCEDURE GetStatus(VAR stat: Status);
VAR
tmp: CARDINAL;
BEGIN
SETREG(AX, 200H);
SWI(16H);
GETREG(AX, tmp);
tmp := tmp MOD 100H;
stat := Status(tmp);
END GetStatus;

END BIOSKeyboard.


  3 Responses to “Category : Modula II Source Code
Archive   : TASKING.ZIP
Filename : BIOSKEYB.MOD

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/