{
 "_comment": "generated by tools/mergeSurvey.py from survey/*.json - do not edit by hand",
 "notes": {
  "0B27": {
   "routine": [
    "c128BootEntry - Real entry point of the C128 auto-boot sector. The C128 KERNAL BOOT_CALL ($F890, checked in kernal-318020-05) reads track 1 sector 0 to $0B00, prints BOOTING + the message, parses the filename field, then calls the code with JSRFAR in bank 15. Because the byte after the message terminator is $A0 (the opcode of the LDY #$00 at $0B25), the KERNAL treats it as a one-character filename, tries to LOAD \"0:\"+$A0 (fails silently, result ignored) and sets the entry to $0B27 - verified in x128: the breakpoint at $0B25 never fires, $0B27 is hit with A=X=Y=0. The routine copies 256 bytes from $0B89 to $8000-$80FF (the CBM80 pseudo-cartridge, see boot/c64cart_8000.s), opens the drive command channel, sends \"U0>M0\" (1571 -> 1541 mode) and \"U0>H0\" (head/side 0), writes 0 to the MMU configuration register $FF00 (bank 15) and JMPs to the KERNAL GO64 entry $FF4D, which performs a C64-mode reset; the C64 KERNAL then finds CBM80 at $8004 and runs $8009.",
    "In:  Y must be 0 at entry for the full 256-byte copy. It is, but only because JSRFAR loads Y from the register image at $07, which is zero after a cold reset; the LDY #$00 at $0B25 is never executed.",
    "Out: $8000-$80FF <- $0B89-$0C88 (only $8000-$8076 are meaningful; the rest is C128 RS-232 buffer contents); logical file 15 opened to device 8 secondary 15; drive switched to 1541 mode; $FF00=0; never returns (C64 mode reset)."
   ],
   "unit": "boot/c128BootSector"
  },
  "0B45": {
   "routine": [
    "c128OpenCommandChannel - SETNAM with length 0, SETLFS lfn 15 / device 8 / secondary 15, then JMP KERNAL_OPEN: opens the disk command channel. Called from c128BootEntry ($0B30) and again from the C64-mode cartridge code at $8043, which also relies on the SETLFS values it leaves behind for its later KERNAL_LOAD of \"0:EA\".",
    "In:  none",
    "Out: Logical file 15 open to device 8 secondary 15; A/X/Y clobbered; C = KERNAL_OPEN error flag (ignored by callers)."
   ],
   "unit": "boot/c128BootSector"
  },
  "0B55": {
   "routine": [
    "c128SendDriveCommand - Sends one of three zero-terminated DOS command strings on the already open command channel. A is doubled to index the word table driveCmdPtrTable ($0B75); the pointer goes to $FB/$FC; CHKOUT lfn 15, CIOUT every byte up to (not including) the $00, then JMP KERNAL_CLRCHN. Index 0 = \"U0>M0\" (1571: 1541 mode), 1 = \"U0>H0\" (1571: head 0), 2 = \"I\" (initialise). Called with 0 and 1 by c128BootEntry and with 2 by the C64-mode cartridge code at $8048.",
    "In:  A = command index 0..2 (pre-doubled to a word-table offset in X); command channel 15 must be open.",
    "Out: $FB/$FC = pointer to the string; X/Y clobbered (Y = string length on exit); output channel restored to the screen by CLRCHN."
   ],
   "unit": "boot/c128BootSector"
  },
  "0B68": {
   "routine": [
    "sendDriveCommandLoop - Loop label inside c128SendDriveCommand: LDA ($FB),Y / BEQ done / CIOUT / INY. Not a callable routine.",
    "In:  ($FB),Y = next string byte",
    "Out: Y advanced; exits to $0B72 at the $00 terminator"
   ],
   "unit": "boot/c128BootSector"
  },
  "0B72": {
   "routine": [
    "sendDriveCommandDone - Exit of c128SendDriveCommand: JMP KERNAL_CLRCHN, which unlistens the drive (terminating the command) and restores the default channels.",
    "In:  none",
    "Out: Default I/O channels restored"
   ],
   "unit": "boot/c128BootSector"
  },
  "0B00": {
   "unit": "boot/c128BootSector",
   "block": [
    "c128BootHeader: byteTable, 7 bytes. C128 boot-sector header: signature \"CBM\" ($0B00-$0B02), load address $0000 for additional blocks ($0B03/$0B04), bank 0 ($0B05), 0 additional blocks ($0B06). The KERNAL copies $0B03-$0B06 to $AC-$AF."
   ]
  },
  "0B07": {
   "unit": "boot/c128BootSector",
   "block": [
    "c128BootMessage: text, 30 bytes. \"AN ELECTRONIC ARTS PRODUCTION\" plus $00 terminator at $0B24; the C128 prints BOOTING + this text + \"...\". At run time the KERNAL overwrites $0B23/$0B24 with the drive-number prefix \"0:\" for the filename it thinks follows (observed in x128: $0B20 = \"TIO0:\" $A0 $00)."
   ]
  },
  "0B25": {
   "unit": "boot/c128BootSector",
   "block": [
    "c128BootFileName: unknown, 2 bytes. Intended as the empty-filename terminator + first instruction LDY #$00 ($A0 $00), but the KERNAL parses the $A0 as a one-character filename and the $00 as its terminator. The two bytes are never executed; see misclassified."
   ]
  },
  "0B75": {
   "unit": "boot/c128BootSector",
   "block": [
    "driveCmdPtrTable: addrTable, 6 bytes. Three little-endian pointers to the DOS command strings: $0B7B, $0B81, $0B87. Indexed by 2*A in c128SendDriveCommand (lo via $0B75,X, hi via $0B76,X - hence the disassembler's split labels D_0B75/D_0B76)."
   ]
  },
  "0B7B": {
   "unit": "boot/c128BootSector",
   "block": [
    "driveCmdSet1541Mode: text, 6 bytes. \"U0>M0\",$00 - 1571 command: switch to 1541 mode (the game's drive-resident fast loader and cipher code run at $0300-$05FF in 1541 mode). Harmless on a 1541 (error 31, never read)."
   ]
  },
  "0B81": {
   "unit": "boot/c128BootSector",
   "block": [
    "driveCmdSelectHead0: text, 6 bytes. \"U0>H0\",$00 - 1571 command: select head 0 (side 0 of the disk)."
   ]
  },
  "0B87": {
   "unit": "boot/c128BootSector",
   "block": [
    "driveCmdInitialize: text, 2 bytes. \"I\",$00 - DOS initialise; sent by the C64-mode cartridge code ($8046: LDA #2 / JSR $0B55), not by the C128-mode code."
   ]
  },
  "0B89": {
   "unit": "boot/c128BootSector",
   "block": [
    "c64CartImage: unknown, 107 bytes. Bytes $89-$F3 of the sector = the CBM80 pseudo-cartridge ($8000-$806A after the copy): vectors $8009/$8009, \"CBM80\", then the C64-mode start-up code that IOINITs, clears low RAM, sets MEMTOP, opens the command channel via $0B45, sends \"I\" via $0B55, SETNAM \"0:EA\", LOADs it and JMPs to $02B8. Disassembled in boot/c64cart_8000.s; do not annotate as code here."
   ]
  },
  "0BF4": {
   "unit": "boot/c128BootSector",
   "block": [
    "sectorTailFiller: unknown, 12 bytes. $00 then 8E 72 17 8E 73 17 8E 70 17 8E 71 (fragments of STX $1772/$1773/$1770/$1771): unused tail of the sector, leftover from the mastering buffer; lands at $806B-$8076 and is never referenced."
   ]
  }
 }
}