The main changes are to support the KIM-1 Simulator character I/O, using the ACIA simulation instead of low level KIM-1, for non-blocking character input.
How to start CODOS
To start using the K-1013 FDC go to the menu settings.
Enable MTU K-1013 emulation
Copy the folder from the KIM-1 Simulator setup distribution archive called K-1013 to your disk.
Choose the Disk images directory pointing to the folder K-1013. You will see the files on Disk 0 etc filled in, DSK files are for operating systems like CODOS
Make sure the first disk mounted is codos17.imd. The IMD files are in the K-1013 folder.
Now you start CODOS.
Load the file bootrom.bin into memory with File – Load file in Memory – binary. Start address $FF00
The file is in the K-1013 folder.
Start the console by pressing the TTY Console button on the main window\
Start the Simulator by pressing Run/Stop button
Start CODOS with
FF00 G
and see the CODOS prompt.
Note that this boot program gets overwritten by CP/M-65, so you have to load it again after a reset.
Working with disks
The disks, stored in files with type .imd are in the K-1013 folder. You can mount/dismount/create disks from the Settings screen.
You can have as many as four.
On the Settings screen the disks mounts are shown. Click on the name of a mounted disk or an empty Mount, to go to the Mount Disk dialog. Mount/Dismount here, in Write or read Only mode.
Press the the three … next to the field Image file to select or create a disk image.
Press New and you get the New diskimage dialog.
There is also the IMU utility in CP/M-65 to work with disks: mount/unmount, list the directory of the K-1013 folder. create/delete and copy.
The option switch
The option switch does this:
It just sets bit 6 in the HSR. For example, the boot PROM can use it to decide whether to boot the OS or just follow the normal KIM 1 boot procedure.
CP/M-65 is a native port of Digital Research’s seminal 1977 operating system CP/M to the 6502.
Developed by David Given. Ported to many 6502 systems, see the original github archive.
Currently you can cross-assemble programs from a PC, as well as a working C toolchain with llvm-mos. For native development, there’s a basic assembler, a couple of editors, a BASIC, and a byte-compiled Pascal subset and interpreter.
Eduardo Casino ported CP/M-65 to the KIM-1 with an MTU K-1013 FDC, directly connected SD card module, the 1541 drive or Corsham Technology SD CARD/RTC Shield.
And now Eduardo has ported a version special to the KIM-1 Simulator with SD Card/RTC Shield simulation. See his fork of CP/M-65 on his github archive. Several branches are available, development versions with a.o. the KIM-1 Simulator version.
The main changes are to support the KIM-1 Simulator character I/O, using the ACIA simulation instead of low level KIM-1, for non-blocking character input.
How to start CP/M-65
To start using the K-1013 FDC go to the menu settings.
Enable MTU K-1013 emulation
Copy the folder from the KIM-1 Simulator setup distribution archive called K-1013 to your disk.
Choose the Disk images directory pointing to the folder K-1013. You will see the files on Disk 0 etc filled in, DSK files are for operating systems like CP-M/65
Make sure the first disk mounted is diskimage.imd. The IMD files are in the K-1013 folder.
Now you start CP/M-65.
Load the file boot.pap into memory with File – Load file in Memory – papertape.
The file is in the K-1013 folder.
Start the console by pressing the TTY Console button on the main window
Start the Simulator by pressing Run/Stop button
Start CP/M with
0200 G
and see the CP/M-65 prompt.
Note that this boot program gets overwritten by CP/M-65, so you have to load it again after a reset.
Working with disks
The disks, stored in files with type .imd are in the K-1013 folder. You can mount/dismount/create disks from the Settings screen.
You can have as many as four.
On the Settings screen the disks mounts are shown. Click on the name of a mounted disk or an empy Mount, to go to the Mount Disk dialog. Mount/Dismount here, in Write or read Only mode.
Press the the three … next to the field Image file to select or create a disk image.
Press New and you get the New diskimage dialog.
There is also the IMU utility in CP/M-65 to work with disks from within CP/M-65: mount/unmount, list the directory of the K-1013 folder. create/delete and copy.
Example session
KIM
0200 D8
KIM
0200 D8 G
CP/M-65 for the KIM-1
A>dir
A: SCRVT100 COM : IMU COM
A: IMU TXT : SYS COM
A: PASC PAS : ASM TXT
A: HELLO ASM : DEMO SUB
A: ASM COM : ATTR COM
A: BEDIT COM : CAPSDRV COM
A: COPY COM : CPUINFO COM
A: DEVICES COM : DINFO COM
A: DUMP COM : LS COM
A: STAT COM : SUBMIT COM
A: MORE COM : BEDIT ASM
A: BEDIT TXT : DUMP ASM
A: LS ASM : CPM65 INC
A: DRIVERS INC : ATBASIC COM
A: ATBASIC TXT : OBJDUMP COM
A: MKFS COM : ADM3ADRV COM
A: ADM3ATST COM : CLS COM
A: LIFE COM : QE COM
A: SCRNTEST COM : VT52DRV COM
A: VT52TEST COM : KBDTEST COM
A: MBROT COM : DS COM
A: DS TXT : PINT COM
A: PASC OBB : PLOAD COM
A: HELLO PAS : IMU3 TXT
A: HELLO SYM
A>pint PASC.OBB PASC.PAS PASC.OBS
Pascal-M interpreter for CP/M-65: B66F bytes free
Pascal-M compiler V2k1 for CP/M-65
Processing: writeerr
Processing: beginlin
Processing: endline
Processing: error
Processing: stringsi
Processing: nextchar
Processing: insymbol
Processing: enterid
Processing: searchse
Processing: searchid
Processing: getbound
Processing: hexout
Processing: writeout
Processing: bytegen
Processing: wordgen
Processing: genujpen
Processing: plantwor
Processing: skip
Processing: test1
Processing: test2
Processing: intest
Processing: constant
Processing: comptype
Processing: isstring
Processing: simplety
Processing: fieldlis
Processing: typ
Processing: constdec
Processing: typedecl
Processing: vardecla
Processing: paramete
Processing: procdecl
Processing: ldcigen
Processing: ldagen
Processing: lodgen
Processing: condgen
Processing: loadsetc
Processing: cspgen
Processing: incgen
Processing: load
Processing: store
Processing: loadaddr
Processing: falsejum
Processing: calluser
Processing: selector
Processing: variable
Processing: processt
Processing: readproc
Processing: processt
Processing: writepro
Processing: newstate
Processing: releases
Processing: resetrew
Processing: closepro
Processing: assignpr
Processing: getcomma
Processing: ordfunc
Processing: succfunc
Processing: predfunc
Processing: chrfunc
Processing: oddfunc
Processing: eofeolns
Processing: callnons
Processing: call
Processing: opgen
Processing: setexpre
Processing: factor
Processing: term
Processing: simpleex
Processing: expressi
Processing: assignme
Processing: compound
Processing: ifstatem
Processing: casestat
Processing: repeatst
Processing: whilesta
Processing: forstate
Processing: statemen
Processing: body
Processing: block
Processing: stdnames
Processing: enterstd
Processing: enterstn
Processing: enterund
Processing: initiali
Processing: compileh
Processing: compilep
Processing: skipspac
Processing: getword
Processing: findend
Processing: openfile
Processing: closefil
Processing: dumperro
Processing: cpascalm
Compilation successful.
No compilation errors PASC.PAS
A>pload PASC.OBS PASC.OBB
Opening input file...
Opening output file...
Reading OBP...
Seen 94 procedures
Writing output file...
Closing output file...
Success.
A>type HELLO.PAS
program HelloWorld;
begin
writeln('Hello from Pascal!')
end.
A>
A>pint PASC.OBB HELLO.PAS HELLO.OBS
Pascal-M interpreter for CP/M-65: B66F bytes free
Pascal-M compiler V2k1 for CP/M-65
Processing: hellowor
Compilation successful.
No compilation errors HELLO.PAS
B>A:pload A:HELLO.OBS HELLO.OBB
Opening input file...
Opening output file...
Reading OBP...
Seen 1 procedures
Writing output file...
Closing output file...
Success.
B>A:pint HELLO.OBB
Pascal-M interpreter for CP/M-65: B66F bytes free
Hello from Pascal!
B>
The emulation of the MTU K-1013 floppy Disk controller card allow you to use the CODOS and CP/M65 operating systems on the KIM-1 Simulator. Read here all about the actual K-1013 card, incluidng a real replica by Eduardo Casino.
Replica by Eduardo Casino
The K-1013 emulation uses the same resources as the K-1013 card, but onlky if enabled.
The supporting files for the K-1013 are in the folder K-1013 and contain:
The usage of these files is explained on this page. You can add any file there at wish.
To start using the K-1013 go to the menu settings.
Enable K-1013 emulation
Copy the folder from the KIM-1 Simulator setup distribution archive called K-1013 to your disk.
Choose the Disk images directory pointing to the folder K-1013. You will see the files on Disk 0 etc filled in, IMD files are for operating systems like CP-M/65 and CODOS. See below.
Put the KIM-1 in TTY mode on the main window and start the emulator. The usual KIM prompt will appear and you are in the KIM-1 monitor.
Brutech and the Radio Bulletin magazine worked together. The hardware produced or resold by Brutech was offered to the magazine for reviews. And Brutech placed many advertisements in the magazine. I visited the Brutech offices several times, it was close to where I lived.
The KIM-1 came from MOS Technology and Commodore without a case or power supply. So you either build your own housing or looked at what other firms sold for the KIM-1.
There was a lot on offer, mostly targeted at system expansion with large cases.
One of the cases you saw quite often was this case. It came with one of my KIM-1’s. Small, simple and effective
A perfect solution for an unexpanded KIM-1. Quite popular in education. Add a power supply and you can start using it without exposing the electronics. The LED display was behind a red plexiglas cover, so that improves readability.
The KIM-1 Simulator has seen a large update.
A new piece of hardware is added, the SD Card/RTC Shield by Corsham Technology.
This addition has been written by Eduardo Casino. Lots of code contributed, thanks Eduardo!
He also added support for two operating systems using the SD Shield, xKIM by Bob Applegate and CP/M-65 by David Given.
The problem with local language keyboard layouts is solved by Eduardo. Now the host operating system takes care of the different layout.
The documentation has been enhanced and moved from a local limited html file to an online version.
CP/M-65 is a native port of Digital Research’s seminal 1977 operating system CP/M to the 6502.
Developed by David Given. Ported to many 6502 systems, see the original github archive.
Currently you can cross-assemble programs from a PC, as well as a working C toolchain with llvm-mos. For native development, there’s a basic assembler, a couple of editors, a BASIC, and a byte-compiled Pascal subset and interpreter.
Eduardo Casino ported CP/M-65 to the KIM-1 with an MTU K-1013 FDC, directly connected SD card module, the 1541 drive or Corsham Technology SD CARD/RTC Shield.
And now Eduardo has ported a version special to the KIM-1 Simulator with SD Card/RTC Shield simulation. See his fork of CP/M-65 on his github archive. Several branches are available, development versions with a.o. the KIM-1 Simulator version.
The main changes are to support the KIM-1 Simulator character I/O, using the ACIA simulation instead of low level KIM-1, for non-blocking character input.
How to start CP/M-65
To start using the SD Card/RTC Shield go to the menu settings.
Enable Corsham SDShield emulation
Copy the folder from the KIM-1 Simulator setup distribution archive called SDCARD to your disk.
Choose the Disk images directory pointing to the folder SDCARD. You will see the files on Disk 0 etc filled in, DSK files are for operating systems like CP-M/65
Make sure the first disk mounted is CPM-BOOT.DSK. The DSK files are in the SDCARD folder.
Now you start CP/M-65.
Load the file bootshield.pap into memory with File – Load file in Memory – papertape.
The file is in the SDCARD folder.
Start the console by pressing the TTY Console button on the main window
Start the Simulator by pressing Run/Stop button
Start CP/M with
0200 G
and see the CP/M-65 prompt.
Note that this boot program gets overwritten by CP/M-65, so you have to load it again after a reset.
Alternative boot program
In the SDCARD folder you find a second boot program called bootsdshield-kimrom.bin
This one can be placed in the unused 6530-003 ROM area, the same idea as Wozmon for the KIM-1.
The advantage is that this is not overwritten by CP/M-65,
Load at $1AA0, start at $1AA0.
Working with disks
The disks, stored in files with type .DSK are in the SDCARD folder. You can mount/dismount/create disks from the Settings screen.
You can have as many as four.
On the Settings screen the disks mounts are shown. Click on the name of a mounted disk or an empy Mount, to go to the Mount Disk dialog. Mount/Dismount here, in Write or read Only mode.
Press the the three … next to the field Image file to select or create a disk image.
Press New and you get the New diskimage dialog.
There is also the IMU utility in CP/M-65 to work with disks from within CP/M-65: mount/unmount, list the directory of the SDCARD folder. create/delete and copy.
Example session
KIM
0200 D8
KIM
0200 D8 G
CP/M-65 for the KIM-1
A>dir
A: SCRVT100 COM : IMU COM
A: IMU TXT : SYS COM
A: PASC PAS : ASM TXT
A: HELLO ASM : DEMO SUB
A: ASM COM : ATTR COM
A: BEDIT COM : CAPSDRV COM
A: COPY COM : CPUINFO COM
A: DEVICES COM : DINFO COM
A: DUMP COM : LS COM
A: STAT COM : SUBMIT COM
A: MORE COM : BEDIT ASM
A: BEDIT TXT : DUMP ASM
A: LS ASM : CPM65 INC
A: DRIVERS INC : ATBASIC COM
A: ATBASIC TXT : OBJDUMP COM
A: MKFS COM : ADM3ADRV COM
A: ADM3ATST COM : CLS COM
A: LIFE COM : QE COM
A: SCRNTEST COM : VT52DRV COM
A: VT52TEST COM : KBDTEST COM
A: MBROT COM : DS COM
A: DS TXT : PINT COM
A: PASC OBB : PLOAD COM
A: HELLO PAS : IMU3 TXT
A: HELLO SYM
A>pint PASC.OBB PASC.PAS PASC.OBS
Pascal-M interpreter for CP/M-65: B66F bytes free
Pascal-M compiler V2k1 for CP/M-65
Processing: writeerr
Processing: beginlin
Processing: endline
Processing: error
Processing: stringsi
Processing: nextchar
Processing: insymbol
Processing: enterid
Processing: searchse
Processing: searchid
Processing: getbound
Processing: hexout
Processing: writeout
Processing: bytegen
Processing: wordgen
Processing: genujpen
Processing: plantwor
Processing: skip
Processing: test1
Processing: test2
Processing: intest
Processing: constant
Processing: comptype
Processing: isstring
Processing: simplety
Processing: fieldlis
Processing: typ
Processing: constdec
Processing: typedecl
Processing: vardecla
Processing: paramete
Processing: procdecl
Processing: ldcigen
Processing: ldagen
Processing: lodgen
Processing: condgen
Processing: loadsetc
Processing: cspgen
Processing: incgen
Processing: load
Processing: store
Processing: loadaddr
Processing: falsejum
Processing: calluser
Processing: selector
Processing: variable
Processing: processt
Processing: readproc
Processing: processt
Processing: writepro
Processing: newstate
Processing: releases
Processing: resetrew
Processing: closepro
Processing: assignpr
Processing: getcomma
Processing: ordfunc
Processing: succfunc
Processing: predfunc
Processing: chrfunc
Processing: oddfunc
Processing: eofeolns
Processing: callnons
Processing: call
Processing: opgen
Processing: setexpre
Processing: factor
Processing: term
Processing: simpleex
Processing: expressi
Processing: assignme
Processing: compound
Processing: ifstatem
Processing: casestat
Processing: repeatst
Processing: whilesta
Processing: forstate
Processing: statemen
Processing: body
Processing: block
Processing: stdnames
Processing: enterstd
Processing: enterstn
Processing: enterund
Processing: initiali
Processing: compileh
Processing: compilep
Processing: skipspac
Processing: getword
Processing: findend
Processing: openfile
Processing: closefil
Processing: dumperro
Processing: cpascalm
Compilation successful.
No compilation errors PASC.PAS
A>pload PASC.OBS PASC.OBB
Opening input file...
Opening output file...
Reading OBP...
Seen 94 procedures
Writing output file...
Closing output file...
Success.
A>type HELLO.PAS
program HelloWorld;
begin
writeln('Hello from Pascal!')
end.
A>
A>pint PASC.OBB HELLO.PAS HELLO.OBS
Pascal-M interpreter for CP/M-65: B66F bytes free
Pascal-M compiler V2k1 for CP/M-65
Processing: hellowor
Compilation successful.
No compilation errors HELLO.PAS
B>A:pload A:HELLO.OBS HELLO.OBB
Opening input file...
Opening output file...
Reading OBP...
Seen 1 procedures
Writing output file...
Closing output file...
Success.
B>A:pint HELLO.OBB
Pascal-M interpreter for CP/M-65: B66F bytes free
Hello from Pascal!
B>
Enabling it will display a form on which the video memory is shown (according the packing of the pixels in bytes, see the manual).
Use the Settings from to enable or disable (default) the K-1008. The base address in memory can be set to what the original board allowed with jumpers.
The K-1008 display can be resized from 1x to 3x. Larger means a slower display, not much effort has been put in making it display fast.
A fourth option is to choose for a correct aspect ratio.
Screenshot of 1.3.3 with ‘correct’ aspect ratio.
Note that the pixel only appears on screen when the corresponding memory location is written to by the CPU. Use Refresh in the Debugger to force the display.
Using MS Basic: the interpreter will detect the video memory as normal memory. No harm done, MS Basic does not support the K-1008. The memory test of MS Basic is visible on the K-1008 display!
There are several ways an image can be loaded to the K-1008 video display:
Load a K-1008 formatted binary file into memory. It will show on the K-1008 display if enabled via Settings.
The Refresh button in the debugger will also refresh the K-10008 display from memory
With a C header file. see below
How to make a C Header image file with threshold
Choose a high contrast image
Load the image in GIMP (a freeware image processing app for Windows, Linux etc)
Scale the image to 320×200 exactly(have the ties between the dimension windows untied)
Use the Treshold tool to convert to black and white, play with the settings until it looks good
Export to, choose the C header file format, a file
This file can be loaded with the File menu entries of the KIM- Simulator main window and Debugger
The file is converted if you load in it into memory
If you have the K-1008 display on (see Settings) it will display it too
Now you can save the image if you wish with the ‘Memory to file’ menu entries
Make a C Header image file with dithered images
Open image in GIMP
Crop the image to 320×200 or a multiple like 960×600
Image – Scale the image to 320×200
Image – Mode – Indexed to black white palette Floyd-Steinberg (normal)
Image – Mode – RGB
File -Export As Select file type – C source header
Export
Note there is a command line program in the folder K-1008 load C Header , called LoadK1008 that converts a C header image file to a K-1008 formatted binary.
D:\k1008\LoadK1008.exe h
LoadK1008 is a program to convert a 320x200 C header file from GIMP to
MTU Visable memory K-1008 image
LoadK1008 <C header filename> <K-1008 binary filename>
Prepare the C header file in GIMP as follows:
Load an image in GIMP
Scale to 320×200 (detach the link between the sizes)
Threshold or dither to black and white, play to get a nice result
Export as C header file
Feed the C header file to this program
Convert the result, a binary file into a program like my Convert 8 bit hex formats (included with the KIM-1 Simulator) to a papertape format with the start address of the K-1008 (2000-C000)
Load the papertape into the KIM-1 or KIM-1 Simulator
Also there are examples of C header and binary K-1008 formatted files.
Sources of LoadK1008 commandline
The folder K-1008 load C Header contains the Freepascal source and original JPG files.
The KIM-1 Simulator comes with a ‘console’, a glass teletype 24×80 screen. It has a subset of ANSI/VT100 support.
Of course there are much better terminal emulators, like Teraterm, Putty, Coolterm, Minicom etcetera.
And a real VT100 type device is really fun! Or a real Teletype …
Now the KIM-1 Simulator can use either an external serial device, e.g a PC with Teraterm or Minicom, or a terminal emulator locally on the same PC.
Activate serial input/output local on your PC as follows:
Start your external terminal emulator, e,g, Teraterm or Minicom with serial port settings 9600 baud.
Choose the desired serial port, See below for Windows or Linux null modem setup
Start the KIM-1 Simulator
Activate TTY Console, the Console window appears
Choose Settings – Setup serial port
set for 9600 baud
Choose the desired serial port, the OTHER in the null modem setup
Press the Use serial button, the console window disappears
Start the Simulator from the main Window with Run/Stop
Now the serial terminal emulator shows the KIM prompt
Note the Simulator is not very forgiving if you make a mistake with serial ports in this first version, Close the Simulator application and start over.
Windows
Install the com0com null-modem emulator from here.
That delivers two COM ports that act as if they are connected via a null modem, anything entered at one is sent to the other and vice versa.See the device manager for the ports created.
Use a terminal emulator as Teraterm with a serial connection to the other COM port. With the same settings for serial as in the Simulator!
Then select in Settings – Use serial and start the emulator.
Note the KIM-1 only works with uppercase characters.
Linux
Use this commmand (install socat if not present).
socat -d -d pty pty
The code above returns (the pts numbers may be different).
2013/11/01 13:47:27 socat[2506] N PTY is /dev/pts/2
2013/11/01 13:47:27 socat[2506] N PTY is /dev/pts/3
2013/11/01 13:47:27 socat[2506] N starting data transfer loop with FDs [3,3] and [5,5]
Any character entered at one is sent to the other pts device as if a null modem cable is connected.
Use the device /dev/pts/2 in the KIM-1 Simulator Settings – Setup serial. Default is 9600.
Start a terminal emulator like minicom or Coolterm and select device /dev/pts/3 at 9600 baud.
Select in Settings – Use serial port /dev/pts/3 and start the terminal emulator.
Now you can control the TIM via minicom or any suitable VT100 like terminal emulator.
Select in Settings – Use serial and start the emulator
Minicom is easy to use. Just set the terminal serial port (the other than the emulator uses).
Coolterm is tested, but is a little bit troublesome to configure.
Force the serial port via Custom and ignore the warning messages.
Press the TTY console switch to let the KIM simulator use a VT100 console window. The standard KIM user interface is shown, see the manual how to use. Note: set the PC keyboard to CAPS Lock, only uppercase is used in the KIM monitor itself.
The console is an emulation of a complete VT100 video terminal (with ANSI color enhancements) connected to an ACIA (a Motorola 6850) in the KIM-1. The KIM Monitor is patched to send or receive via the ACIA and is transparant to the user of the KIM-1 I/O routines (even the quirks like flags and returned register values!)
The console is a window of 24 lines with 80 characters. There is a buffer of 1000 lines, use the scroll bar at the right.
You can copy and paste text to the console. Select text with the mouse, and use the right mouse button to show the pop up windows to copy the selected text to the paste buffer of your operating system. With he same popup menu you can paste text into the console. This is a handy flexible alternative to the File – Load text to console and File -Save text from Console on the main form of the Simulator.
The popup menu also has functions like Reset console, change Color of the font and Background color and the way LF and CR are handled.
In settings you can also select the screen color settings with predefined like green, amber white. Settings there are saved across sessions.
The menu options of the main form have options to record a session, (Load Text to Console) or play (Save text from Console, followed by Stop saving text ) a text file in the console.
This is in fact the same functionality as a teletype with high speed papertape punch or reader. You can use this to load and save Basic programs as ASCII text files. Or use the KIM-1 tape routines built in KB9 Basic!
Keyboard input, when the console window has focus, is sent to the serial input of the ACIA. No local echo. The KIM-1 monitor only accepts uppercase (hint: Caps lock!), user programs are free to use upper or lowercase.
Characters sent tot to ACIA output are received by the console window and handled as a VT100 would do, a subset of the ANSI/VT100 is implemented.
All keys of the PC are usable, SHIFT works. Note the translation of codes from the PC keyboard to ASCII characters is the same as the operating system localizations.
Received characters by the console are handled as follows, a subset of the ANSI set. Consult a VT100 manual for more information.
Single control character
$01 : CursorHome
$04 : CursorRight
$05 : CursorUp
BS : Backspace
TB : Tab
LF : LineFeed
FF : ClearScreen
CR : CarriageReturn
$13 : CursorLeft
$16 : DeleteToEndofLine
$18 : CursorDown
DEL : Backspace
<strong>ESC sequences</strong>
All relevant VT100 escape codes are supported.
ESC[K Clear from cursor to the end of the line
ESC[0K Clear from cursor to the end of the line
ESC[1K Clear from the beginning of the current line to the cursor
ESC[2K Clear the whole line
ESC[J Clear the screen from cursor
ESC[0J Clear the screen from cursor
ESC[1J Clear the screen until cursor position
ESC[2J Clear the screen and move the cursor to 0-0,
defined sprites are removed, loaded bitmaps are kept
<strong>Insert / Delete</strong>
ESC[1@ Insert a blank character position (shift line to the right)
ESC[1P Delete a character position (shift line to the left)
ESC[1L Insert blank line at current row (shift screen down)
ESC[1M Delete the current line (shift screen up)
Move cursor
ESC[H Move to 0-0
ESC[f Move to 0-0
ESC[s Save the cursor position
ESC[u Move cursor to previously saved position
ESC[(Row);(Col)H Move to row,column
ESC[(Row};(Col)f Move to row,column
ESC[nA Move the cursor up n lines
ESC[nB Move the cursor down n lines
ESC[nC Move the cursor forward n characters
ESC[nD Move the cursor backward n characters
ESC D Move downward one line. If at the bottom, scroll up
ESC E Move to the first position on the next line with scroll up
ESM M Move upward one line. If at the top, scroll down
<strong>Attributes</strong>
ESC[m Reset all attributes
ESC[0m Reset all attributes
ESC[1m bold
ESC[4m underline
ESC[5m Turn on blink
ESC[7m Turn on reverse color
ESC[9m Turn on strike out
ESC[27m Turn off reverse color
ESC[22m Turn off bold attribute
ESC[24m Turn off underline attribute
ESC[25m Turn off blink attribute
ESC[29m Turn off strike out attribute
ESC [22m Turn off bold attribute
ESC [24m Turn off underline attribute
ESC[5n Device Status Report. Returns ESC [0n
ESC[6n Cursor Position Report. Returns ESC [(row);(col)R
ESC[?25l Hide cursor
ESC[?25h Show cursor
ESC[(start);(end)r Set top and bottom margins of the scrolling region
ESC[r Restore scrolling region
ESC(0 Set Special Graphics to the G0 set
ESC(B Set ASCII to the G0 set
ESC)0 Set Special Graphics to the G1 set
ESC)B Set ASCII to the G1 set
Note: ESC(1, ESC(2, ESC(A are accepted, but treated as ASCII
SO Shift Out: Invoke G1 character set
SI Shift In: Invoke G1 character set
Color attributes
color FG BG FG high BG high
--------------------------------------------
black ESC[30m ESC[40m ESC[90m ESC[100m
red ESC[31m ESC[41m ESC[91m ESC[101m
green ESC[32m ESC[42m ESC[92m ESC[102m
yellow ESC[33m ESC[44m ESC[99m ESC[103m
blue ESC[34m ESC[44m ESC[94m ESC[104m
magenta ESC[35m ESC[45m ESC[95m ESC[105m
cyan ESC[36m ESC[46m ESC[96m ESC[106m
black ESC[37m ESC[47m ESC[97m ESC[107m
FG = foreground
BG = background
High = higher intensity
Note that setting colors can be combined attributes and
for/background in one Escape sequence is supported
You can use for example
ESC [1;31;104m (bold, red foreground, blue background)
Printable character (>= $20) is placed on screen where the cursor is,
cursor moved to next position
Wrap around at end of line, screen scroll up when bottom line is reached
DEC Special Graphics Characters
The escape sequence ESC(0 switches the codes for lower-case ASCII letters to draw this set, and the sequence ESC(B switches back.
Normal Set
“Special Graphics” Set
_
Blank
`
Diamond
a
Checkerboard (error indicator)
b
Horizontal tab
c
Form Feed
d
Carriage return
e
Line feed
f
Degree symbol
g
Plus/minus
h
New line
i
Vertical tab
j
Lower-right corner
k
Upper-right corner
l
Upper-left corner
m
Lower-left corner
n
Crossing lines
o
Horizontal line – Scan 1
p
Horizontal line – Scan 3
q
Horizontal line – Scan 5
r
Horizontal line – Scan 7
s
Horizontal line – Scan 9
t
Left “T”
u
Right “T”
v
Bottom “T”
w
Top “T”
x
| Vertical bar
y
Less than or equal to
z
Greater than or equal to
{
Pi
|
Not equal to
}
UK pound sign
~
Centered dot
Note 1:
Codes 1528-1568, 1618, and 1648-1708 are used to draw rectangular grids; each piece
of this line drawing set is contiguous with others so that the lines formed are unbroken.