Skip to main content

Ready to edit

Before starting writing the first program, let's review some essential concepts, definitions and operations.

Editing Area​

In Edit Mode, there are two edit areas on the bottom row on the primary display.

Line Number Area​

Line number area contains three characters, (0,1), (1,1) and (2,1), to indicate the line numbers in hexadecimal format.

caution

Pressing either â†ĩī¸ (confirm the change and save the current line) or â†ē (do not accept the change) to move the cursor back to the line number area.

Instruction Area​

To shift the cursor from Line Number Area to Instruction Area, just move it to position (2,1) (the least digit of line number) and press →ī¸ī¸ key one more time.

The cursor will be locked in Instruction Area, between position (4,1)~(15,1).

Use ← and → keys to move the cursor among the digits for instruction and opcodes, and use ↑ and ↓ to change the hexadecimal values.

tip

When finished editing the current line, press â†ĩ key to confirm the change, or press â†ē key to drop the change. The cursor will return to line number area after one of the above actions.

Toggle Single/Double-Byte Decimal Conversion​

In Edit Mode, use combo keys → +ī¸ â†ē to toggle the decimal conversion between single- and double-byte precision, i.e. either four 8-bit values, or two 16-bit values.

Primary Display
Ю  01000┐ 00000┐
000 02 03E8 0000
Primary Display
ĐŽ002&255 000&128
000 E4 02FF 0080

Conversion between decimal and hexadecimal in above example:

DecimalHexadecimal
00202
255FF
00000
12880

Direct Decimal Entry​

In many cases, using and thinking in decimal could be more convenient and efficient.

For instance, a 2500 milliseconds delay is required in a program, comparing with a hexadecimal value 0x09C4, it is more direct to type in a decimal value 2500.

Primary Display
Ю  02500┐ 00000┐
000 02 09C4 0000

By pressing combo key ↑ + â†ē, the cursor can be moved to the top line to edit corresponding decimal values. Use ← and → to move the cursor among digits, and use ↑ and ↓ī¸ī¸ to change the selected decimal values.

Use combo key ↓ + â†ē to move the cursor back to the bottom line Editing Area.

Overflow in Decimal to Hexadecimal Conversion​

danger

Overflow happens when the input decimal value requires more bits than 16 bits in double-byte (or 8 bits in single-byte).

The maximum decimal value in 16-bit is:

(FFFF)16=216−1=65535(FFFF)_{16}=2^{16}-1=65535

The maximum decimal value in 8-bit is:

(FF)16=28−1=255(FF)_{16}=2^{8}-1=255

If the input decimal value is greater than the above limit, overflow will occur when pressing â†ĩī¸ key.

OP Overflow

For example, to convert the following decimal numbers to a 16-bit hexadecimal as one opcode, following the overflow rule mentioned above:

500
70000

17 bits are needed for the number 70000 (in binary 1 0001 0001 0111 0000), it will be truncked to 4464 (in binary 0001 0001 0111 0000):

70000−216=446470000-2^{16}=4464

Only 0001 0001 0111 0000 is kept when the â†ĩ key is pressed.

sOP Overflow

For example, to convert the following decimal numbers to two 8-bit hexadecimal as two sub-opcodes, following the overflow rule mentioned above:

5
255
999

Notice that the last number 999 requires 10 bits, saving it in a 8-bit sub-opcode results in:

999−29−28=231999-2^{9}-2^{8}=231

231 will be stored in sOP instead.