POLLKEYB - AT-KEYBOARD PORT READER ------------------------------------ This code is to read numeric scancodes from an AT-keyboard or from a barcode reader, which uses this port. Usage: sys49152,a% eg: 10 b%=0 20 a%=b%:sys49152,b% 30 ifa%=240andb%=22then print"key 1 is pressed and released" 40 ifa%=240andb%=30then print"key 2 is pressed and released" 50 goto 20 This call is blocked until it can read a byte from the AT-keyboard port. Pressing stop key aborts blocking without error, and this does not alter the previous variable's (a%) value. Also note that given variables must be integer type. Alternate Usage: 10 sys49155:if(peek(783)and1)=1goto 10 20 a%=peek(780) 30 print a% or; 10 sys49155:ifpeek(780)=0 goto 10 20 if(peek(783)and1)=0thena%=peek(780) 30 print a% 20 rem at-keyboard does not send a $00 value. You can find other information about the AT-keyboard interface at: http://www.physics.metu.edu.tr/~filker/cbm.html 1998-Jan-21 Ilker Ficicilar filker@newton.physics.metu.edu.tr ---