Category:Hangul BASIC
This page was last modified 21:08, 30 May 2023 by Mars2000you. Based on work by Sd snatcher and Rderooy.



Hangul BASIC is a BASIC extension that is available on Korean MSX/MSX2 computers and on Korean MSX2 consoles. It is not available on Korean MSX1 consoles.


There are 4 versions of this extension - the 3 first versions were created by the Korean Qnix company.

Instructions (general info)

Versions 2 to 4 extend the SCREEN instruction with the SCREEN 9 dedicated to the Korean characters. However, version 4 allows to use this screen with non-Korean MSX2 (and higher) computers.

The number of new instructions added by Hangul Basic is as follows:

  • 2 new instructions on Korean MSX1 computers (= version 1)
  • 6 new instructions on Korean MSX2 computers (= version 2)
  • 13 new instructions on Korean MSX2 consoles (= version 3)
  • 19 new instructions with Plaire ROM version (= version 4)
  • 15 new instructions with Plaire BIN version (= version 4)

Check the alphabetic order section to know which instructions are available according the version.


  • CALL can be replaced by the character underscore (_). A space is not required after this character. See CALL for more info
  • All instructions of Plaire version are for non-Korean MSX1 and higher, except CALL MODE9, CALL PALETTE and CALL RTCINI, that require at least a MSX2 machine.

Instructions (ordered per category)

Conversion Functions

Instruction Function
CALL KCHR Returns the Korean character corresponding to an hexadecimal code
CALL KCODE Returns the code of the first character in a string with Korean characters


Instruction Function
CALL CLS Clears the screen in any screen mode
CALL ENG Leaves current used screen and goes back to screen 0
CALL MODE9 Goes to SCREEN 9 while automatically using width 80
CALL PALETTE Alters MSX color palette
CALL RTCINI Changes the parameters saved in the SRAM of the Real Time Clock (RTC)
and related to the COLOR, KEY ON / OFF, SCREEN and WIDTH instructions
to use the same values as with the Daewoo CPC-400 and CPC-400S computers
PUT HAN Displays characters defined by double-byte codes in screen 5 to 8
Can be used only on Daewoo CPC-400/400S
SET HAN Defines how the Hangul characters are displayed on screen 0 to 8
Usage of this instruction is extended in version 4 of Hangul BASIC in ROM format

Hangul I/O System

Instruction Function
CALL HELP Displays a simple help text, optimised for a screen with width 80
CALL REBOOT Reboots the computer
CALL VER Displays version of the Hangul I/O system developed by Korean MSX fan Plaire
SET SYSTEM Sets if the built-in firmware must be run (CPC-300)
or the Hangul code used at computer starting (CPC-400/400S)

Keyboard and/or Controllers

Instruction Function
CALL ADJUST Enables internal light pen interface on Daewoo MSX2 computers - Short version: _ADJUST
This instruction is standard on non-Korean MSX2 computers manufactured by Daewoo
Maybe also on Sanyo MPC-X Graphic Expander Unit and Sanyo MPC-27 computer
CALL FONT Allows to switch between Korean characters and non-Korean characters
CALL HANOFF Disables the feature allowing that Hangul characters are grouped into blocks
CALL HANON Enables the feature allowing that Hangul characters are grouped into blocks

String Handling

Instruction Function
CALL KEXT Returns a string with half-width (non-Korean) or full-width (Korean) characters removed
from a string or variable
CALL KINSTR Returns position of first occurrence of a substring in a string, this from a specified position
CALL KLEN Returns the length of a string, including all non-printable characters
CALL KMID Returns a string corresponding to a number of characters from an original string,
this from a specified position
CALL KTYPE Checks the character type (non-Korean or Korean) of a character in a specified position of a string

Instructions (alphabetical order)

Instruction KR MSX1 computers KR MSX2 computers KR MSX2 consoles Plaire Type
CALL ADJUST - x - - Keyboard and/or Controllers
CALL CLS - - - x Display
CALL ENG - - x x Display
CALL FONT - - - x (*) Keyboard and/or Controllers
CALL HANOFF x x x x Keyboard and/or Controllers
CALL HANON x x x x Keyboard and/or Controllers
CALL HELP - - - x (*) Hangul I/O System
CALL KCHR - - x x Conversion Functions
CALL KCODE - - x x Conversion Functions
CALL KEXT - - x x String Handling
CALL KINSTR - - x x String Handling
CALL KLEN - - x x String Handling
CALL KMID - - x x String Handling
CALL KTYPE - - x x String Handling
CALL MODE9 - - - x Display
CALL PALETTE - - x x Display
CALL REBOOT - - - x (*) Hangul I/O System
CALL RTCINI - - x x Display
CALL VER - - - x (*) Hangul I/O System
PUT HAN - x - - Display
SET HAN - x x x Display
SET SYSTEM - x - - Hangul I/O System

(*) Only with ROM version, not available with BIN version