PUT HAN
This page was last modified 08:44, 4 February 2022 by Mars2000you.

Contents

Effect

Displays characters defined by double-byte codes in SCREEN 5 to 8.

It can be Hangul characters, but also Kanji characters (that are named Hanja characters in Korea).

This instruction is available only on the Daewoo CPC-400 and CPC-400S machines, that have a special Kanji/Hanja ROM.

Notes:

  • PUT HAN can't be used on SCREEN 9. However, this screen allows to display Hanja characters by using this procedure:
    • enter SCREEN 9 and WIDTH 64
    • enter any Hangul character
    • move your cursor onto any Hangul character which you want to convert to Hanja
    • press the SELECT key to see list of Hanja characters compatible with the selected Hangul character
    • select the Hanja character that you want to display
  • The procedure is similar inside some applications to convert Hangul into Hanja:
    • enter any Hangul character
    • move your cursor onto any Hangul character which you want to convert to Hanja
    • press SHIFT + SELECT to open a window at the bottom of the screen
    • enter the hexadecimal value of the Hanja character that you want to display

Syntax

PUT HAN STEP(<X>,<Y>),<CharacterCode>,<Color>,<Operator>,<Mode>

Parameters

<X> is coordinate X of destination. (0-255/511)

<Y> is coordinate Y of destination. (0-211)

The coordinates (with the parentheses) can be omitted only if there are parameters behind.

If STEP is used before these coordinates, they are interpreted relative to the current cursor position. In this case the values can also be negative.

<CharacterCode> is the code corresponding to a character. The codes for Hanja characters are from &HD440 to &HEAAA.

<Color> is the color code = 0 to 15 (screens 5 and 7), 0 to 3 (screen 6), 0 to 255 (screen 8).

<Operator> is the logical operation to be performed between the color of the old pixel and the new color.

The available operators are AND, OR, PRESET, PSET (default), TAND, TOR, TPRESET, TPSET, TXOR, XOR. Specifying a logical operation preceded by "T" causes nothing to be done when specified color is transparent (color 0).

The effect of the operators is done on each corresponding bit as shown in the following table.

Current bit Specified color bit AND OR PRESET PSET XOR
0 0 0 0 1 0 0
0 1 0 1 0 1 1
1 0 0 1 1 0 1
1 1 1 1 0 1 0


<Mode> is the character size. (0-2, 0 by default)

  • 0 is 16x16 dot
  • 1 is 16x8 dot (only even lines are displayed)
  • 2 is 16x8 dot (only odd lines are displayed)

Example

10 SCREEN 6,,2
20 COLOR 3,0,0: CLS
30 SET PAGE 0,0:CLS: 'Clears page 0
40 PUT HAN (128,90),&HD442,3,,1: 'Writes even lines of a Chinese character pattern on page 0
50 SET PAGE 1,1:CLS: 'Clears page 1
60 PUT HAN (128,90),&HD442,3,,2: 'Write odd lines of a Chinese character pattern on page 1
70 GOTO 70

Related to

AND, OR, XOR

Compatibility

Hangul BASIC version 2, only on Daewoo CPC-400/400S