Skip to main content

Brief

An opcode is a specific function that belongs to a category. Opcodes are represented in the form of an 8-bit (one byte) hexadecimal number in opcode mode, or in abbreviation form in "mnemonic mode".

The instruction set is published in six booklets:

Program Line Format​

Each line of code consists of five bytes: [inst] [P00] [P01] [P10] [P11]. On the programmer interface a line is displayed as:

LINE  INST  OP-0  OP-1

where LINE is the 3-digit hexadecimal line address, INST is the opcode (2 hex digits) or its mnemonic, OP-0 = P00+P01 and OP-1 = P10+P11 (each 4 hex digits).

Basic Units​

LabelDescriptionRange
P00First 8-bit operand byte00~FF
P01Second 8-bit operand byte00~FF
P10Third 8-bit operand byte00~FF
P11Fourth 8-bit operand byte00~FF

Combined 16-bit Operands​

LabelCompositionRange
OP-0P00 + P01 combined as 16-bit0000~FFFF
OP-1P10 + P11 combined as 16-bit0000~FFFF

Operand Interpretation Modes​

Since instruction set v2, operands are interpreted in exactly three ways. Whenever a parameter is a 16-bit value, it is always annotated as P00P01 = 16-bit whole or P10P11 = 16-bit whole — never split it into two independent bytes.

Mode A — two 8-bit sub-operands + one 16-bit whole​

P00P01P10P11
00~FF00~FF0000~FFFF (whole)

Typical: the jump family (0x04~0x0E, P10P11 = target line), 0x10 FZ (P10P11 = immediate value), 0x02/0x03 (P00P01 = time value, P10P11 = addressing + unit code).

Mode B — four independent 8-bit sub-operands​

P00P01P10P11
00~FF00~FF00~FF00~FF

Typical: the plotting family (X/Y coordinates), 0xE4 CD (LED number + R/G/B).

Mode C — 16-bit whole + 16-bit whole​

P00P01P10P11
0000~FFFF (whole)0000~FFFF (whole)

Typical: 0xE10xE3, 0xEB0xEF (channel bit-masks / duty cycles).

Don't-Care Operands​

Some opcodes do not require operands, or certain operand bytes are ignored. These are marked "don't care" in the booklet tables.

caution

Operands marked as "don't care" can be any value. For clarity and consistency, ignored operands are documented as 00 or 0000.

Unit Codes​

The unit of a time value is selected by a unit code in P11, shared by 0x02 YS (delay) and 0x03 DS (timer):

Code0 (default)12340x10
Time1 ms10 ms100 ms1 s10 s1 min

Port System​

The port system is shared by 0x0B TZ, 0x13 SS, 0x14 QS, 0x41 JT and 0x42 DK:

PortPinsDirectionDescription
Port000~06read-only7 onboard buttons
Port110~17bidirectional8 digital IO (LED network) — SS write restores the output direction, QS read switches to input with pull-up
Port220~23output4 IO/PWM shared pins
Port330~3Fread-onlyADS1115 16 channels (>2.5 V = 1 / millivolt values)
Port4~640~6Fwrite-onlyPCA9685 modules 0/1/2, 16 channels each

Pin addressing: one byte = port<<4 | pin, e.g. 0x14 = Port1 Pin4.