Skip to main content

Drawing & Display

Instructions in this category draw graphics and output numbers or text on the display.

Every coordinate is an 8-bit value (00~FF), written in hexadecimal in the program. Coordinates are shifted by an offset and converted by the MCU into commands for the main screen. Shapes are drawn with the pen color taken from the drawing-color register, and the text background follows the background-color register.

0x55 Display Number (SC)​

Display the value of a register at the given position, formatted as a decimal number with optional decimal places.

000  10  000A  0064    R10 = 100
001 55 280A 0A01 show R10 at (40,10) with 1 decimal place

The value is divided by 10ⁿ before display: with one decimal place, 100 is shown as 10.0.

info
OperandsValue/RangeRemark
OP-0000~FFX coordinate
OP-0100~FFY coordinate
OP-1000~FFSource register holding the value
OP-1100~FFLow 4 bits: number of decimal places n (displayed as value/10ⁿ); high 4 bits: fixed display length
note

The format of OP-11 (decimal places / fixed length) is pending on-hardware verification.

0x56 Display Text (WZ)​

Display ASCII characters read from consecutive memory starting at a register.

000  10  0014  4849    R20 = "HI" (48 49 hex)
001 56 0000 1402 show 2 chars from R20 at (0,0)

Characters are read byte by byte starting at the register given in OP-10: high byte of R[n], low byte of R[n], high byte of R[n+1], and so on. In the example, H (48) is stored in the high byte and I (49) in the low byte of R20.

info
OperandsValue/RangeRemark
OP-0000~FFX coordinate
OP-0100~FFY coordinate
OP-1000~FFStarting register number
OP-1101~10Number of characters, at most 16

0x57 Draw Circle (YX)​

Draw a hollow circle with the specified center and radius.

000  57  7070  0A00    hollow circle, center (112,112), radius 10
info
OperandsValue/RangeRemark
OP-0000~FFCircle center X coordinate
OP-0100~FFCircle center Y coordinate
OP-1000~FFRadius
OP-1100Ignored

0x58 Draw Filled Circle (YXTC)​

Draw a filled circle with the specified center and radius.

000  58  7070  0A00    filled circle, center (112,112), radius 10
info
OperandsValue/RangeRemark
OP-0000~FFCircle center X coordinate
OP-0100~FFCircle center Y coordinate
OP-1000~FFRadius
OP-1100Ignored

0x59 Draw Rectangle (JX)​

Draw a hollow rectangle with the specified diagonal vertices.

000  59  3030  5580    hollow rectangle, (48,48) to (85,128)
info
OperandsValue/RangeRemark
OP-0000~FFVertex X0 coordinate
OP-0100~FFVertex Y0 coordinate
OP-1000~FFVertex X1 coordinate
OP-1100~FFVertex Y1 coordinate

0x5A Draw Filled Rectangle (JXTC)​

Draw a filled rectangle with the specified diagonal vertices.

000  5A  1010  2020    filled rectangle, (16,16) to (32,32)

The width of the rectangle is x1−x0 and the height is y1−y0.

info
OperandsValue/RangeRemark
OP-0000~FFVertex X0 coordinate
OP-0100~FFVertex Y0 coordinate
OP-1000~FFVertex X1 coordinate
OP-1100~FFVertex Y1 coordinate

0x5B Draw Line (HX)​

Draw a straight line between two specified points.

000  5B  6060  2020    line from (96,96) to (32,32)
info
OperandsValue/RangeRemark
OP-0000~FFEndpoint 1 X coordinate
OP-0100~FFEndpoint 1 Y coordinate
OP-1000~FFEndpoint 2 X coordinate
OP-1100~FFEndpoint 2 Y coordinate