Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
00: 51410000000e00 CONT ;
01: 41412000000e00 CONT ; Pulse FSelTag
02: 41410000000e00 CONT ;
03: 4141000001c308 CJP 08 ; JMP to MainCmdBit8 if Cmd8
04: 4141000001d309 CJP 09 ; JMP to MainCmdBit9 if Cmd9
05: 41410000100e00 CONT ; Pulse ED counter clock
06: 41410000000e00 CONT ;
07: 414100000913e4 CJP e4 ; Goto Error
MainCmdBit8:
08: 4141000010530a CJP 0a ; JMP to ReadyForCmd if Ready
MainCmdBit9:
09: 41410002000000 JZ ; Done
ReadyForCmd:
0a: 414100000063e4 CJP e4 ; JMP to Error if Fault
0b: 41410001000e00 CONT ; Present Cylinder and Pulse FCylTag
0c: 41410001800e00 CONT ;
0d: 41410001000e00 CONT ;
LoopUntilCylFound:
0e: 41410000007312 CJP 12 ; JMP to CylFound if OnCyl
0f: 414100000083e4 CJP e4 ; JMP to Error if SeekErr
10: 414100000063e4 CJP e4 ; JMP to Error if Fault
11: 4141000001130e CJP 0e ; Goto LoopUntilCylFound
CylFound:
12: 41410000080e00 CONT ; Clock ED
13: 4141000005e318 CJP 18 ; JMP to CmdGroupBit10 if Cmd10, Clear LineCounter
14: 4141000001d316 CJP 16 ; JMP to CmdGroupBit9 if Cmd9
15: c1410000000e00 CONT ; Clear Disc Field
CmdGroupBit9:
16: 4141000001f348 CJP 48 ; JMP to CmdReadData if Cmd11
17: 4141000001131d CJP 1d ; Goto CmdErase
CmdGroupBit10:
18: 4141000001d31b CJP 1b ; JMP to CmdGroup0x600or0xE00 if Cmd9
19: 4141000001f3c3 CJP c3 ; JMP to CmdUnknown3 if Cmd11
1a: 414100000113a8 CJP a8 ; Goto CmdUnknown2
CmdGroup0x600or0xE00:
1b: 4149000001f38b CJP 8b ; JMP to CmdRead if Cmd11, Pulse ZeroRAM
1c: 41410000011373 CJP 73 ; Goto CmdUnknown1
CmdErase:
1d: 41410000411135 CJS 35 ; Call WaitForCylAndIndex
1e: 41411408000cbe LDCT be ; Counter = be, Assert FCmdTag, Drive FCmd, FCmd=01
Delay760Cycles:
1f: 41411408000e00 CONT ;
20: 41411408000e00 CONT ;
21: 41411408000e00 CONT ;
22: 4141140800091f RPCT 1f ; Loop to Delay760Cycles
23: 41411408001327 CJP 27 ; JMP to ExitLineCounterDelay1 if LPROM1
24: 41411408000e00 CONT ;
25: 41411408020cbe LDCT be ; LineCounter++
26: 4141140801131f CJP 1f ; Goto Delay760Cycles
ExitLineCounterDelay1:
27: 41411408018330 CJP 30 ; JMP to FinishDelay if Cmd4, Assert FCmdTag, Drive FCmd, FCmd=00
28: 41411408020e00 CONT ; LineCounter++
29: 41411408011140 CJS 40 ; Call WriteSyncMark
2a: 41410000211135 CJS 35 ; Call WaitForCylAndIndex, Deassert FCmdTag, Clock Head Counter
2b: 41411408000cfe LDCT fe ; Counter = fe, Assert FCmdTag, Drive FCmd, FCmd=01
Delay762Cycles:
2c: 41411408000e00 CONT ;
2d: 41411408000e00 CONT ;
2e: 4141140800092c RPCT 2c ; Loop to Delay762Cycles
2f: 41411408001332 CJP 32 ; JMP to ExitLineCounterDelay2 if LPROM1
FinishDelay:
30: 41411408020cfe LDCT fe ; LineCounter++
31: 4141140801132c CJP 2c ; Goto Delay762Cycles
ExitLineCounterDelay2:
32: 41411408000e00 CONT ;
33: 41411408011140 CJS 40 ; Call WriteSyncMark
34: 41410002000000 JZ ; Done, Halt Processing
WaitForCylAndIndex:
35: 4141000400c3ea CJP ea ; JMP to ErrorClearCounter if WriteProt, Present Head Index
36: 41410804000e00 CONT ;
37: 41410004000c06 LDCT 06 ; Counter = 06
38: 41410008000938 RPCT 38 ; Delay 6 cycles, Assert FCmdTag, Present FCmd=00
WaitForCylinder:
39: 4141000800733b CJP 3b ; JMP to WaitForIndex if OnCyl
3a: 41410008011339 CJP 39 ; Goto WaitForCylinder
WaitForIndex:
3b: 4141100800933d CJP 3d ; JMP to FoundIndex if IndexPulse
3c: 4141100801133b CJP 3b ; Goto WaitForIndex
FoundIndex:
3d: 61411408000c1f LDCT 1f ; Assert FCmdTag, Drive FCmd, FCmd=01, Write Zero
3e: 6141140800093e RPCT 3e ; Delay 31 cycles, Write Zero
3f: 61411408011a00 CRTN ; Return, Write Zero
WriteSyncMark:
40: 61411408000e00 CONT ; Assert WriteZero, Assert FCmdTag, Drive FCmd, FCmd=01
41: 61411408000e00 CONT ;
42: 61411408000e00 CONT ;
43: 41411408000e00 CONT ; Deassert WriteZero
44: 61411408000e00 CONT ; Assert WriteZero
45: 61411408000e00 CONT ;
46: 61411408000e00 CONT ;
47: 41411008011a00 CRTN ; Deassert WriteZero, Return
CmdReadData:
48: 41410000411168 CJS 68 ; Call PresentHeadAndWaitForCyl
49: 4143120800f349 CJP 49 ; Wait for !SyncDetect, Assert FCmdTag, Drive FCmd, FCmd=02, CKSel 3
4a: 41431208000e00 CONT ;
Init762CycleDelay2:
4b: 41431208000cfe LDCT fe ; Counter = fe
Delay762Cycles2:
4c: 41431208000e00 CONT ;
4d: 41431208000e00 CONT ;
4e: 4143120800094c RPCT 4c ; Loop to Delay762Cycles2
4f: 41431208001351 CJP 51 ; JMP to ExitLineCounterDelay3 if LPROM1
50: 4143120803134b CJP 4b ; LineCounter++, Goto Init762CycleDelay2
ExitLineCounterDelay3:
51: 4143120803835a CJP 5a ; LineCounter++, JMP to Init762CycleDelay3 if Cmd4
52: 41c31208000e00 CONT ; Pulse SyncDetEn
53: 41431208000e00 CONT ;
54: 4143120800f3ea CJP ea ; JMP to ErrorClearCounter if !SyncDetect
55: 41431208000e00 CONT ;
56: 41431208000e00 CONT ;
57: 41431008211168 CJS 68 ; Clock Head Counter, FCmd=00, Call ReadTrack
58: 4143120800f358 CJP 58 ; Wait for !SyncDetect, Assert FCmdTag, Drive FCmd, FCmd=02, CKSel 3
59: 41431208000e00 CONT ;
Init762CycleDelay3:
5a: 41431208000cfe LDCT fe ; Counter = fe
Delay762Cycles3:
5b: 41431208000e00 CONT ;
5c: 41431208000e00 CONT ;
5d: 4143120800095b RPCT 5b ; Loop to Delay762Cycles3
5e: 41431208001360 CJP 60 ; JMP to ExitLineCounterDelay4 if LPROM1
5f: 4143120803135a CJP 5a ; LineCounter++, Goto Init762CycleDelay3
ExitLineCounterDelay4:
60: 41431208000e00 CONT ;
61: 41c31208000e00 CONT ; Pulse SyncDetEn
62: 41431208000e00 CONT ;
63: 4143120800f3ea CJP ea ; JMP to ErrorClearCounter if !SyncDetect
64: 41431208000e00 CONT ;
65: 41431208000e00 CONT ;
66: 41431008000e00 CONT ; FCmd=00
67: 41410002000000 JZ ; Done
PresentHeadAndWaitForCyl:
68: 41410004000e00 CONT ; Present Head Index
69: 41410804000e00 CONT ; Pulse FHDTag
6a: 41410004000c06 LDCT 06 ; Counter = 06
6b: 4141000800096b RPCT 6b ; Delay for 6 cycles, Present FCmd=00
WaitForCylinder2:
6c: 4141000800736e CJP 6e ; JMP to WaitForIndex2 if OnCyl
6d: 4141000801136c CJP 6c ; Goto WaitForCylinder2
WaitForIndex2:
6e: 41431008009370 CJP 70 ; JMP to FoundIndex2 if IndexPulse, Assert FCmdTag, CKSel 3
6f: 4143100801136e CJP 6e ; Goto WaitForIndex2
FoundIndex2:
70: 41431008000c06 LDCT 06 ; Counter = 06
71: 41431008000971 RPCT 71 ; Delay for 6 cycles
72: 41c31208011a00 CRTN ; Return, Pulse SyncDetEn, Assert FCmdTag, Present FCmd=02
CmdUnknown1:
73: 41410000411135 CJS 35 ; Call WaitForCylAndIndex, Deassert FCmdTag
74: 41411408000cbe LDCT be ; Counter = be, Assert FCmdTag, Present FCmd=01
ReadDelayLoop:
75: 41611408000e00 CONT ; Assert ReadRAM
76: 41611408000e00 CONT ;
77: 41611408000e00 CONT ;
78: 41611408000975 RPCT 75 ; Loop to ReadDelayLoop [760]
79: 4161140800137d CJP 7d ; JMP to DoneReadLoop if LPROM1
7a: 41611408000e00 CONT ;
7b: 41611408000cbe LDCT be ; Counter = be
7c: 41611408031375 CJP 75 ; LineCounter++, Goto ReadDelayLoop
DoneReadLoop:
7d: 41611408018386 CJP 86 ; JMP to SkipSyncWrite if Cmd4
7e: 41611408020e00 CONT ; LineCounter++
7f: 41611408011140 CJS 40 ; Call WriteSyncMark
80: 41410000211135 CJS 35 ; Call WaitForCylAndIndex, Deassert FCmdTag, Deassert ReadRAM
81: 41411408000cfe LDCT fe ; Counter = fe
ReadDelayLoop2:
82: 41611408000e00 CONT ; Assert ReadRAM
83: 41611408000e00 CONT ;
84: 41611408000982 RPCT 82 ; Loop to ReadDelayLoop2 [762]
85: 41611408001388 CJP 88 ; JMP to DoneReadLoop2 if LPROM1
SkipSyncWrite:
86: 41611408000cfe LDCT fe ; Counter = fe
87: 41611408031382 CJP 82 ; LineCounter++, Goto ReadDelayLoop2
DoneReadLoop2:
88: 41611408000e00 CONT ;
89: 41611408011140 CJS 40 ; Call WriteSyncMark
8a: 41410002000000 JZ ; Done
CmdRead:
8b: 41410000411168 CJS 68 ; Call PresentHeadAndWaitForCyl
8c: 4143120800f38c CJP 8c ; Wait for !SyncDetect, Assert FCmdTag, Present FCmd=02, CKSel 3
InitDelayLoop:
8d: 41531208000cfe LDCT fe ; Counter = fe, Assert WriteRAM
DelayLoop:
8e: 41531208000e00 CONT ;
8f: 41531208000e00 CONT ;
90: 4153120800098e RPCT 8e ; Loop to DelayLoop [762]
91: 41531208001393 CJP 93 ; JMP to DoneDelayLoop if LPROM1
92: 4153120803138d CJP 8d ; LineCounter++, Goto InitDelayLoop
DoneDelayLoop:
93: 4153120803839b CJP 9b ; LineCounter++, JMP to InitDelayLoop2 if Cmd4
94: 41431208000e00 CONT ; Deassert WriteRAM
95: 41c31208000e00 CONT ; Pulse SyncDetEn
96: 41431208000e00 CONT ;
97: 4143120800f3ea CJP ea ; JMP to ErrorClearCounter if !SyncDetect
98: 41431208000e00 CONT ;
99: 41410000211168 CJS 68 ; Call PresentHeadAndWaitForCyl
9a: 4143120800f39a CJP 9a ; Wait for !SyncDetect
InitDelayLoop2:
9b: 41531208000cfe LDCT fe ; Assert WriteRAM, Counter = fe
DelayLoop2:
9c: 41531208000e00 CONT ;
9d: 41531208000e00 CONT ;
9e: 4153120800099c RPCT 9c ; Loop to DelayLoop2 [762]
9f: 415312080013a1 CJP a1 ; JMP to DoneDelayLoop2 if LPROM1
a0: 4153120803139b CJP 9b ; LineCounter++, Goto InitDelayLoop2
DoneDelayLoop2:
a1: 41531208000e00 CONT ;
a2: 41431208000e00 CONT ; Deassert WriteRAM
a3: 41c31208000e00 CONT ; Pulse SyncDetEn
a4: 41431208000e00 CONT ;
a5: 4143120800f3ea CJP ea ; JMP to ErrorClearCounter if !SyncDetect
a6: 41431208000e00 CONT ;
a7: 41410002000000 JZ ; Done
CmdUnknown2:
a8: 41410000411135 CJS 35 ; Call WaitForCylAndIndex, Clear Head Counter
a9: 41411408000cbe LDCT be ; Counter = be, Assert FCmdTag, Present FCmd=01
UnknownReadAndZeroLoop:
aa: 41611408000e00 CONT ; Assert ReadRAM, Deassert WriteZero
ab: 61411408000e00 CONT ; Deassert ReadRAM, Assert WriteZero
ac: 41611408000e00 CONT ; Assert ReadRAM, Deassert WriteZero
ad: 614114080009aa RPCT aa ; Deassert ReadRAM, Assert WriteZero, Loop to UnknownReadAndZeroLoop [762]
ae: 416114080013b2 CJP b2 ; Assert ReadRAM, Deassert WriteZero, JMP to ExitUnkReadAndZeroLoop if LPROM1
af: 61411408000e00 CONT ; Deassert ReadRAM, Assert WriteZero
b0: 41611408000cbe LDCT be ; Assert ReadRAM, Deassert WriteZero, Counter = be
b1: 614114080313aa CJP aa ; Deassert ReadRAM, Assert WriteZero, Goto UnknownReadAndZeroLoop
ExitUnkReadAndZeroLoop:
b2: 614114080183bd CJP bd ; Deassert ReadRAM, Assert WriteZero, JMP to bd if Cmd4
b3: 41611408020e00 CONT ; Assert ReadRAM, Deassert WriteZero, LineCounter++
b4: 61411408011140 CJS 40 ; Deassert ReadRAM, Assert WriteZero, Call WriteSyncMark
b5: 41410000211135 CJS 35 ; Deassert WriteZero, Deassert FCmdTag, Call WaitForCylAndIndex, HeadCounter++
b6: 41411408000cfe LDCT fe ; Counter = fe, Assert FCmdTag, Present FCmd=01
UnknownRAZLoop2:
b7: 41611408000e00 CONT ; Assert ReadRAM, Deassert WriteZero
b8: 61411408000e00 CONT ; Deassert ReadRAM, Assert WriteZero
b9: 41611408000e00 CONT ; Assert ReadRAM, Deassert WriteZero
ba: 614114080009b7 RPCT b7 ; Deassert ReadRAM, Assert WriteZero, Loop to UnknownRAZLoop2 [1016]
bb: 416114080013bf CJP bf ; Assert ReadRAM, Deassert WriteZero, JMP to ExitUnkRAZLoop2 if LPROM1
bc: 61411408000e00 CONT ; Deassert ReadRAM, Assert WriteZero
bd: 41611408000cbe LDCT be ; Assert ReadRAM, Deassert WriteZero, Counter = be
be: 614114080313b7 CJP b7 ; Deassert ReadRAM, Assert WriteZero, Goto UnknownRAZLoop2, LineCounter++
ExitUnkRAZLoop2:
bf: 61411408000e00 CONT ; Deassert ReadRAM, Assert WriteZero
c0: 41611408000e00 CONT ; Assert ReadRAM, Deassert WriteZero
c1: 61411408011140 CJS 40 ; Deassert ReadRAM, Assert WriteZero, Call WriteSyncMark
c2: 41410002000000 JZ ; Done
CmdUnknown3:
c3: 41410000411168 CJS 68 ; Call PresentHeadAndWaitForCyl
c4: 4143120800f3c4 CJP c4 ; Wait for !SyncDetect, Assert FCmdTag, Drive FCmd, FCmd=02, CKSel 3
InitUnknown3Loop:
c5: 41531208000cbe LDCT be ; Assert WriteRAM, Counter = be
Unknown3Loop:
c6: 41431208000e00 CONT ; Deassert WriteRAM
c7: 41531208000e00 CONT ; Assert WriteRAM
c8: 41431208000e00 CONT ; Deassert WriteRAM
c9: 415312080009c6 RPCT c6 ; Assert WriteRAM, Loop to Unknown3Loop [760 cycles]
ca: 41431208000e00 CONT ; Deassert WriteRAM
cb: 415312080013cd CJP cd ; Assert WriteRAM, JMP to cd if LPROM1
cc: 414312080313c5 CJP c5 ; LineCounter++, Goto InitUnknown3Loop
cd: 414312080383d5 CJP d5 ; JMP to Unknown3SkipSync if Cmd4
ce: 41431208000e00 CONT ;
cf: 41c31208000e00 CONT ; Pulse SyncDetEn
d0: 41431208000e00 CONT ;
d1: 4143120800f3ea CJP ea ; JMP to ErrorClearCounter if !SyncDetect
d2: 41431208000e00 CONT ;
d3: 41410000211168 CJS 68 ; Call PresentHeadAndWaitForCyl, Deassert FCmdTag, CKSel 1
d4: 4143120800f3d4 CJP d4 ; Wait for !SyncDetect, Assert FCmdTag, Drive FCmd, FCmd=02, CKSel 3
Unknown3SkipSync:
d5: 41531208000cfe LDCT fe ; Assert WriteRAM, Counter = fe
Unknown3Loop2:
d6: 41431208000e00 CONT ; Deassert WriteRAM
d7: 41531208000e00 CONT ; Assert WriteRAM
d8: 41431208000e00 CONT ; Deassert WriteRAM
d9: 415312080009d6 RPCT d6 ; Assert WriteRAM, Loop to Unknown3Loop2
da: 41431208000e00 CONT ; Deassert WriteRAM
db: 415312080013dd CJP dd ; Assert WriteRAM, JMP to ExitUnknown3Loop2 if LPROM1
dc: 414312080313d5 CJP d5 ; Goto Unknown3SkipSync
ExitUnknown3Loop2:
dd: 41431208000e00 CONT ;
de: 41431208000e00 CONT ;
df: 41c31208000e00 CONT ; Pulse SyncDetEn
e0: 41431208000e00 CONT ;
e1: 4143120800f3ea CJP ea ; JMP to ErrorClearCounter if !SyncDetect
e2: 41431208000e00 CONT ;
e3: 41410002000000 JZ ; Done
Error:
e4: 41410148000e00 CONT ;
e5: 41411148000e00 CONT ; Assert FCmdTag, Present FCmd=50
e6: 41410148000e00 CONT ;
ErrorWaitLoop:
e7: 414100000073eb CJP eb ; JMP to ErrorDone if OnCyl
e8: 414100000063ea CJP ea ; JMP to ErrorClearCounter if Fault
e9: 414100000113e7 CJP e7 ; Goto ErrorWaitLoop
ErrorClearCounter:
ea: 41410000100e00 CONT ; Clear ED Counter
ErrorDone:
eb: 41410002000000 JZ ; Done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment