BIN

BASin

BIN BINary number

BIN turns a binary number into a decimal number.

How to use BIN

BIN is followed by a binary number consisting of up to sixteen 1s and 0s, for example

50 POKE USR "a", BIN 10101010

BIN returns the decimal value of the binary number. It is commonly used in conjunction with POKE and USR as above for creating user-defined graphics characters, with 1 signifying a pixel of ink colour, and 0 a pixel of paper colour.

Example

The command

PRINT BIN 11111110

displays 254, the decimal value of the binary number.

Format

  • BIN [1][0]

See also

Chapter 14.