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.

Code Keyboard Description
0 CTRL @ Does nothing.
1 CTRL A Reserved.
2 CTRL B Reserved.
3 CTRL C Reserved.
4 CTRL D Allows the text cursor and the graphics cursor to operate independently of one another.
5 CTRL E Causes 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 F Allows output to be printed on the screen. (Reverses the action of VDU 21)
7 CTRL G Causes a short 'beep' from the internal loudspeaker.
8 CTRL H Moves the text cursor back one space on the screen. Does not delete the previous character.
9 CTRL I Moves the text cursor forward one space on the screen.
10 CTRL J Moves 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 K Moves 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 L Clears the text screen. Same as CLS
13 CTRL M VDU13 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 N Puts 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 O Cancels paged mode. (Reverses the action of CTRL N.)
16 CTRL P Clears the graphics screen. Same as CLG
17 CTRL Q Changes text colour. Same as COLOUR
18 CTRL R Changes graphics colour, and colour mix. Same as GCOL
19 CTRL S Assigns 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 T Returns 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 V Changes mode. VDU22,2 is equivalent to MODE 2, except that HIMEM is not altered.
23 CTRL W Reprograms 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 X Defines a graphics window.
25 CTRL Y Same as PLOT. VDU25,85,X,Y is the same as PLOT 85,X,Y
26 CTRL Z Reverses 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 DELETE Moves the text cursor back one space on the screen and deletes the character to the current background colour.
128 to 223   Normally undefined. Can be defined if memory is allocated using *FX20,1 and VDU23.
224 to 255   User-definable characters. Can be defined using VDU23.