Appendix A   VDU codes

VDU A is equivalent to PRINT CHR$ A;
VDU A,B,C is equivalent to PRINT CHR$ A; CHR$ B; CHR$ C;

This chapter is a description of the whole character set from 0 to 255 which can be used with either VDU or PRINT CHR$. The ASCII table is in Appendix F, and you will see that the codes from 0 to 31 give control characters for the screen display; codes 32 to 127 generate visual characters; and the remainder are initially undefined.

Here is each key code in detail:
CodeKeyboardDescription
0 CTRL @Does nothing.
1 CTRL AReserved.
2 CTRL BReserved.
3 CTRL CReserved.
4 CTRL DAllows the text cursor and the graphics cursor to operate independently of one another. (Reverses the action of VDU 5.)
5 CTRL ECauses the text cursor to be joined to the graphics cursor. The text cursor ceases to exist, and characters are printed at the graphics cursor, which is positioned using MOVE.
6 CTRL FAllows output to be printed on the screen. (Reverses the action of VDU 21.)
7 CTRL GCauses a short 'beep' from the internal loudspeaker.
8 CTRL HMoves the text cursor back one space on the screen. Does not delete the previous character.
9 CTRL IMoves the text cursor forward one space on the screen.
10 CTRL JMoves the text cursor down one line on the screen. If the cursor is already at the bottom then the screen will scroll up one line.
11 CTRL KMoves the text cursor up one line on the screen. If the cursor is already at the top then the screen will scroll down one line.
12 CTRL LClears the text screen. Same as CLS.
13 CTRL MVDU13 issued as a command (not in a program), or CTRL M, have exactly the same effect as RETURN . In a program, VDU13 will move the text cursor to the start of the current line.
14 CTRL NPuts the display into paged mode. Programs will only be listed to fill the screen, and then the computer will wait until the SHIFT key is pressed before listing another screen full. Used when reading long programs.
15 CTRL OCancels paged mode. (Reverses the action of CTRL N.)
16 CTRL PClears the graphics screen. Same as CLG.
17 CTRL QChanges text colour. Same as COLOUR.
18 CTRL RChanges graphics colour, and colour mix. Same as GCOL.
19 CTRL SAssigns any logical colour value to any actual colour. For example, mode 6 normally has two colours only, black and white, assigned the logical colour values 0 and 1. To change 0 (black) to blue, use VDU19 with the logical colour 0, and the actual colour 4 (blue).
MODE 6
VDU 19, 0, 4, 0, 0, 0
20 CTRL TReturns all logical colours to normal. (Reverses VDU19).
21 CTRL U CTRL U deletes the whole of the current line being typed.
VDU 21, in a program, disables all output to the screen. This is reversed by VDU6.
22 CTRL VChanges mode. VDU22,2 is equivalent to MODE 2, except that HIMEM is not altered.
23 CTRL WReprograms a displayed character. 32 user-definable characters are set aside for use with VDU23. All the rest of the characters can be redefined if the memory is exploded with *FX20,1.
24 CTRL XDefines a graphics window.
25 CTRL YSame as PLOT. VDU25,85,X,Y is the same as PLOT 85,X,Y.
26 CTRL ZReverses the effects of VDU24, VDU28 and VDU29. Graphics and text windows both occupy the whole screen; text origin and text cursor are at top left; graphics origin and graphics cursor are at bottom left.
27 CTRL [Reserved.
28 CTRL ,Defines a text window.
29 CTRL
-
Moves the graphics origin. VDU 29,X,Y will move 0,0 to position X,Y.
30 CTRL .Homes text cursor to top left of text window.
31 CTRL /VDU31,X,Y is the same as PRINT TAB(X,Y).
32 to 126 CTRL SPACE to ~The complete set of ASCII characters.
127 CTRL DELETEMoves the text cursor back one space on the screen and deletes the character to the current background colour.
128 to 223Normally undefined. Can be defined if memory is allocated using *FX20,1 and VDU23.
224 to 255User-definable characters. Can be defined using VDU23.