MSX Characters and Control Codes
This page was last modified 12:24, 11 October 2019 by Gdx. Based on work by Mars2000you and Rderooy.

Contents

General description

This page covers the MSX character set. The character set depends on the region the machine was sold in. e.g. a Japanese machine will have a Japanese character set. The bits 0-3 at address 002Bh in Main-ROM are supposed to indicate the region of MSX character set but this has not been respected by non-Japanese manufacturers.

Some software is dependant on the correct character set, and will show incorrect characters when run on an MSX from another region. Examples are Japanese software using Hiragana, Katakana from its character set, which show as various other characters on European machines. Or European software using characters such as accented letters or math symbols which are replaced by Japanese writing characters on a Japanese machine.

Control codes

The MSX can perform an action by simultaneously pressing the "CTRL" key with another. These actions can be detected during a reading of the keyboard but also performed in text mode by sending the codes to the display. Here is the list of available actions with the corresponding codes (these codes are common to all MSXs):

Code Keys Effect
1 GRAPH Allows you to display an extended graphic character
2 CTRL B Moves the cursor to the previous word
3 CTRL C Aborts MSX-DOS
5 CTRL E Deletes the line to the right of the cursor
6 CTRL F Moves the cursor to the next word
7 BEEP Produces a simple 'beep' PSG sound
8 BS Back Space key
9 TAB Tabulation key
Ah (10) LF Descends the cursor of a line
Bh (11) HOME Places the cursor at top left
Ch (12) CLS Clears the screen
Dh (13) RETURN Executes previous instruction
Eh (14) CTRL N Moves the cursor to the end of the line
Clears output to printer in MSX-DOS
Fh (15) CTRL O
10h (16) CTRL P Output to printer in MSX-DOS
11h (17) CTRL Q Resumes from MSX-DOS pause
12h (18) INS Switch to insert/overwrite text mode
13h (19) CTRL S Pause in MSX-DOS
14h (20) CTRL T
15h (21) CTRL U Deletes the line where the cursor is located
18h (24) SEL Selection key
19h (25) CTRL Y
1Ah (26) CTRL Z
1Bh (27) ESC Escape key
1Ch (28) Moves the cursor to the right
1Dh (29) Moves the cursor to the left
1Eh (30) Mounts the cursor
1Fh (31) Drops the cursor
7Fh (127) DEL Deletion key


Escape codes

The MSX can also perform an action by simultaneously pressing the "ESC" key with another. This actions can be carried out in text mode by sending the codes to the display as for the control codes. These codes are compatible with VT-52 or HEATH-19 terminals. Below is the list (these codes are common to all MSXs):

Codes Keys Effect
1Bh+41h (27+65) ESC+A Mounts the cursor
1Bh+42h (27+66) ESC+B Drops the cursor
1Bh+43h (27+67) ESC+C Moves the cursor to the right
1Bh+44h (27+68) ESC+D Moves the cursor to the left
1Bh+45h (27+69) ESC+E Clears the screen and moves the cursor to home
1Bh+48h (27+72) ESC+H Places the cursor at top left
1Bh+4Ah (27+74) ESC+J Clears to end of screen
1Bh+4Bh (27+75) ESC+K Deletes the line to the right of the cursor
1Bh+h (27+76) ESC+L Inserts a line
1Bh+4Dh (27+77) ESC+M Deletes a line
1Bh+59h (27+89) ESC+Y+line+col Sets cursor coordinates.
The next character is abscissa (x+32),
the second is ordinate (y+32)
1Bh+6Ah (27+106) ESC+j Clears the screen and moves the cursor home
1Bh+6Ch (27+108) ESC+l Deletes the line at the cursor
1Bh+78h+34h (27+120+52) ESC+x+4 Cursor to full size
1Bh+78h+35h (27+120+53) ESC+x+5 Removes the cursor
1Bh+79h+34h (27+121+52) ESC+y+4 Cursor to half size
1Bh+79h+35h (27+121+53) ESC+y+5 Shows the cursor


Arabian codes

Arabic MSXs have two character sets, when the CTRL key is pressed while the MSX is booting up to its "beep", the MSX starts with the Hand-ROM with an international character set.

Arabian codes


















  • Control codes are in blue. These are ignored by PRINT instruction in graphic modes.
  • The characters 20h to 7Fh are coded 7-bit ASCII.
  • Green characters are characters specific to Arabic MSX.
  • 8Eh-9Fh codes can be empty characters.
  • Characters from A0h are displayed by default with black background color in SCREEN1 on MSX1.
  • Arabic MSX does not have extended graphic characters.

Note: We will appreciate any help to explain the complet coding of Arabic characters.

International codes

This covers the English USA/International/UK, Germanic and French character sets.

International codes




















  • Control codes are in blue. These are ignored by PRINT instruction in graphic modes.
  • The characters 20h to 7Fh are coded 7-bit ASCII.
  • Green characters are characters specific to Western MSX.
  • The last character (FFh) is the cursor.
  • The bottom table, with two rows (orange characters), are extended graphic characters. To display them in text modes, each must be preceded by the control code 01h. They are also specific to Western MSX and Russian MSX. Shapes of theses characters are located on the first 32 characters. MSX font page if you need info about the International Font.

Brazilian codes

Brazilian with ROM v1.0

Early versions of the Sharp HB-8000 and Gradiente Expert XP-800 computers had character sets, while based on the international character set, were created by their respective companies and different from each other. This caused problems for both software developers and printer manufacturers.

Compared with the international character set, the changes can be found in the tables from 84h - 8Fh. Other characters are the same as the international table.

In addition, since both manufacturers created the additional symbols themselves they used a different font style.

Gradiente v1.0

Brazilian with ROM v1.1

This issue was mostly resolved when Sharp and Gradiente issued a recall to replace, for free, the original 1.0 ROMs with a new 1.1 ROM and also replaced some key caps on the keyboard. Newer Sharp HB-8000 and newer Gradiente computers shipped with these newer ROMs. These newer ROMs comply with the "Brazilian ASCII" specification, or BRASCII.

Some differences however remain:

  • Each manufacturer retained different font styles for the Brazilan characters
  • The only difference is the character at 9Eh, where on the Gradiente ROM they provided the "Cz" currency character for the short lived Brazilian "Cruzados", and on the Sharp HotBit ROM they provided instead the Spanish Peseta "Pt" currency symbol like the international character set.
Sharp HB-8000 v1.1

Sharp HotBit with ROM v1.2

The only difference here is that Sharp replaced the "Pt" symbol with the "Cz" symbol, similar to the v1.1.

Sharp HotHit 1.2 ROM

Japanese

The first 128 characters are the same characters as the ASCII code, except the character "\" (5Ch) which has been replaced by the "¥" character of the Microsoft 8-bit JIS code.

Japanese codes




















  • The above list is for MSX2+ and MSX Turbo R. MSX and MSX2 have differences in Hiragana. It has been modified to allow display on SCREEN 0.
  • Control codes are in blue. These are ignored by PRINT instruction in graphic modes.
  • The characters 20h to 7Fh are coded 7-bit ASCII.
  • Green Hiragana and Purple Katakana are characters that come from the 8 bit JIS code.
  • The last character (FFh) is the cursor.
  • The bottom table, with two rows (orange characters), are extended graphic characters. To display them in text modes, each must be preceded by the control code 01h. They are also specific to Japanese MSX. Shapes of theses characters are located on the first 32 characters. MSX font page if you need info about the Japanese Fonts.

Korean codes

The first 128 characters are the same characters as the ASCII code, except the character "\" (5Ch) which has been replaced by the character "₩".

The next characters appear in a rather specific way. A Korean character (Hangul) is composed of 2 or 3 letters but takes the place of four 8x8 characters (two above and two below) on the screen.

Note: We will appreciate any help to explain the coding of Korean characters.

Russian codes

The first 128 characters, up to 7Fh, are identical to the International character set, including the extended character set.

The range from 80h onward is different. The upper range includes some of the same drawing characters as in the international set but at different locations, and it obviously includes Russian specific characters.

Russian codes






















  • 80h-BEh contain relocated characters from the International character set (C0h-FEh)
  • BFh-FEh contain Russian specific characters
  • FFh is the cursor
  • The bottom two rows (orange characters), are extended graphic characters. To display them in text modes, each must be preceded by the control code 01h. These are the same as found on the International character set. Shapes of theses characters are located on the first 32 characters. MSX font page if you need info about the Russian Font.

The Russian character set is mostly compliant with KOI8-R, except that on MSX the letters «Ъ», «Ё» and «ё» are missing.

Detection

Here is an example of how to detect the character set and various other MSX regional settings from BASIC.

This is a translated version of a program called MSX TYPE from the Dutch MSX Computer Magazine issue 3.

10 REM MSX TYPE
20 REM
30 REM MSX Computer Magazine
40 REM issue 3
50 REM
60 CLS: LOCATE 10,0: PRINT "MSX COMPUTER TYPE"
70 LOCATE 6,5: PRINT "CHARACTER SET: ";
80 I=PEEK(&H2B) AND 15
90 IF I=0 THEN PRINT "JAPANESE"
100 IF I=1 THEN PRINT "INTERNATIONAL"
110 IF I=2 THEN PRINT "KOREAN"
120 LOCATE 10,7: PRINT "DATE TYPE: ";
130 I=(PEEK(&H2B) AND 112)/16
140 IF I=0 THEN PRINT "YEAR-MONTH-DAY"
150 IF I=1 THEN PRINT "MONTH-DAY-YEAR"
160 IF I=2 THEN PRINT "DAY-MONTH-YEAR"
170 LOCATE 0,9: PRINT "INTERRUPT FREQUENCY: ";
180 I=(PEEK(&H2B) AND 128)/128
190 IF I=0 THEN PRINT "60 HERTZ"
200 IF I=1 THEN PRINT "50 HERTZ"
210 LOCATE 11,11: PRINT "KEYBOARD: ";
220 I3=PEEK(&H2D) AND 15
230 IF I3=0 THEN PRINT "JAPANESE"
240 IF I3=1 THEN PRINT "INTERNATIONAL"
250 IF I3=2 THEN PRINT "FRENCH"
260 IF I3=3 THEN PRINT "ENGLISH"
270 IF I3=4 THEN PRINT "DIN"
280 LOCATE 14,13: PRINT "BASIC: ";
290 I=(PEEK(&H2D) AND 240)/16
300 IF I=0 THEN PRINT "JAPANESE"
310 IF I=1 THEN PRINT "INTERNATIONAL"

Note the above is not foolproof. Arabic, Brazilian and Russian MSX computers will claim to have an International or Japanese character set, keyboard and basic.