Skip to content

101. Arch 9's screen opcodes 22 and 23 are a page select and a page transfer

An outside lead, verified here rather than adopted. On 10 August 2026 trelowney, who maintains harmony-decompiler and published the arch 9 config this project uses as a control, wrote with two firmware addresses and a reading of what they do, having noticed that docs/config-format.md left arch 9's opcode 22 without a traced consumer.

Decision 7 applies and was followed: an upstream finding is a hypothesis to test. Every address below was checked against this project's own 525 image, read off the remote on 8 August 2026, and the dispatcher was decoded with harmony/pic18/chains.py rather than by eye. What came from outside is a pointer to where to look; what is asserted here is this project's own reading of its own image.

The dispatcher, and both handlers

0x04650, fourteen opcodes, and the two in question:

opcode handler
22 0x046D6 reads one operand byte into 0xD9, calls 0x038EC
23 0x046E8 no operand, drives the panel
038ec: d9 c0 c0 f0 MOVFF 0x0d9,0x0c0   ; the row index, kept
038f0: 08 0e       MOVLW 0x08
038f4: d9 03       MULWF 0x0d9
038f6: f3 cf c1 f0 MOVFF PRODL,0x0c1   ; row * 8
038fa: 07 0e       MOVLW 0x07
038fc: f3 24       ADDWF PRODL,W
038fe: c2 6f       MOVWF 0x0c2         ; row * 8 + 7

and opcode 23:

046e8: 8d 84       BSF LATE,2          ; the external latch arch 9 clocks with LATE
046ea: 89 9a       BCF LATA,5
046ee: 60 0e       MOVLW 0x60          ; 96, the panel's width
046f4: d7 6b       CLRF 0x0d7
04714: 4c ec 1c f0 CALL 0x03898        ; the transfer
04718: 89 8a       BSF LATA,5
0471a: 8d 94       BCF LATE,2
0471c: b5 ec 3a f0 CALL 0x0756a

The closure the lead did not have

0x03898 opens with two instructions that name the hardware:

03898: b0 0e       MOVLW 0xb0
0389c: c0 11       IORWF 0x0c0,W       ; 0xB0 | row
0389e: c1 d9       RCALL 0x03c22       ; and out to the panel

0xB0 | page is the page address command of the page addressed monochrome display controllers, which address a panel as eight pages of eight pixel rows. So 0xC0 is not a row marked for later use by something else: it is a page index sent to the panel as a command, and 0xC1 and 0xC2 are that page's first and last pixel rows, kept for whatever needs to clip to it.

That settles the open question docs/config-format.md recorded beside opcode 22. Opcode 22 selects a page, opcode 23 transfers 96 pixels into it. Eight of each per mode page is one full 96 by 64 screen, which is exactly what section 85 measured from the data without knowing why it was eight.

Corrected on 10 August 2026. This said 0xB0 | page is the page address command of the SSD1306 family, and named that part, and the sentence after it said the question was settled "by naming the part rather than by describing the arithmetic". The arithmetic was right and the part was wrong, and the part was the load bearing half of that sentence. See the next subsection: the controller's command set is ST7565 class and it is not an SSD1306. Nothing about opcodes 22 and 23 changes, because 0xB0 | page is common to both families, which is exactly why one command was not enough to name a part on.

The controller is ST7565 class, not an SSD1306, and the whole command set says so

0xB0 | page identifies a family of families. Reading the rest of the driver names it properly, and the correction is worth having because a renderer needs the column offset below and because the earlier attribution was made from a single command.

Two things the transfer does after the page command, at 0x038BA onwards:

038ba: 03 0e       MOVLW 0x03
038bc: d7 25       ADDWF 0xd7,B,W      ; the column, plus three
038be: bf d9       RCALL 0x03c3e       ; 0x10 | (col >> 4), the high nibble
038c0: 03 0e       MOVLW 0x03
038c4: d7 25       ADDWF 0x0d7,W
038c6: 0f 0b       ANDLW 0x0f          ; 0x00 | (col & 0x0F), the low nibble
038c8: ac d9       RCALL 0x03c22

and 0x03C3E is the high nibble command in full, ANDLW 0xF0, SWAPF, ANDLW 0x0F, IORLW 0x10. So a transfer is page, then column high, then column low, then 96 data bytes, and the panel's column 0 is the controller's column 3. That offset is a fact a renderer needs and it is also evidence: a controller whose RAM is wider than its panel is what produces one.

The init sequence at 0x0357A to 0x035FE is where the part is actually named. Sorted by which family each command belongs to, counted over the driver region 0x03500 to 0x03D00:

commands present of
shared by both families 0x40 start line, 0x81 contrast, 0xA0 segment direction, 0xA4 and 0xA5 all pixels, 0xAE and 0xAF display off and on, 0xC0 COM direction 8 of 10
ST7565 and UC1701 only 0xE2 software reset, 0xA2 LCD bias, 0x24 and 0x25 resistor ratio, 0x2F power control, 0xF8 booster ratio 6 of 10
SSD1306 only none 0 of 10

The SSD1306 column is the negative control and it is empty. Not one of 0x8D charge pump, 0xD5 display clock divide, 0xD9 precharge, 0xDA COM pins, 0xDB VCOMH, 0xA8 multiplex ratio or 0xD3 display offset appears anywhere in the driver, and an SSD1306 cannot be brought up without the charge pump command at least. The scan's one apparent hit, 0x20 at 0x03AA0, is MOVLW 0x20 followed by ANDWF 0x05,W: a bit mask outside the driver, not a memory addressing mode.

Meanwhile the ST7565 commands are not scattered, they are the init sequence in the order that family documents: reset, bias, segment direction, COM direction, resistor ratio, power control, booster ratio, contrast, start line, display on. 0x81 is a two byte contrast command there, and 0xF8 a two byte booster ratio, and both are called through 0x03C2E, which sends two bytes where 0x03C12 sends one.

What is claimed and what is not. The command set is ST7565 class, on six positive and ten negative signatures. The exact part is not established and is deliberately not named: this is one firmware image, the only arch 9 one that exists here, and a datasheet search or a photograph of the board is what would finish it. The 96 by 64 panel with a three column offset narrows the candidates and does not close them.

One command in the init is unnamed in either family, 0x89 at 0x0357E, recorded rather than explained.

Opcode 23 is not arch 12 only, and the table said it was

The same message reported that as a stale line, and it is. Counted rather than eyeballed, over every screen program in each container:

sample architecture opcode 22 opcode 23
one_config 12 330 268
one_config_unprogrammed 12 152 111
h525_config 9 1992 1992
h525_config_2 9 1376 1376
the three arch 14 and the arch 8 control 14, 8 0 0

On arch 9 they are paired one to one, which is what a select and a transfer should be, and on arch 12 they are not, because there a call does not have to return through opcode 23 on every path.

Nothing was broken by the stale line: packages/codec accepts opcode 23 globally with zero operands, so every arch 9 program has always decoded. It was the comment that drifted, which is the failure mode step 4 of this project's own convention exists to catch and which caught nothing here because the sweep was of the numbers, not of the words beside them.

And two counts that look contradictory are not. Section 85 gives 1080 opcode 22s for h525_config and the table above gives 1992. The populations differ: 1080 is the mode pages, eight per page across 135 pages, and the 1992 counts several of those programs twice. Both are right and neither is complete on its own, so a number quoted from either needs its population attached.

Corrected on 11 August 2026, and the correction is section 118. This said the remaining 912 "sit in programs base slot 11 addresses directly". They do not. Base slot 11 holds 22 programs in h525_config and between them they contain two opcodes, 0 and 17, so there is no opcode 22 in that slot at all. The 912 is the mode records, and it is the same programs counted a second time.


Section 100 | the archive | section 102. Section 101 of the findings archive, which is frozen; the reference holds the current answer. The archive on GitHub.