ZX Spectrum Character Set - Control Codes

Control Codes

In the control codes area (the C0 range), the Spectrum uses its own proprietary controls, such as INK and PAPER to control foreground and background colour. The only similarity to ASCII is having cursor-left for 0x08 (ASCII Back Space) and ENTER for 0x0D (ASCII Carriage Return), which also generates an automatic linefeed. Cursor-down 0x0A (ASCII Line Feed) can be simulated with 32 spaces printed with OVER 1 (transparent overprint) and cursor-up 0x0B (ASCII Vertical Tabulation) can be simulated with 32 backspaces. The system ROM has a fault which prevents cursor-right 0x09 (ASCII Horizontal Tabulation) from working.

Control code 0x0e is used to indicate that a floating-point number follows, to accelerate text processing. In a Sinclair BASIC program, ASCII numbers are followed by a 0x0E byte, and then a 5-byte representation of the number in binary floating point format. When listing the Basic program the LIST command skips past these 5 bytes, but when the program is being run the 5-byte representation is used and the text part is ignored. Some Spectrum programs used this behaviour to hide the real numbers from the user. For example, a BASIC line could contain the ASCII characters GOTO 10, followed by a 0x0e byte and the floating-point representation of 100. Anyone listing the program would see the number 10, but when executed the program would jump to line 100.

Read more about this topic:  ZX Spectrum Character Set

Famous quotes containing the words control and/or codes:

    Could it not be that just at the moment masculinity has brought us to the brink of nuclear destruction or ecological suicide, women are beginning to rise in response to the Mother’s call to save her planet and create instead the next stage of evolution? Can our revolution mean anything else than the reversion of social and economic control to Her representatives among Womankind, and the resumption of Her worship on the face of the Earth? Do we dare demand less?
    Jane Alpert (b. 1947)

    Thou hast a voice, great Mountain, to repeal
    Large codes of fraud and woe; not understood
    By all, but which the wise, and great, and good
    Interpret, or make felt, or deeply feel.
    Percy Bysshe Shelley (1792–1822)