program, and still be free to switch screen modes without deallocating it as a side effect. There is one operating system command to write a character, OSWRCH, which is responsible for all text and graphics. For example, to move the cursor to (10, 15), needed, in 6502 assembler: LDA #31: JSR OSWRCH \ move text cursor LDA #10: JSR OSWRCH \ x-coordinate LDA #15: JSR OSWRCH \ y-coordinate (LDA loads a value into the accumulator; JSR is "jump to subroutine".) On the third OS call, the cursor will move. The following code would draw a line from (0, 0) to (0, +100): LDA #25: JSR OSWRCH \ begin "PLOT" (ASCII 25) command LDA #4: JSR OSWRCH \ command k=4, or move absolute LDA #0: JSR OSWRCH: JSR OSWRCH: JSR OSWRCH: JSR OSWRCH \ send (0, 0) as low, high byte pairs LDA #25: JSR OSWRCH \ begin PLOT LDA #1: JSR OSWRCH \ k=1 - draw relative LDA #0: JSR OSWRCH: JSR OSWRCH \ x = 0 LDA #100: JSR OSWRCH \ y = 100 (low byte) LDA #0: JSR OSWRCH \ high byte BBC BASIC allows performing the above as any of the following: VDU 25, 4, 0; 0; 25, 4, 100; 0; PRINT CHR$(25); CHR$(4); CHR$(0); ... etc. PLOT 4, 0, 0: PLOT 1, 0, 100 MOVE 0, 0: DRAW 0, 100: REM absolute co-ords only! OSWRCH=&FFEE: A%=25: CALL OSWRCH: A%=4: CALL OSWRCH: A%=0: CALL OSWRCH ... etc. Graphics in the Acorn MOS use a virtual graphics resolution of 1280×1024, with pixel positions mapped to the nearest equivalent pixel in the current graphics mode. Switching video resolution will not affect the shape, size or position of graphics drawn even with completely different pixel metrics in the new mode, because this is all accounted for by the OS. MOS does provide two other OS calls that handle text output: OSNEWL and OSASCI. OSNEWL writes a line feed and carriage return to the current output stream. OSASCI forwards all characters directly to OSWRCH except for carriage return, which triggers a call to OSNEWL instead. The precise code for OSASCI and OSNEWL five lines of 6502 assembler is documented in the BBC Micro User Guide. MOS implements character recognition so that text printed on screen in the system font can be selected with the arrow keys and input with the key as though it was being typed. To activate screen editing