Commit Graph
1 Commits
Author SHA1 Message Date
Cryan209andClaude Opus 5 4772fbe1a9 AT&T1 reaches the datapump through the test flag, not the call gate
Tools first: tools/x86_disasm.py wraps capstone over CourierRom.at so an
80186 routine can be read at the same physical addresses the traces
print, and tools/executed_addresses.py dumps the whole track_executed set
and diffs two runs as contiguous spans. hot_addresses is a top-20 profile
and cannot say whether a branch ran at all; the diff can, and it is what
found everything below. AT&T0 executed 2,885 addresses, AT&T1 3,745, and
&T1 against &T8 differs by 10.

The &T dispatch is a table of far-call thunks at 875d8, four bytes apart.
Slot 0 -> 875f8 and slot 1 -> 876b1 are confirmed executed by AT&T0 and
AT&T1, slot 7 -> 87738 by AT&T8. The middle slots are not named here
because nothing ran them.

[0x685] is the test-mode flag byte. Every access to it in the image - 51
sites - agrees on the bits:

  0x01  analogue loopback     876c5 (&T1), 87752 (&T8)
  0x02  a second loopback     876eb
  0x04  a third               8770e, 8825c
  0x08  self test             87752 as |9, 8772c as |0c
  0x40  already-online form   876bd, 8774b
  0x80  test armed            87764
  0x07  any loopback, a gate  833bb, 88236, a4fea, a6abd

So the modes differ by bit, and the test pattern is bit 3, not bit 0.
[0x686] is the self-test error counter: &T8 zeroes it, and &T0's handler
does `test [0x685],8 / jz / call 8776f`, which reads [0x686] and prints
it. &T1 sets bit 0 alone - no internal pattern and no counter.

The part that corrects earlier work here: the gate at 8b863 that
datapump-dispatch-gate.md documents returns carry *clear* under &T1.
8bbc2, the carry-clear target, is in the &T1-only set and 8bbaa's carry
branch is not taken. The datapump comes in through 8b84f instead:

  8bbc2  call 8b84f
  8bbc5  jne  8bbca          taken
  8b84f  test [0xa96],2      jnz ret
  8b856  test [0x5a5],1      jnz ret
  8b85d  test [0x685],1      the loopback bit leaves ZF clear

8b85d is in the &T1-only set. The test flag is what routes to 8bbca and
the 344-address block at 8bbe9..8bd40 that selects the datapump, loads
overlay 6 and publishes 0010:5001. &T0 confirms the shape by absence: it
runs slot 0 and 875fb and never reaches 87438, 8b85d or 8bbc2.

Two sites ran under &T1 that gate against the test rather than for it,
and are where to look next for why the DTE data path never opens:

  a4d4c  test [0x685],0x80 / and [0x685],0x7f / stc / ret
         the armed bit is consumed and cleared on first pass, one shot
  a6abd  test [0x685],7 / jnz -> stc; ret
         refuses the jump through cs:[bx+0x1dbe] while any loopback is up

No behaviour changes in this commit; both tools are smoke-tested against
the runs above and reproduce them.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-16 12:07:18 +12:00