Basically “IN”

Authors

Publication

Pub Details

Date

Pages

See all articles from Sinc-Link v4 n1

An advantage of using the IN function instead of INKEY$ is that multiple keys can be sensed. If the keyboard was to be divided into 8 groups so that each group was half a row containing 5 keys, then these groups would be represented by IN addresses as follows:

 IN 65278 = keys CAPSHIFT to V
IN 65022 = keys A to G
IN 64510 = keys Q to T
IN 63486 = keys 1 to 5
IN 61438 = keys O to 6
IN 57342 = keys P to Y
IN 49150 = keys ENTER to H
IN 32766 = keys SPACE to B

When IN 65278 equals 31 (binary 11111), none of the keys From CAPSHIFT to V are being pressed. If one of these keys was pressed, it would change the binary 1 to a zero. The least significant digit represents the key closest to the outside of the keyboard. For example, IN 61438 4s 19 (Binary 10011) indicating that both keys 7 and 8 are pressed. Check this by RUNning this one-line program: (press keys 6 to 0)

 10 PRINT AT 1,1: IN 61438: GOTO 10

This only uses the 5 least significant digits of the address. The 6th least significant digit is the bit which presently appears at the EAR socket. IN 251 handles the data for the printer as does OUT 251. OUT 254 colors our border on the 3 least significant bits while its 4th and 5th bits are used for the MIC socket and the BEEPer respectively.

Products

 

Media

 

Image Gallery

Source Code

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

People

No people associated with this content.

Scroll to Top