Wiki

Clone wiki

Super-Mon / NakedOS_listing

NakedOS code listing as of 2010-09-20. "Source code" in the normal sense has never existed for NakedOS as it was written using Super-Mon. There's just the assembly code itself plus the labels.

**** The stub used to access NakedOS ***

                NKSTUB:
0340-   2C 40 0E    BIT  NKENT1
0343-   AC EE 03    LDY  SLOTNUM
0346-   B9 8E C0    LDA  $C08E,Y
0349-   B9 8C C0    LDA  $C08C,Y
034C-   B9 89 C0    LDA  $C089,Y
034F-   A2 00       LDX  #00
0351-   B5 00       LDA  $00,X
0353-   9D 00 0B    STA  $0B00,X
0356-   BD 00 C6    LDA  $C600,X
0359-   C0 00       CPY  #00
035B-   F0 04       BEQ  $0361
035D-   C0 D6       CPY  #D6
035F-   D0 06       BNE  $0367
0361-   C9 04       CMP  #04
0363-   B0 02       BCS  $0367
0365-   69 06       ADC  #06
0367-   9D 00 0A    STA  $0A00,X
036A-   A8          TAY  
036B-   E8          INX  
036C-   D0 E3       BNE  $0351
036E-   A0 00       LDY  #00
0370-   A2 96       LDX  #96
0372-   8A          TXA  
0373-   0A          ASL  
0374-   85 3C       STA  SRCBEG
0376-   8A          TXA  
0377-   05 3C       ORA  SRCBEG
0379-   49 FF       EOR  #FF
037B-   4A          LSR  
037C-   F0 05       BEQ  $0383
037E-   0A          ASL  
037F-   90 FD       BCC  *-1
0381-   D0 0B       BNE  $038E
0383-   8A          TXA  
0384-   25 3C       AND  SRCBEG
0386-   0A          ASL  
0387-   F0 05       BEQ  $038E
0389-   98          TYA  
038A-   9D D6 08    STA  $08D6,X
038D-   C8          INY  
038E-   E8          INX  
038F-   D0 E1       BNE  $0372
0391-   AE EE 03    LDX  SLOTNUM
0394-   86 2B       STX  BOOTSLOT
0396-   AD EC 03    LDA  ERRVEC+1
0399-   F0 18       BEQ  $03B3
039B-   A0 50       LDY  #50
039D-   BD 80 C0    LDA  $C080,X
03A0-   CA          DEX  
03A1-   CA          DEX  
03A2-   8A          TXA  
03A3-   29 07       AND  #07
03A5-   05 2B       ORA  BOOTSLOT
03A7-   AA          TAX  
03A8-   BD 81 C0    LDA  $C081,X
03AB-   A9 38       LDA  #38
03AD-   20 A8 FC    JSR  WAIT
03B0-   88          DEY  
03B1-   D0 EA       BNE  $039D
03B3-   8D EC 03    STA  ERRVEC+1
03B6-   85 41       STA  DSTBEG-1
03B8-   85 26       STA  NKRETADR
03BA-   A0 02       LDY  #02
03BC-   84 3D       STY  SECTOR
03BE-   98          TYA  
03BF-   18          CLC  
03C0-   69 0C       ADC  #0C
03C2-   85 27       STA  NKRETADR+1
03C4-   C8          INY  
03C5-   8C 00 08    STY  NIBBUF
03C8-   A9 60       LDA  #60
03CA-   8D 01 08    STA  NIBBUF+1
03CD-   A6 2B       LDX  BOOTSLOT
03CF-   20 5C 0A    JSR  $0A5C
03D2-   A4 3D       LDY  SECTOR
03D4-   C8          INY  
03D5-   C0 0C       CPY  #0C
03D7-   D0 02       BNE  $03DB
03D9-   A0 01       LDY  #01
03DB-   C0 0D       CPY  #0D
03DD-   D0 DD       BNE  $03BC
03DF-   4C 00 0D    JMP  RDTRANSZ
03E2-   00          BRK  
03E3-   00          BRK  
03E4-   00          BRK  
03E5-   00          BRK  
03E6-   00          BRK  
03E7-   00          BRK  
03E8-   00          BRK  
03E9-   00          BRK  
03EA-   00          BRK  
                ERRVEC:
03EB-   00          BRK  
03EC-   00          BRK  
03ED-   00          BRK  
                SLOTNUM:
03EE-   60          RTS  
                CURTRK:
03EF-   00          BRK  

**** Write translation table ****

0E00- 96 97 9A 9B 9D 9E 9F A6  .......&
0E08- A7 AB AC AD AE AF B2 B3  '+,-./23
0E10- B4 B5 B6 B7 B9 BA BB BC  45679:;<
0E18- BD BE BF CB CD CE CF D3  =>?KMNOS
0E20- D6 D7 D9 DA DB DC DD DE  VWYZ[\]^
0E28- DF E5 E6 E7 E9 EA EB EC  _efgijkl
0E30- ED EE EF F2 F3 F4 F5 F6  mnorstuv
0E38- F7 F9 FA FB FC FD FE FF  wyz{|}~

**** Main NakedOS code ****

                NKENT1:
0E40-   4C B2 12    JMP  NKENT2
                WRSYNCS:
0E43-   A2 05       LDX  #05
0E45-   A9 FF       LDA  #FF
0E47-   8D EF C0    STA  MODEWRIT
0E4A-   2C EC C0    BIT  LATCH
0E4D-   20 58 FF    JSR  MONRTS
0E50-   24 07       BIT  MVSRC+1
0E52-   20 21 0F    JSR  WRBYT18
0E55-   24 07       BIT  MVSRC+1
0E57-   CA          DEX  
0E58-   D0 F8       BNE  $0E52
                WRPROLOG:
0E5A-   A6 2D       LDX  CURSEC
0E5C-   BD 60 0D    LDA  SECPAGES,X
0E5F-   8D CE 0E    STA  WRMAIN+2
0E62-   8D EA 0E    STA  $0EEA
0E65-   A8          TAY  
0E66-   A9 D5       LDA  #D5
0E68-   8D ED C0    STA  WRLATCH
0E6B-   2C EC C0    BIT  LATCH
0E6E-   8C FC 0E    STY  WRCHKSUM+2
0E71-   88          DEY  
0E72-   8C E7 0E    STY  WMAINLUP+2
0E75-   BD 90 0D    LDA  NIBADRL,X
0E78-   8D A4 0E    STA  WNIBLUP+1
0E7B-   8D AA 0E    STA  $0EAA
0E7E-   A9 AA       LDA  #AA
0E80-   8D ED C0    STA  WRLATCH
0E83-   2C EC C0    BIT  LATCH
0E86-   BD A0 0D    LDA  NIBADRH,X
0E89-   8D A5 0E    STA  WNIBLUP+2
0E8C-   8D AB 0E    STA  $0EAB
0E8F-   A9 55       LDA  #55
0E91-   85 2F       STA  NIBCOUNT
0E93-   A9 AD       LDA  #AD
0E95-   24 07       BIT  MVSRC+1
0E97-   EA          NOP  
0E98-   8D ED C0    STA  WRLATCH
0E9B-   2C EC C0    BIT  LATCH
0E9E-   EA          NOP  
0E9F-   EA          NOP  
                WRNIBS:
0EA0-   A0 00       LDY  #00
0EA2-   98          TYA  
                WNIBLUP:
0EA3-   59 00 0C    EOR  RDBF56Z,Y
0EA6-   8D AD 0E    STA  $0EAD
0EA9-   B9 00 0C    LDA  RDBF56Z,Y
0EAC-   AE 00 0E    LDX  WRTBL
0EAF-   8E ED C0    STX  WRLATCH
0EB2-   2C EC C0    BIT  LATCH
0EB5-   C8          INY  
0EB6-   C4 2F       CPY  NIBCOUNT
0EB8-   D0 E9       BNE  WNIBLUP
0EBA-   A6 2D       LDX  CURSEC
0EBC-   5D B0 0D    EOR  LASTNIBS,X
0EBF-   8D C4 0E    STA  $0EC4
0EC2-   EA          NOP  
0EC3-   AD 00 0E    LDA  WRTBL
0EC6-   8D ED C0    STA  WRLATCH
0EC9-   2C EC C0    BIT  LATCH
                WRMAIN:
0ECC-   AD 00 8C    LDA  $8C00
0ECF-   4A          LSR  
0ED0-   4A          LSR  
0ED1-   5D B0 0D    EOR  LASTNIBS,X
0ED4-   AA          TAX  
0ED5-   BD 00 0E    LDA  WRTBL,X
0ED8-   EA          NOP  
0ED9-   EA          NOP  
0EDA-   EA          NOP  
0EDB-   8D ED C0    STA  WRLATCH
0EDE-   2C EC C0    BIT  LATCH
0EE1-   24 07       BIT  MVSRC+1
0EE3-   A0 01       LDY  #01
                WMAINLUP:
0EE5-   B9 FF 8B    LDA  $8BFF,Y
0EE8-   59 00 8C    EOR  $8C00,Y
0EEB-   4A          LSR  
0EEC-   4A          LSR  
0EED-   AA          TAX  
0EEE-   BD 00 0E    LDA  WRTBL,X
0EF1-   8D ED C0    STA  WRLATCH
0EF4-   2C EC C0    BIT  LATCH
0EF7-   C8          INY  
0EF8-   D0 EB       BNE  WMAINLUP
                WRCHKSUM:
0EFA-   AD FF 8C    LDA  $8CFF
0EFD-   4A          LSR  
0EFE-   4A          LSR  
0EFF-   AA          TAX  
0F00-   BD 00 0E    LDA  WRTBL,X
0F03-   20 26 0F    JSR  WRBYT6
                WREPILOG:
0F06-   A9 DE       LDA  #DE
0F08-   20 22 0F    JSR  WRBYT16
0F0B-   A9 AA       LDA  #AA
0F0D-   20 22 0F    JSR  WRBYT16
0F10-   A9 EB       LDA  #EB
0F12-   20 22 0F    JSR  WRBYT16
0F15-   20 58 FF    JSR  MONRTS
0F18-   20 58 FF    JSR  MONRTS
0F1B-   EA          NOP  
0F1C-   2C EE C0    BIT  MODEREAD
0F1F-   18          CLC  
0F20-   60          RTS  
                WRBYT18:
0F21-   EA          NOP  
                WRBYT16:
0F22-   24 07       BIT  MVSRC+1
                WRBYT13:
0F24-   48          PHA  
0F25-   68          PLA  
                WRBYT6:
0F26-   8D ED C0    STA  WRLATCH
0F29-   2C EC C0    BIT  LATCH
0F2C-   60          RTS  
                WRSECTOR:
0F2D-    AD ED C0    LDA  WRLATCH
0F30-   AD EE C0    LDA  MODEREAD
0F33-   10 02       BPL  $0F37
0F35-   38          SEC  
0F36-   60          RTS  
0F37-   4C 43 0E    JMP  WRSYNCS
                PRENIB:
0F3A-   8D 5F 0F    STA  PNIB1-1
0F3D-   8D 64 0F    STA  $0F64
0F40-   8D 69 0F    STA  $0F69
0F43-   8D 6E 0F    STA  $0F6E
0F46-   8D 73 0F    STA  $0F73
0F49-   8D 89 0F    STA  $0F89
0F4C-   8D 94 0F    STA  $0F94
0F4F-   AD 7B 0F    LDA  NIBSTORE+1
0F52-   9D 90 0D    STA  NIBADRL,X
0F55-   AD 7C 0F    LDA  NIBSTORE+2
0F58-   9D A0 0D    STA  NIBADRH,X
0F5B-   A0 53       LDY  #53
                PNIBLUP:
0F5D-   B9 AC 8F    LDA  $8FAC,Y
                PNIB1:
0F60-   0A          ASL  
0F61-   0A          ASL  
0F62-   59 56 8F    EOR  $8F56,Y
0F65-   29 FC       AND  #FC
0F67-   59 56 8F    EOR  $8F56,Y
0F6A-   0A          ASL  
0F6B-   0A          ASL  
0F6C-   59 00 8F    EOR  $8F00,Y
0F6F-   29 FC       AND  #FC
0F71-   59 00 8F    EOR  $8F00,Y
0F74-   29 3F       AND  #3F
0F76-   AA          TAX  
0F77-   BD C0 0D    LDA  FLIPTBL,X
                NIBSTORE:
0F7A-   99 55 0D    STA  $0D55,Y
0F7D-   88          DEY  
0F7E-   10 DD       BPL  PNIBLUP
0F80-   A0 55       LDY  #55
0F82-   A9 60       LDA  #60
0F84-   8D 7E 0F    STA  $0F7E
0F87-   AD 01 8F    LDA  $8F01
0F8A-   20 60 0F    JSR  PNIB1
0F8D-   A6 2D       LDX  CURSEC
0F8F-   9D B0 0D    STA  LASTNIBS,X
0F92-   AD 00 8F    LDA  $8F00
0F95-   20 60 0F    JSR  PNIB1
0F98-   A9 10       LDA  #10
0F9A-   8D 7E 0F    STA  $0F7E
0F9D-   60          RTS  
                PRENIBALL:
0F9E-   2C 00 08    BIT  NIBBUF
0FA1-   AD 9F 0F    LDA  PRENIBALL+1
0FA4-   8D 7B 0F    STA  NIBSTORE+1
0FA7-   AD A0 0F    LDA  PRENIBALL+2
0FAA-   8D 7C 0F    STA  NIBSTORE+2
0FAD-   A2 00       LDX  #00
0FAF-   BD 60 0D    LDA  SECPAGES,X
0FB2-   F0 19       BEQ  $0FCD
0FB4-   86 2D       STX  CURSEC
0FB6-   20 3A 0F    JSR  PRENIB
0FB9-   AD 7B 0F    LDA  NIBSTORE+1
0FBC-   18          CLC  
0FBD-   69 55       ADC  #55
0FBF-   C9 FF       CMP  #FF
0FC1-   D0 05       BNE  $0FC8
0FC3-   A9 00       LDA  #00
0FC5-   EE 7C 0F    INC  NIBSTORE+2
0FC8-   8D 7B 0F    STA  NIBSTORE+1
0FCB-   A6 2D       LDX  CURSEC
0FCD-   E8          INX  
0FCE-   E0 10       CPX  #10
0FD0-   D0 DD       BNE  $0FAF
0FD2-   60          RTS  
                BLDFLIP:
0FD3-   A0 3F       LDY  #3F
0FD5-   A2 03       LDX  #03
0FD7-   98          TYA  
0FD8-   4A          LSR  
0FD9-   08          PHP  
0FDA-   4A          LSR  
0FDB-   08          PHP  
0FDC-   0A          ASL  
0FDD-   0A          ASL  
0FDE-   28          PLP  
0FDF-   6A          ROR  
0FE0-   28          PLP  
0FE1-   6A          ROR  
0FE2-   CA          DEX  
0FE3-   D0 F3       BNE  $0FD8
0FE5-   4A          LSR  
0FE6-   4A          LSR  
0FE7-   99 C0 0D    STA  FLIPTBL,Y
0FEA-   88          DEY  
0FEB-   10 E8       BPL  BLDFLIP+2
0FED-   60          RTS  
                READADR:
0FEE-   A0 FF       LDY  #FF
0FF0-   8C C7 15    STY  ADRRETRY
0FF3-   AD EC C0    LDA  LATCH
0FF6-   10 FB       BPL  $0FF3
0FF8-   C9 D5       CMP  #D5
0FFA-   F0 0A       BEQ  $1006
0FFC-   88          DEY  
0FFD-   D0 F4       BNE  $0FF3
0FFF-   CE C7 15    DEC  ADRRETRY
1002-   D0 EF       BNE  $0FF3
1004-   38          SEC  
1005-   60          RTS  
1006-   AD EC C0    LDA  LATCH
1009-   10 FB       BPL  $1006
100B-   C9 AA       CMP  #AA
100D-   D0 E9       BNE  $0FF8
100F-   AD EC C0    LDA  LATCH
1012-   10 FB       BPL  $100F
1014-   C9 96       CMP  #96
1016-   D0 E0       BNE  $0FF8
1018-   A2 00       LDX  #00
101A-   8A          TXA  
101B-   85 2E       STA  CHKSUM
101D-   AD EC C0    LDA  LATCH
1020-   10 FB       BPL  $101D
1022-   38          SEC  
1023-   2A          ROL  
1024-   9D C9 15    STA  GOTVOL,X
1027-   AD EC C0    LDA  LATCH
102A-   10 FB       BPL  $1027
102C-   3D C9 15    AND  GOTVOL,X
102F-   9D C9 15    STA  GOTVOL,X
1032-   45 2E       EOR  CHKSUM
1034-   E8          INX  
1035-   E0 04       CPX  #04
1037-   D0 E2       BNE  $101B
1039-   C9 00       CMP  #00
103B-   D0 C2       BNE  $0FFF
103D-   AD EC C0    LDA  LATCH
1040-   10 FB       BPL  $103D
1042-   C9 DE       CMP  #DE
1044-   D0 B9       BNE  $0FFF
1046-   AD EC C0    LDA  LATCH
1049-   10 FB       BPL  $1046
104B-   C9 AA       CMP  #AA
104D-   D0 B0       BNE  $0FFF
104F-   18          CLC  
1050-   60          RTS  
                READSEC:
1051-   A6 2D       LDX  CURSEC
1053-   BD 60 0D    LDA  SECPAGES,X
1056-   8D DB 10    STA  $10DB
1059-   AA          TAX  
105A-   CA          DEX  
105B-   8E C3 10    STX  $10C3
105E-   8E AB 10    STX  $10AB
1061-   A0 FF       LDY  #FF
                RDPROLOG:
1063-   AD EC C0    LDA  LATCH
1066-   10 FB       BPL  RDPROLOG
1068-   C9 D5       CMP  #D5
106A-   F0 05       BEQ  $1071
106C-   88          DEY  
106D-   D0 F4       BNE  RDPROLOG
106F-   38          SEC  
1070-   60          RTS  
1071-   AD EC C0    LDA  LATCH
1074-   10 FB       BPL  $1071
1076-   C9 AA       CMP  #AA
1078-   D0 EE       BNE  $1068
107A-   AD EC C0    LDA  LATCH
107D-   10 FB       BPL  $107A
107F-   C9 AD       CMP  #AD
1081-   D0 E5       BNE  $1068
1083-   A9 00       LDA  #00
1085-   A0 AA       LDY  #AA
                RD56:
1087-   AE EC C0    LDX  LATCH
108A-   10 FB       BPL  RD56
108C-   5D 00 0D    EOR  RDTRANSZ,X
108F-   4A          LSR  
1090-   4A          LSR  
1091-   99 00 0C    STA  RDBF56Z,Y
1094-   0A          ASL  
1095-   0A          ASL  
1096-   C8          INY  
1097-   D0 EE       BNE  RD56
1099-   A0 AA       LDY  #AA
                RDPART1:
109B-   AE EC C0    LDX  LATCH
109E-   10 FB       BPL  RDPART1
10A0-   5D 00 0D    EOR  RDTRANSZ,X
10A3-   BE 00 0C    LDX  RDBF56Z,Y
10A6-   1D 20 0C    ORA  RDP1TBL,X
10A9-   99 56 B3    STA  $B356,Y
10AC-   29 FC       AND  #FC
10AE-   C8          INY  
10AF-   D0 EA       BNE  RDPART1
10B1-   A0 AA       LDY  #AA
                RDPART2:
10B3-   AE EC C0    LDX  LATCH
10B6-   10 FB       BPL  RDPART2
10B8-   5D 00 0D    EOR  RDTRANSZ,X
10BB-   BE 00 0C    LDX  RDBF56Z,Y
10BE-   1D 60 0C    ORA  RDP2TBL,X
10C1-   99 AC B3    STA  $B3AC,Y
10C4-   29 FC       AND  #FC
10C6-   C8          INY  
10C7-   D0 EA       BNE  RDPART2
10C9-   A0 AC       LDY  #AC
                RDPART3:
10CB-   AE EC C0    LDX  LATCH
10CE-   10 FB       BPL  RDPART3
10D0-   5D 00 0D    EOR  RDTRANSZ,X
10D3-   BE FE 0B    LDX  RDBF56Y,Y
10D6-   1D 20 0D    ORA  RDP3TBL,X
10D9-   99 00 B4    STA  $B400,Y
10DC-   29 FC       AND  #FC
10DE-   C8          INY  
10DF-   D0 EA       BNE  RDPART3
                RDCHKSUM:
10E1-   AE EC C0    LDX  LATCH
10E4-   10 FB       BPL  RDCHKSUM
10E6-   5D 00 0D    EOR  RDTRANSZ,X
10E9-   F0 02       BEQ  RDEPILOG
10EB-   38          SEC  
10EC-   60          RTS  
                RDEPILOG:
10ED-   AD EC C0    LDA  LATCH
10F0-   10 FB       BPL  RDEPILOG
10F2-   C9 DE       CMP  #DE
10F4-   D0 F5       BNE  RDEPILOG-2
10F6-   AD EC C0    LDA  LATCH
10F9-   10 FB       BPL  $10F6
10FB-   C9 AA       CMP  #AA
10FD-   D0 EC       BNE  RDEPILOG-2
10FF-   18          CLC  
1100-   60          RTS  
                DEFERRHND:
1101-   20 DA FD    JSR  PRBYTE
1104-   A9 AE       LDA  #AE
1106-   20 ED FD    JSR  COUT
1109-   20 2D FF    JSR  PRERR
110C-   A9 FF       LDA  #FF
110E-   48          PHA  
110F-   A9 68       LDA  #68
1111-   48          PHA  
1112-   4C FF 14    JMP  EXITCLR2
                BLDRDTBL:
1115-   A0 3F       LDY  #3F
1117-   BE 00 0E    LDX  WRTBL,Y
111A-   98          TYA  
111B-   0A          ASL  
111C-   0A          ASL  
111D-   9D 00 0D    STA  RDTRANSZ,X
1120-   88          DEY  
1121-   10 F4       BPL  BLDRDTBL+2
1123-   A0 3F       LDY  #3F
1125-   84 2E       STY  CHKSUM
1127-   20 3D 11    JSR  $113D
112A-   99 20 0C    STA  RDP1TBL,Y
112D-   20 3D 11    JSR  $113D
1130-   99 60 0C    STA  RDP2TBL,Y
1133-   20 3D 11    JSR  $113D
1136-   99 20 0D    STA  RDP3TBL,Y
1139-   88          DEY  
113A-   10 E9       BPL  $1125
113C-   60          RTS  
113D-   A9 00       LDA  #00
113F-   46 2E       LSR  CHKSUM
1141-   2A          ROL  
1142-   46 2E       LSR  CHKSUM
1144-   2A          ROL  
1145-   60          RTS  
                SEEK:
1146-   48          PHA  
1147-   38          SEC  
1148-   ED EF 03    SBC  CURTRK
114B-   F0 56       BEQ  $11A3
114D-   A0 02       LDY  #02
114F-   B0 07       BCS  $1158
1151-   49 FF       EOR  #FF
1153-   18          CLC  
1154-   69 01       ADC  #01
1156-   A0 FE       LDY  #FE
1158-   8C 78 11    STY  STEPDIR+1
115B-   8D 93 11    STA  STEPHALF+1
115E-   0A          ASL  
115F-   AA          TAX  
1160-   A9 02       LDA  #02
1162-   8D 83 11    STA  STPACCEL+1
1165-   A9 3E       LDA  #3E
1167-   8D 80 11    STA  STEPWAIT+1
116A-   AD EF 03    LDA  CURTRK
116D-   0A          ASL  
116E-   0A          ASL  
116F-   29 07       AND  #07
1171-   A8          TAY  
1172-   D9 E0 C0    CMP  PHASEOFF,Y
1175-   98          TYA  
1176-   18          CLC  
                STEPDIR:
1177-   69 FE       ADC  #FE
1179-   29 07       AND  #07
117B-   A8          TAY  
117C-   D9 E1 C0    CMP  PHASEON,Y
                STEPWAIT:
117F-   A9 3A       LDA  #3A
1181-   38          SEC  
                STPACCEL:
1182-   E9 FE       SBC  #FE
1184-   8D 80 11    STA  STEPWAIT+1
1187-   30 04       BMI  $118D
1189-   C9 30       CMP  #30
118B-   B0 02       BCS  $118F
118D-   A9 30       LDA  #30
118F-   20 A8 FC    JSR  WAIT
                STEPHALF:
1192-   E0 0A       CPX  #0A
1194-   D0 0A       BNE  $11A0
1196-   AD 83 11    LDA  STPACCEL+1
1199-   49 FF       EOR  #FF
119B-   69 00       ADC  #00
119D-   8D 83 11    STA  STPACCEL+1
11A0-   CA          DEX  
11A1-   D0 CF       BNE  $1172
11A3-   68          PLA  
11A4-   8D EF 03    STA  CURTRK
11A7-   60          RTS  
                RWTRK:
11A8-   AD 72 0D    LDA  NTRKSECS
11AB-   F0 6D       BEQ  $121A
11AD-   AD C5 15    LDA  RWMODE
11B0-   C9 02       CMP  #02
11B2-   D0 03       BNE  $11B7
11B4-   20 9E 0F    JSR  PRENIBALL
11B7-   A9 02       LDA  #02
11B9-   8D 71 0D    STA  NRESEEKS
11BC-   8D 70 0D    STA  NRECALS
11BF-   78          SEI  
                RESEEK:
11C0-   A9 40       LDA  #40
11C2-   8D 73 0D    STA  NSECSKP
11C5-   AD C0 15    LDA  TARGTRK
11C8-   20 46 11    JSR  SEEK
                FINDSEC:
11CB-   20 EE 0F    JSR  READADR
11CE-   B0 10       BCS  RECAL
11D0-   AD CA 15    LDA  GOTTRK
11D3-   CD C0 15    CMP  TARGTRK
11D6-   F0 19       BEQ  $11F1
11D8-   8D EF 03    STA  CURTRK
11DB-   CE 71 0D    DEC  NRESEEKS
11DE-   10 E5       BPL  $11C5
                RECAL:
11E0-   A9 28       LDA  #28
11E2-   8D EF 03    STA  CURTRK
11E5-   A9 00       LDA  #00
11E7-   20 46 11    JSR  SEEK
11EA-   CE 70 0D    DEC  NRECALS
11ED-   10 D1       BPL  RESEEK
11EF-   30 33       BMI  IOERR
11F1-   AE CB 15    LDX  GOTSEC
11F4-   BD 60 0D    LDA  SECPAGES,X
11F7-   D0 07       BNE  $1200
                SKIPSEC:
11F9-   CE 73 0D    DEC  NSECSKP
11FC-   10 CD       BPL  FINDSEC
11FE-   30 E0       BMI  RECAL
1200-   86 2D       STX  CURSEC
1202-   AD C5 15    LDA  RWMODE
1205-   C9 02       CMP  #02
1207-   F0 16       BEQ  $121F
1209-   20 51 10    JSR  READSEC
120C-   B0 EB       BCS  SKIPSEC
120E-   A6 2D       LDX  CURSEC
1210-   A9 00       LDA  #00
1212-   9D 60 0D    STA  SECPAGES,X
1215-   CE 72 0D    DEC  NTRKSECS
1218-   D0 B1       BNE  FINDSEC
121A-   EE C0 15    INC  TARGTRK
121D-   58          CLI  
121E-   60          RTS  
121F-   20 2D 0F    JSR  WRSECTOR
1222-   90 EA       BCC  $120E
                IOERR:
1224-   A9 83       LDA  #83
                NKERR:
1226-   58          CLI  
1227-   2C EE C0    BIT  MODEREAD
122A-   2C E8 C0    BIT  MOTOROFF
122D-   AE CF 15    LDX  ENTSTACK
1230-   9A          TXS  
1231-   4C EB 03    JMP  ERRVEC
                NKGETBYT:
1234-   A0 01       LDY  #01
1236-   B1 26       LDA  (NKRETADR),Y
1238-   E6 26       INC  NKRETADR
123A-   D0 02       BNE  NKGETVAL-1
123C-   E6 27       INC  NKRETADR+1
123E-   60          RTS  
                NKGETVAL:
123F-   20 34 12    JSR  NKGETBYT
1242-   AA          TAX  
1243-   20 34 12    JSR  NKGETBYT
1246-   E0 A9       CPX  #A9
1248-   F0 0D       BEQ  $1257
124A-   E0 2C       CPX  #2C
124C-   D0 0A       BNE  $1258
124E-   AA          TAX  
124F-   20 34 12    JSR  NKGETBYT
1252-   E0 00       CPX  #00
1254-   F0 01       BEQ  $1257
1256-   8A          TXA  
1257-   60          RTS  
1258-   8D 6C 12    STA  LDUSRBYTE+1
125B-   A9 00       LDA  #00
125D-   E0 A5       CPX  #A5
125F-   F0 07       BEQ  $1268
1261-   E0 AD       CPX  #AD
1263-   D0 0A       BNE  $126F
1265-   20 34 12    JSR  NKGETBYT
1268-   8D 6D 12    STA  LDUSRBYTE+2
                LDUSRBYTE:
126B-   AD 00 40    LDA  $4000
126E-   60          RTS  
126F-   4C EE 12    JMP  NKCMDERR
                GETADRLEN:
1272-   20 3F 12    JSR  NKGETVAL
1275-   8D C2 15    STA  TARGADR
1278-   20 3F 12    JSR  NKGETVAL
                CHKADRLEN:
127B-   8D C3 15    STA  TARGLEN
127E-   8D CE 15    STA  NFILESECS
1281-   18          CLC  
1282-   6D C2 15    ADC  TARGADR
1285-   90 0A       BCC  $1291
                PARMERR:
1287-   AD C4 15    LDA  INTRNFLG
128A-   D0 16       BNE  GETFILNUM-1
128C-   A9 82       LDA  #82
128E-   4C 26 12    JMP  NKERR
1291-   AE C2 15    LDX  TARGADR
1294-   F0 F1       BEQ  PARMERR
1296-   E0 18       CPX  #18
1298-   90 ED       BCC  PARMERR
129A-   E0 D0       CPX  #D0
129C-   B0 04       BCS  GETFILNUM-1
129E-   C9 C1       CMP  #C1
12A0-   B0 E5       BCS  PARMERR
12A2-   60          RTS  
                GETFILNUM:
12A3-   20 3F 12    JSR  NKGETVAL
12A6-   C9 FE       CMP  #FE
12A8-   B0 DD       BCS  PARMERR
12AA-   C9 00       CMP  #00
12AC-   F0 D9       BEQ  PARMERR
12AE-   8D CD 15    STA  FILENUM
12B1-   60          RTS  
                NKENT2:
12B2-   68          PLA  
12B3-   85 26       STA  NKRETADR
12B5-   68          PLA  
12B6-   85 27       STA  NKRETADR+1
12B8-   BA          TSX  
12B9-   8E CF 15    STX  ENTSTACK
12BC-   A9 2C       LDA  #2C
12BE-   8D 40 03    STA  NKSTUB
                NKCMDLUP:
12C1-   20 34 12    JSR  NKGETBYT
12C4-   C9 D8       CMP  #D8
12C6-   D0 10       BNE  $12D8
                NKDONE:
12C8-   A9 00       LDA  #00
12CA-   20 46 11    JSR  SEEK
12CD-   2C E8 C0    BIT  MOTOROFF
12D0-   AD C4 15    LDA  INTRNFLG
12D3-   D0 0C       BNE  NKEXITOK
12D5-   4C F9 14    JMP  NKEXITCLR
12D8-   C9 F8       CMP  #F8
12DA-   D0 0E       BNE  $12EA
12DC-   A9 4C       LDA  #4C
12DE-   8D 40 03    STA  NKSTUB
                NKEXITOK:
12E1-   20 34 12    JSR  NKGETBYT
12E4-   AD C8 15    LDA  NKRETVAL
12E7-   6C 26 00    JMP  (NKRETADR)
12EA-   C9 6D       CMP  #6D
12EC-   F0 05       BEQ  $12F3
                NKCMDERR:
12EE-   A9 81       LDA  #81
12F0-   4C 26 12    JMP  NKERR
12F3-   20 34 12    JSR  NKGETBYT
12F6-   48          PHA  
12F7-   20 34 12    JSR  NKGETBYT
12FA-   C9 DC       CMP  #DC
12FC-   D0 F0       BNE  NKCMDERR
12FE-   68          PLA  
                RWTSCMD:
12FF-   C9 41       CMP  #41
1301-   F0 04       BEQ  $1307
1303-   C9 42       CMP  #42
1305-   D0 1A       BNE  INITCMD
1307-   29 03       AND  #03
1309-   20 E2 13    JSR  SETRDWR
130C-   20 3F 12    JSR  NKGETVAL
130F-   8D C0 15    STA  TARGTRK
1312-   20 3F 12    JSR  NKGETVAL
1315-   8D C1 15    STA  TARGSEC
1318-   20 72 12    JSR  GETADRLEN
131B-   20 B7 13    JSR  RWTS
131E-   4C C1 12    JMP  NKCMDLUP
                INITCMD:
1321-   C9 0F       CMP  #0F
1323-   D0 09       BNE  FILECMD
1325-   20 9A 14    JSR  INITCAT
                SAVENGO:
1328-   20 89 13    JSR  SAVECAT
132B-   4C C1 12    JMP  NKCMDLUP
                FILECMD:
132E-   48          PHA  
132F-   20 A3 12    JSR  GETFILNUM
1332-   20 86 14    JSR  COUNTFLEN
1335-   68          PLA  
1336-   A8          TAY  
1337-   8A          TXA  
1338-   48          PHA  
                WRFILECMD:
1339-   C0 02       CPY  #02
133B-   D0 17       BNE  INFOCMD
133D-   20 72 12    JSR  GETADRLEN
1340-   68          PLA  
1341-   CD CE 15    CMP  NFILESECS
1344-   F0 06       BEQ  RWFILECMD-2
1346-   20 46 14    JSR  ALLOCSECS
1349-   20 89 13    JSR  SAVECAT
134C-   A9 02       LDA  #02
                RWFILECMD:
134E-   20 CD 14    JSR  RWFILE
1351-   4C C1 12    JMP  NKCMDLUP
                INFOCMD:
1354-   C0 08       CPY  #08
1356-   D0 07       BNE  EXISTFIL
1358-   68          PLA  
1359-   8D C8 15    STA  NKRETVAL
135C-   4C C1 12    JMP  NKCMDLUP
                EXISTFIL:
135F-   E0 00       CPX  #00
1361-   D0 05       BNE  RDFILECMD
                NOTFNDERR:
1363-   A9 84       LDA  #84
1365-   4C 26 12    JMP  NKERR
                RDFILECMD:
1368-   C0 01       CPY  #01
136A-   D0 0F       BNE  DELFILCMD
136C-   20 3F 12    JSR  NKGETVAL
136F-   8D C2 15    STA  TARGADR
1372-   68          PLA  
1373-   20 7B 12    JSR  CHKADRLEN
1376-   A9 01       LDA  #01
1378-   4C 4E 13    JMP  RWFILECMD
                DELFILCMD:
137B-   C0 03       CPY  #03
137D-   D0 07       BNE  $1386
137F-   68          PLA  
1380-   20 B9 14    JSR  NKDELETE
1383-   4C 28 13    JMP  SAVENGO
1386-   4C EE 12    JMP  NKCMDERR
                SAVECAT:
1389-   AD C3 15    LDA  TARGLEN
138C-   48          PHA  
138D-   AD C2 15    LDA  TARGADR
1390-   48          PHA  
1391-   AD 2D 15    LDA  CATSTADR+2
1394-   A2 09       LDX  #09
1396-   A0 03       LDY  #03
1398-   8D C2 15    STA  TARGADR
139B-   8E C1 15    STX  TARGSEC
139E-   8C C3 15    STY  TARGLEN
13A1-   A9 00       LDA  #00
13A3-   8D C0 15    STA  TARGTRK
13A6-   A9 02       LDA  #02
13A8-   20 E2 13    JSR  SETRDWR
13AB-   20 B7 13    JSR  RWTS
13AE-   68          PLA  
13AF-   8D C2 15    STA  TARGADR
13B2-   68          PLA  
13B3-   8D C3 15    STA  TARGLEN
13B6-   60          RTS  
                RWTS:
13B7-   AE C1 15    LDX  TARGSEC
                RWTSLUP:
13BA-   AD C3 15    LDA  TARGLEN
13BD-   F0 0B       BEQ  $13CA
13BF-   20 D5 13    JSR  STSECADR
13C2-   CE C3 15    DEC  TARGLEN
13C5-   E8          INX  
13C6-   E0 10       CPX  #10
13C8-   D0 F0       BNE  RWTSLUP
13CA-   20 A8 11    JSR  RWTRK
13CD-   A2 00       LDX  #00
13CF-   AD C3 15    LDA  TARGLEN
13D2-   D0 E6       BNE  RWTSLUP
13D4-   60          RTS  
                STSECADR:
13D5-   AD C2 15    LDA  TARGADR
13D8-   9D 60 0D    STA  SECPAGES,X
13DB-   EE 72 0D    INC  NTRKSECS
13DE-   EE C2 15    INC  TARGADR
13E1-   60          RTS  
                SETRDWR:
13E2-   A8          TAY  
13E3-   A9 00       LDA  #00
13E5-   8D 72 0D    STA  NTRKSECS
13E8-   A2 0F       LDX  #0F
13EA-   9D 60 0D    STA  SECPAGES,X
13ED-   CA          DEX  
13EE-   10 FA       BPL  $13EA
13F0-   8C C5 15    STY  RWMODE
13F3-   CC C6 15    CPY  NKTBLFLG
13F6-   D0 01       BNE  $13F9
13F8-   60          RTS  
13F9-   8C C6 15    STY  NKTBLFLG
13FC-   C0 02       CPY  #02
13FE-   D0 03       BNE  $1403
1400-   4C D3 0F    JMP  BLDFLIP
1403-   4C 15 11    JMP  BLDRDTBL
                STCATSCAN:
1406-   AC 2D 15    LDY  CATSTADR+2
1409-   84 2B       STY  BOOTSLOT
140B-   A0 00       LDY  #00
140D-   84 2A       STY  PCATALOG
140F-   A0 D0       LDY  #D0
1411-   88          DEY  
1412-   60          RTS  
                NEXTCAT:
1413-   C8          INY  
1414-   D0 09       BNE  $141F
1416-   A5 2B       LDA  BOOTSLOT
1418-   CD 45 15    CMP  CATENDADR+2
141B-   F0 05       BEQ  $1422
141D-   E6 2B       INC  BOOTSLOT
141F-   B1 2A       LDA  (PCATALOG),Y
1421-   60          RTS  
1422-   88          DEY  
1423-   A9 00       LDA  #00
1425-   60          RTS  
                ALLOCSCAN:
1426-   20 06 14    JSR  STCATSCAN
1429-   AE CE 15    LDX  NFILESECS
142C-   20 13 14    JSR  NEXTCAT
142F-   F0 12       BEQ  $1443
1431-   49 FF       EOR  #FF
1433-   F0 0B       BEQ  $1440
1435-   49 FF       EOR  #FF
1437-   4D CD 15    EOR  FILENUM
143A-   F0 04       BEQ  $1440
143C-   B0 EB       BCS  $1429
143E-   90 EC       BCC  $142C
1440-   CA          DEX  
1441-   D0 E9       BNE  $142C
1443-   E0 00       CPX  #00
1445-   60          RTS  
                ALLOCSECS:
1446-   38          SEC  
1447-   20 26 14    JSR  ALLOCSCAN
144A-   D0 26       BNE  $1472
144C-   98          TYA  
144D-   38          SEC  
144E-   ED CE 15    SBC  NFILESECS
1451-   48          PHA  
1452-   A5 2B       LDA  BOOTSLOT
1454-   E9 00       SBC  #00
1456-   48          PHA  
1457-   20 B9 14    JSR  NKDELETE
145A-   68          PLA  
145B-   85 2B       STA  BOOTSLOT
145D-   68          PLA  
145E-   A8          TAY  
                DOALLOC:
145F-   AE CE 15    LDX  NFILESECS
1462-   20 13 14    JSR  NEXTCAT
1465-   C9 FF       CMP  #FF
1467-   D0 F9       BNE  $1462
1469-   AD CD 15    LDA  FILENUM
146C-   91 2A       STA  (PCATALOG),Y
146E-   CA          DEX  
146F-   D0 F1       BNE  $1462
1471-   60          RTS  
1472-   18          CLC  
1473-   20 26 14    JSR  ALLOCSCAN
1476-   D0 09       BNE  $1481
1478-   20 B9 14    JSR  NKDELETE
147B-   20 06 14    JSR  STCATSCAN
147E-   4C 5F 14    JMP  DOALLOC
1481-   A9 85       LDA  #85
1483-   4C 26 12    JMP  NKERR
                COUNTFLEN:
1486-   20 06 14    JSR  STCATSCAN
1489-   A2 00       LDX  #00
148B-   20 13 14    JSR  NEXTCAT
148E-   F0 08       BEQ  INITCAT-2
1490-   CD CD 15    CMP  FILENUM
1493-   D0 F6       BNE  $148B
1495-   E8          INX  
1496-   D0 F3       BNE  $148B
1498-   8A          TXA  
1499-   60          RTS  
                INITCAT:
149A-   20 06 14    JSR  STCATSCAN
149D-   A9 FE       LDA  #FE
149F-   A2 0C       LDX  #0C
14A1-   20 AE 14    JSR  $14AE
14A4-   A9 FF       LDA  #FF
14A6-   A2 24       LDX  #24
14A8-   20 AE 14    JSR  $14AE
14AB-   20 AE 14    JSR  $14AE
14AE-   48          PHA  
14AF-   20 13 14    JSR  NEXTCAT
14B2-   68          PLA  
14B3-   91 2A       STA  (PCATALOG),Y
14B5-   CA          DEX  
14B6-   D0 F6       BNE  $14AE
14B8-   60          RTS  
                NKDELETE:
14B9-   20 06 14    JSR  STCATSCAN
14BC-   20 13 14    JSR  NEXTCAT
14BF-   F0 0B       BEQ  RWFILE-1
14C1-   CD CD 15    CMP  FILENUM
14C4-   D0 F6       BNE  $14BC
14C6-   A9 FF       LDA  #FF
14C8-   91 2A       STA  (PCATALOG),Y
14CA-   D0 F0       BNE  $14BC
14CC-   60          RTS  
                RWFILE:
14CD-   20 E2 13    JSR  SETRDWR
14D0-   20 06 14    JSR  STCATSCAN
14D3-   A2 00       LDX  #00
14D5-   8E C0 15    STX  TARGTRK
                TRKLUP:
14D8-   20 13 14    JSR  NEXTCAT
14DB-   F0 18       BEQ  $14F5
14DD-   CD CD 15    CMP  FILENUM
14E0-   D0 03       BNE  $14E5
14E2-   20 D5 13    JSR  STSECADR
14E5-   E8          INX  
14E6-   E0 10       CPX  #10
14E8-   D0 EE       BNE  TRKLUP
14EA-   98          TYA  
14EB-   48          PHA  
14EC-   20 A8 11    JSR  RWTRK
14EF-   68          PLA  
14F0-   A8          TAY  
14F1-   A2 00       LDX  #00
14F3-   F0 E3       BEQ  TRKLUP
14F5-   4C A8 11    JMP  RWTRK
14F8-   00          BRK  
                NKEXITCLR:
14F9-   A5 27       LDA  NKRETADR+1
14FB-   48          PHA  
14FC-   A5 26       LDA  NKRETADR
14FE-   48          PHA  
                EXITCLR2:
14FF-    A2 05       LDX  #05
1501-   BD 3D 15    LDA  CLRLAST,X
1504-   95 2A       STA  PCATALOG,X
1506-   CA          DEX  
1507-   10 F8       BPL  EXITCLR2+2
1509-   AE A0 0F    LDX  PRENIBALL+2
150C-   EC 2D 15    CPX  CATSTADR+2
150F-   F0 12       BEQ  $1523
1511-   8E 1C 15    STX  $151C
1514-   8E 1F 15    STX  $151F
1517-   A0 00       LDY  #00
1519-   98          TYA  
151A-   99 00 40    STA  $4000,Y
151D-   99 80 40    STA  $4080,Y
1520-   C8          INY  
1521-   10 F7       BPL  $151A
1523-   EC 45 15    CPX  CATENDADR+2
1526-   F0 06       BEQ  $152E
1528-   E8          INX  
1529-   D0 E1       BNE  $150C
                CATSTADR:
152B-    2C D0 15    BIT  CATALOG
152E-   AE 2D 15    LDX  *-1
1531-   86 27       STX  NKRETADR+1
1533-   85 26       STA  NKRETADR
1535-   A8          TAY  
1536-   AE C8 15    LDX  NKRETVAL
1539-   18          CLC  
153A-   4C 2A 00    JMP  PCATALOG
                CLRLAST:
153D-   91 26       STA  (NKRETADR),Y
153F-   C8          INY  
1540-   D0 FB       BNE  CLRLAST
1542-   60          RTS  
                CATENDADR:
1543-   2C FF 17    BIT  SEC0SHDOW-1
1546-   00          BRK  
1547-   00          BRK  
1548-   00          BRK  
1549-   00          BRK  
154A-   00          BRK  
154B-   00          BRK  
154C-   00          BRK   
...

**** Catalog for fooling around with ****

15D0- FE FE FE FE FE FE FE FE  ~~~~~~~~
15D8- FE FE FE FE 01 01 02 02  ~~~~....
15E0- 02 02 02 02 02 02 02 02  ........
15E8- 02 02 02 02 02 02 02 02  ........
15F0- 02 02 02 03 03 03 03 03  ........
15F8- 03 03 03 03 03 03 03 03  ........
1600- 03 03 03 04 04 04 04 04  ........
1608- 04 04 04 04 04 04 04 04  ........
1610- 04 04 04 05 05 05 05 05  ........
1618- 05 05 05 05 05 05 05 05  ........
1620- 05 05 05 05 05 05 05 05  ........
1628- 05 05 05 05 05 05 05 05  ........
1630- 05 05 05 05 05 05 05 05  ........
1638- 05 05 05 05 05 05 05 05  ........
1640- 05 05 05 FF FF FF FF FF  ...
1648- FF FF FF FF FF FF FF FF  
1650- FF FF FF FF FF FF FF FF  
1658- FF FF FF FF FF FF FF FF  
1660- FF FF FF FF FF FF FF FF  
1668- FF FF FF FF FF FF FF FF  
1670- FF FF FF FF FF FF FF FF  
1678- FF FF FF FF FF FF FF FF  
1680- FF FF FF FF FF FF FF FF  
1688- FF FF FF FF FF FF FF FF  
1690- FF FF FF FF FF FF FF FF  
1698- FF FF FF FF FF FF FF FF  
16A0- FF FF FF FF FF FF FF FF  
16A8- FF FF FF FF FF FF FF FF  
16B0- FF FF FF FF FF FF FF FF  
16B8- FF FF FF FF FF FF FF FF  
16C0- FF FF FF FF FF FF FF FF  
16C8- FF FF FF FF FF FF FF FF  
16D0- FF FF FF FF FF FF FF FF  
16D8- FF FF FF FF FF FF FF FF  
16E0- FF FF FF FF FF FF FF FF  
16E8- FF FF FF FF FF FF FF FF  
16F0- FF FF FF FF FF FF FF FF  
16F8- FF FF FF FF FF FF FF FF  
1700- FF FF FF FF FF FF FF FF  
1708- FF FF FF FF FF FF FF FF  
1710- FF FF FF FF FF FF FF FF  
1718- FF FF FF FF FF FF FF FF  
1720- FF FF FF FF FF FF FF FF  
1728- FF FF FF FF FF FF FF FF  
1730- FF FF FF FF FF FF FF FF  
1738- FF FF FF FF FF FF FF FF  
1740- FF FF FF FF FF FF FF FF  
1748- FF FF FF FF FF FF FF FF  
1750- FF FF FF FF FF FF FF FF  
1758- FF FF FF FF FF FF FF FF  
1760- FF FF FF FF FF FF FF FF  
1768- FF FF FF FF FF FF FF FF  
1770- FF FF FF FF FF FF FF FF  
1778- FF FF FF FF FF FF FF FF  
1780- FF FF FF FF FF FF FF FF  
1788- FF FF FF FF FF FF FF FF  
1790- FF FF FF FF FF FF FF FF  
1798- FF FF FF FF FF FF FF FF  
17A0- FF FF FF FF FF FF FF FF  
17A8- FF FF FF FF FF FF FF FF  
17B0- FF FF FF FF FF FF FF FF  
17B8- FF FF FF FF FF FF FF FF  
17C0- FF FF FF FF FF FF FF FF  
17C8- FF FF FF FF FF FF FF FF  
17D0- FF FF FF FF FF FF FF FF  
17D8- FF FF FF FF FF FF FF FF  
17E0- FF FF FF FF FF FF FF FF  
17E8- FF FF FF FF FF FF FF FF  
17F0- FF FF FF FF FF FF FF FF  
17F8- FF FF FF FF FF FF FF FF 

**** Stage zero bootloader ****

                SEC0SHDOW:
1800-   01 EA       ORA  ($EA,X)
1802-   A2 FF       LDX  #FF
1804-   9A          TXS  
1805-   2C 81 C0    BIT  $C081
1808-   20 2F FB    JSR  $FB2F
180B-   20 93 FE    JSR  $FE93
180E-   20 89 FE    JSR  $FE89
1811-   20 84 FE    JSR  SETNORM
1814-   A0 00       LDY  #00
1816-   B9 00 08    LDA  NIBBUF,Y
1819-   99 00 03    STA  $0300,Y
181C-   C8          INY  
181D-   D0 F7       BNE  $1816
181F-   A5 2B       LDA  BOOTSLOT
1821-   8D EE 03    STA  SLOTNUM
1824-   4A          LSR  
1825-   4A          LSR  
1826-   4A          LSR  
1827-   4A          LSR  
1828-   09 C0       ORA  #C0
182A-   8D 58 03    STA  $0358
182D-   4C 40 03    JMP  NKSTUB
1830-   00          BRK  
1831-   00          BRK  
1832-   00          BRK  
1833-   00          BRK  
1834-   00          BRK  
1835-   00          BRK  
1836-   00          BRK  
1837-   00          BRK  
1838-   00          BRK  
1839-   00          BRK  
183A-   00          BRK  
183B-   00          BRK  
183C-   00          BRK  
183D-   00          BRK  
183E-   00          BRK  
183F-   00          BRK  
1840-   8D 40 0E    STA  NKENT1
1843-   AC EE 03    LDY  SLOTNUM
1846-   B9 8E C0    LDA  $C08E,Y
1849-   B9 8C C0    LDA  $C08C,Y
184C-   B9 89 C0    LDA  $C089,Y
184F-   A2 00       LDX  #00
1851-   B5 00       LDA  $00,X
1853-   9D 00 0B    STA  $0B00,X
1856-   BD 00 C6    LDA  $C600,X
1859-   C0 00       CPY  #00
185B-   F0 04       BEQ  $1861
185D-   C0 D6       CPY  #D6
185F-   D0 09       BNE  $186A
1861-   C9 04       CMP  #04
1863-   B0 05       BCS  $186A
1865-   6D 55 03    ADC  $0355
1868-   E9 04       SBC  #04
186A-   9D 00 0A    STA  $0A00,X
186D-   A8          TAY  
186E-   E8          INX  
186F-   D0 E0       BNE  $1851
1871-   A0 00       LDY  #00
1873-   A2 96       LDX  #96
1875-   8A          TXA  
1876-   0A          ASL  
1877-   85 3C       STA  SRCBEG
1879-   8A          TXA  
187A-   05 3C       ORA  SRCBEG
187C-   49 FF       EOR  #FF
187E-   4A          LSR  
187F-   F0 05       BEQ  $1886
1881-   0A          ASL  
1882-   90 FD       BCC  *-1
1884-   D0 0B       BNE  $1891
1886-   8A          TXA  
1887-   25 3C       AND  SRCBEG
1889-   0A          ASL  
188A-   F0 05       BEQ  $1891
188C-   98          TYA  
188D-   9D D6 08    STA  $08D6,X
1890-   C8          INY  
1891-   E8          INX  
1892-   D0 E1       BNE  $1875
1894-   AE EE 03    LDX  SLOTNUM
1897-   86 2B       STX  BOOTSLOT
1899-   AD EF 03    LDA  CURTRK
189C-   F0 18       BEQ  $18B6
189E-   A0 50       LDY  #50
18A0-   BD 80 C0    LDA  $C080,X
18A3-   CA          DEX  
18A4-   CA          DEX  
18A5-   8A          TXA  
18A6-   29 07       AND  #07
18A8-   05 2B       ORA  BOOTSLOT
18AA-   AA          TAX  
18AB-   BD 81 C0    LDA  $C081,X
18AE-   A9 38       LDA  #38
18B0-   20 A8 FC    JSR  WAIT
18B3-   88          DEY  
18B4-   D0 EA       BNE  $18A0
18B6-   8D EF 03    STA  CURTRK
18B9-   85 41       STA  DSTBEG-1
18BB-   85 26       STA  NKRETADR
18BD-   A0 02       LDY  #02
18BF-   84 3D       STY  SECTOR
18C1-   98          TYA  
18C2-   38          SEC  
18C3-   6D 55 03    ADC  $0355
18C6-   85 27       STA  NKRETADR+1
18C8-   A9 60       LDA  #60
18CA-   8D EF 0A    STA  $0AEF
18CD-   A6 2B       LDX  BOOTSLOT
18CF-   A0 00       LDY  #00
18D1-   20 5C 0A    JSR  $0A5C
18D4-   A4 3D       LDY  SECTOR
18D6-   C8          INY  
18D7-   C0 0C       CPY  #0C
18D9-   D0 02       BNE  $18DD
18DB-   A0 01       LDY  #01
18DD-   C0 0D       CPY  #0D
18DF-   D0 DE       BNE  $18BF
18E1-   4C 00 0D    JMP  RDTRANSZ
18E4-   00          BRK  
18E5-   00          BRK  
18E6-   00          BRK  
18E7-   00          BRK  
18E8-   00          BRK  
18E9-   00          BRK  
18EA-   00          BRK  
18EB-   4C 01 11    JMP  DEFERRHND
18EE-   00          BRK  
18EF-   00          BRK  
18F0-   59 FA 69    EOR  $69FA,Y
18F3-   FF          ???  
18F4-   5A          ???  
18F5-   4C 69 FF    JMP  MONZ
18F8-   4C 65 FF    JMP  $FF65
18FB-   00          BRK  
18FC-   FF          ???  
18FD-   00          BRK  
18FE-   65 FF       ADC  $FF

**** Stage 1 boot loader - once each time NakedOS is loaded ****

                SEC1SHDOW:
1900-   A0 80       LDY  #80
1902-   8C C6 15    STY  NKTBLFLG
1905-   A0 00       LDY  #00
1907-   8C C4 15    STY  INTRNFLG
190A-   AD EE 03    LDA  SLOTNUM
190D-   C9 60       CMP  #60
190F-   F0 42       BEQ  $1953
1911-   A2 02       LDX  #02
1913-   86 50       STX  PTMP
1915-   A2 0E       LDX  #0E
1917-   86 51       STX  PTMP+1
1919-   B1 50       LDA  (PTMP),Y
191B-   C9 C0       CMP  #C0
191D-   F0 0A       BEQ  $1929
191F-   C8          INY  
1920-   D0 F7       BNE  $1919
1922-   E8          INX  
1923-   E0 15       CPX  #15
1925-   D0 F0       BNE  $1917
1927-   F0 2A       BEQ  $1953
1929-   84 3A       STY  PCL
192B-   86 3B       STX  PCL+1
192D-   A0 00       LDY  #00
192F-   B1 3A       LDA  (PCL),Y
1931-   20 8E F8    JSR  INSDS2
1934-   A5 2F       LDA  NIBCOUNT
1936-   C9 02       CMP  #02
1938-   D0 13       BNE  $194D
193A-   A0 01       LDY  #01
193C-   B1 3A       LDA  (PCL),Y
193E-   C9 E0       CMP  #E0
1940-   90 0B       BCC  $194D
1942-   C9 F0       CMP  #F0
1944-   B0 07       BCS  $194D
1946-   29 8F       AND  #8F
1948-   0D EE 03    ORA  SLOTNUM
194B-   91 3A       STA  (PCL),Y
194D-   A4 3A       LDY  PCL
194F-   A6 3B       LDX  PCL+1
1951-   D0 CC       BNE  $191F
1953-   A2 00       LDX  #00
1955-   AD 40 03    LDA  NKSTUB
1958-   C9 8D       CMP  #8D
195A-   F0 0B       BEQ  $1967
195C-   BD 00 0B    LDA  $0B00,X
195F-   95 00       STA  $00,X
1961-   E8          INX  
1962-   D0 F8       BNE  $195C
1964-   4C 40 0E    JMP  NKENT1
1967-   8A          TXA  
1968-   A0 40       LDY  #40
196A-   99 FF 02    STA  $02FF,Y
196D-   88          DEY  
196E-   D0 FA       BNE  $196A
1970-   B9 00 0D    LDA  RDTRANSZ,Y
1973-   99 00 08    STA  NIBBUF,Y
1976-   C0 D8       CPY  #D8
1978-   90 03       BCC  $197D
197A-   20 ED FD    JSR  COUT
197D-   C8          INY  
197E-   D0 F0       BNE  $1970
1980-   4C 83 08    JMP  $0883
1983-   20 40 0E    JSR  NKENT1
1986-   6D 01 DC    ADC  $DC01
1989-   2C 01 DF    BIT  FHELLO
198C-   2C 00 18    BIT  SEC0SHDOW
198F-   F8          SED  
1990-   4C 00 18    JMP  SEC0SHDOW
1993-   00          BRK  
1994-   00          BRK  
1995-   00          BRK  
1996-   00          BRK  
...
  
19D8- CE C1 CB C5 C4 CF D3 A0  NAKEDOS 
19E0- A0 A0 D6 B1 AE B1 B8 A0    V1.18 
19E8- A8 C3 C3 A9 DA C5 D2 CF  (CC)ZERO
19F0- AC A0 C2 D9 A0 CD C1 D2  , BY MAR
19F8- D4 C9 CE A0 C8 C1 D9 C5  TIN HAYE

Updated