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:

    We human beings do have some genuine freedom of choice and therefore some effective control over our own destinies. I am not a determinist. But I also believe that the decisive choice is seldom the latest choice in the series. More often than not, it will turn out to be some choice made relatively far back in the past.
    —A.J. (Arnold Joseph)

    ... until both employers’ and workers’ groups assume responsibility for chastising their own recalcitrant children, they can vainly bay the moon about “ignorant” and “unfair” public criticism. Moreover, their failure to impose voluntarily upon their own groups codes of decency and honor will result in more and more necessity for government control.
    Mary Barnett Gilson (1877–?)