1 / Disassembly of the DMS RF08 driver. 2 / Nov 20 2023: 3 / Downloaded the excellent start made by Dave R. from 4 / https://forum.vcfed.org/index.php?attachments/dms-stuff-zip.1268325/ 5 / Nov 21 2023: 6 / Created this document, which hopes to still document things while 7 / actually assembling to re-create the original driver. 8 / 9 10 DIML=6615 11 DXAL=6643 12 DISK=6623 13 DFSE=6621 14 15 *7600 16 007600 0006 L7600, 0006 / The BOOTSTRAP entry point! A constant? 17 007601 4242 JMS SYSIO / Call SYSIO entry point. 18 007602 0005 0005 / Function code. 5 = WRITE. 19 007603 0373 0373 / Block = first disk scratch block. 20 007604 7200 7200 / Buffer address. 21 007605 0005 L7605, 0005 / Link field? Also used as temporary storage by the 22 / instruction at L7647 as the function code parameter. 23 007606 7402 HLT / Error HALT. 24 007607 4242 JMS SYSIO / Call SYSIO entry point. 25 007610 0005 0005 / Function code. 5 = WRITE. 26 007611 0374 0374 / Block = second disk scratch block. 27 007612 7400 7400 / Buffer address. 28 007613 0001 L7613, 0001 / Link field? Also used as temporary storage by the 29 / instruction at L7713 as ???. 30 007614 7752 L7614, 7752 31 007615 4242 JMS SYSIO / Call SYSIO entry point. 32 007616 0003 0003 / Function code. 3 = READ. 33 007617 0001 0001 / Block = MONITOR (1ST PAGE OF SAVE). 34 007620 7200 7200 / Buffer address. 35 007621 0000 L7621, 0000 / Link field? Also used as temporary storage by the 36 / instruction at L7665 as ???. 37 007622 7402 HLT / Error HALT. 38 007623 4242 JMS SYSIO / Call SYSIO entry point. 39 007624 0003 0003 / Function code. 3 = READ. 40 007625 0002 0002 / Block = MONITOR (START). 41 007626 7400 L7626, 7400 / Buffer address. Also Monitor starting address. 42 007627 0000 L7627, 0000 / Link field? Also used as temporary storage by the 43 / instruction at L7661 as the disk block parameter. 44 007630 7402 HLT / Error HALT. 45 007631 5626 JMP I L7626 / Jump to MONITOR START. >>>>>>>>>>>>>>>>>>>> 46 47 007632 0077 C77, 0077 / Constant 0077. Used by the instructions at addresses 48 / L7705 and L7721. 49 007633 0040 C40, 0040 / Constant 0040. Used by the instruction at address L7715. 50 007634 0700 C700, 0700 / Constant 0700. Used by the instruction at address L7724. 51 52 / An indirect error return is desired by the caller. 53 007635 1214 L7635, TAD L7614 / Load AC from L7614 (the strange constant value of L7752)!!! 54 007636 3352 DCA L7752 / Store AC to memory address L7752. Clear AC. 55 007637 1642 TAD I SYSIO / Load the value found at the return address pointer 56 / (which should now be pointing at the caller's 57 / ERROR address). 58 007640 3242 DCA SYSIO / Store the result back into L7642 (the return address). Clear AC. 59 007641 5301 JMP L7701 / Jump to L7701 (back into the main pass of the program) 60 / as though nothing had happened - we have just 61 / 'bodged' the return address if an error occurs though! 62 63 64 / 65 / JMS I SYSIO 66 / WORD DESIRED FUNCTION 67 / WORD DESIRED BLOCK 68 / WORD DESIRED CORE ADDRESS (low 12 bits). 69 / WORD LINK FIELD (Filled by WRITE, used by READ). 70 / ERROR RETURN HERE 71 / NORMAL RETURN HERE 72 / 73 / FUNCTION WORD 74 / ============= 75 / 76 / 0 1 2 3 4 5 6 7 8 9 10 11 77 / U U - Unused bits. 78 / R - 0=Normal return. 1=Indirect return. 79 / U U U - Unit number 0-7 (if DECtape?). 80 / F F F - Memory field 0-7. 81 / F F F - Function. READ=3. WRITE=5. 82 / 83 / The ERROR RETURN in the indirect case is a pointer to a location in memory 84 / to return to. It will return to the pointer in the case of an ERROR or to 85 / pointer+1 in the case of NO ERROR. 86 / 87 007642 0371 SYSIO, 0371 / SYSIO SUBROUTINE. Return address. 88 007643 7346 CLA CLL CMA RTL / AC = 7775 (-3). This is the 'retry counter' 89 / in case of a disk read or write error. 90 007644 3357 DCA L7757 / Save to L7757. Clear AC. 91 007645 1642 TAD I SYSIO / AC = function code parameter. 92 007646 3205 DCA L7605 / Save to L7605. Clear AC. Store AC to a link field?? 93 007647 1205 TAD L7605 / Reload function code parameter again to AC. 94 007650 0200 L7650, AND L7600 / Only interested in bits 000 000 000 110 95 / = (3=010=READ; 5=100=WRITE). 96 / Also constant 0200! 97 007651 1364 TAD L7764 / Add to the value stored at L7764 (= 6601). 98 / 6603=READ. 6605=WRITE. 99 007652 3336 DCA L7736 / Save to L7736. Clear AC. 100 007653 1205 TAD L7605 / Reload function code parameter again to AC. 101 007654 0347 AND L7747 / Mask with 0070 = 000 000 111 000. 102 / This isolates the memory field. 103 007655 1375 TAD L7775 / Add in 6201. = 62X1. CDF Change Data Field. 104 007656 3370 DCA L7770 / Store resulting CDF instruction to L7770. 105 007657 2242 ISZ SYSIO / Move parameter pointer (subroutine return address) 106 / on to the BLOCK parameter. 107 007660 1642 TAD I SYSIO / AC = disk block number to read/write. 108 007661 3227 DCA L7627 / Save to L7627. Clear AC. Store AC to a link field?? 109 007662 2242 ISZ SYSIO / Move parameter pointer (subroutine return address) 110 / on to the ADDRESS parameter. 111 007663 1642 TAD I SYSIO / AC = memory address to start reading from/ writing to. 112 007664 1250 TAD L7650 / AC = memory address + what is at L7650 = 0200. ??? 113 007665 3221 DCA L7621 / Save to L7621. Clear AC. Store AC to a link field?? 114 007666 2242 ISZ SYSIO / Move parameter pointer (subroutine return address) 115 / on to the LINK parameter. 116 007667 1642 TAD I SYSIO / AC = link parameter. 117 007670 4366 JMS L7766 / CALL SUBROUTINE at L7766. 118 007671 3353 DCA L7753 / Save to L7753. Clear AC. 119 007672 1242 TAD SYSIO / AC = the address itself of the LINK field. 120 007673 3352 DCA L7752 / Store the address of the link field to L7752. Clear AC. 121 007674 2242 ISZ SYSIO / Move parameter pointer (subroutine return address) 122 / on to the error address of the caller. 123 007675 1205 TAD L7605 / Pick-up the function code parameter. 124 007676 7006 RTL / Rotate twice left AC and L. 125 007677 7710 SPA CLA / Skip if AC sign bit is '0'. Clear AC anyhow. 126 / This indicates a 'NORMAL RETURN'. 127 007700 5235 JMP L7635 / Jump to L7635 if AC sign bit was '1'. 128 / This indicates an 'INDIRECT RETURN'. 129 130 / A normal return is desired by the caller. 131 007701 1205 L7701, TAD L7605 / Pick-up the function code parameter. 132 007702 0347 AND L7747 / Logically AND AC with what is at address L7747 = 0070 133 / to leave us with the desired memory field specified 134 / by the caller. 135 007703 6615 DIML / [DISK INSTRUCTION]. Load desired memory field into 136 / the disk controller from AC. Clear AC. 137 007704 1227 TAD L7627 / Add into AC what is at address L7627 (the disk block 138 / number). Presumably AC is 0 at this point? 139 007705 0232 AND C77 / And the block number (in AC) with 0077. 140 / Lowest 6 bits retained of the block number. 141 007706 7112 CLL RTR / L=0. Rotate AC twice right via L. 142 007707 7012 RTR / Rotate AC twice more right. 143 007710 7012 RTR / Rotate AC twice more right (getting dizzy now)... 144 / Making 6 right rotates in total. 145 007711 7101 CLL IAC / L=0. AC=AC+1 (linking any overflow into L). 146 007712 1227 TAD L7627 / Add to AC what is stored at address L7627 147 / (which is the disk block number again)??? 148 007713 3213 DCA L7613 / Store the result to L7613. Another link field?? 149 / Clear AC. 150 007714 7430 SZL / Skip the next instruction if L=0. 151 007715 1233 TAD C40 / Load into 0040 AC. 152 007716 1227 TAD L7627 / Add into AC what is stored at address L7627 153 / = the desired disk block. 154 007717 7012 RTR / Rotate AC right twice via L. 155 007720 7012 RTR / Rotate AC right twice via L. 156 / making 4 right rotates in total. 157 007721 0232 AND C77 / Logically AND AC with the constant 0077. 158 / Lowest 6 bits retained. 159 007722 3350 DCA WC / Store the result in AC to WC. 160 / Clear AC. 161 007723 1205 TAD L7605 / Load AC from the value stored at address L7605 162 / = function code parameter. 163 007724 0234 AND C700 / Logically AND AC with the constant 0700. 164 / Extract the desired UNIT number. 165 007725 1350 TAD WC / Add into AC what is stored at WC. 166 / This is the value calculated from address L7722. 167 007726 7110 CLL RAR / L=0. Rotate AC right through L. 168 007727 6643 DXAL / [DISK INSTRUCTION]. Load EMA bits again? Clears AC. 169 007730 1346 TAD L7746 / Load AC with the value at address L7746 = L7577. 170 / What is this? 171 007731 3350 DCA WC / Store AC to WC. Clear AC. 172 007732 1346 TAD L7746 / Load AC with the value at address L7746 = L7577. 173 / What is this? 174 007733 1221 TAD L7621 / Add into AC the value at address L7621 (one of the 175 / magic link fields used as temporary storage)... 176 007734 3351 DCA CA / Store the result to CA. Clear AC. 177 007735 1213 TAD L7613 / Load AC with the value at memory address L7613 178 / (another one of the magic link fields used as 179 / temporary storage)... 180 007736 6605 L7736, DMAW/DMAR / Used for storage from L7652. 6603=READ. 6605=WRITE. 181 007737 6623 DISK / [DISK INSTRUCTION]. Skip next instruction if either 182 / the error flag is set or the data completion flag 183 / is set. 184 007740 5337 JMP .-1 / Loop back to 'DISK' instruction if READ or WRITE 185 / instruction has not 'finished'... 186 007741 6621 DFSE / [DISK INSTRUCTION]. Skip the next instruction if an 187 / error occurred (DRL, PER, WLS or NXD errors). 188 007742 5360 JMP L7760 / An 'OK' read or write occurred. 189 190 / An error occurred during the disk read or write. 191 007743 2357 ISZ L7757 / Increment the 'tries' counter. 192 007744 5301 JMP L7701 / Repeat the disk read or write (a retry). 193 007745 5361 JMP L7761 / Exhausted the retry counter - must be an error then! 194 195 007746 7577 L7746, 7577 / Value used at instructions L7730 and L7732. 196 007747 0070 L7747, 0070 / Mask used at instruction L7654. 197 007750 0000 WC, 0000 / WORD COUNT (WC) !!!!!!!!!!!!!!!! 198 007751 0000 CA, 0000 / CURRENT ADDRESS (CA) !!!!!!!!!!!!!!!! 199 007752 0370 L7752, 0370 / Used for storage from L7673. The address of the LINK 200 / field from the caller. Also written to from the 201 / instruction at address L7636 which would store the 202 / value L7752??? 203 007753 0000 L7753, 0000 / Used for storage from L7671. 204 007754 0000 0000 / *** APPEARS UNUSED *** 205 007755 0000 0000 / *** APPEARS UNUSED *** 206 007756 0000 0000 / *** APPEARS UNUSED *** 207 007757 7775 L7757, 7775 / Used for storage from L7644. Value set to L7775... 208 / This is the 'retry counter'. 209 210 / Get here from L7742 following an 'OK' disk read or write. 211 007760 2242 L7760, ISZ SYSIO / Bump the subroutine return address to the correct 212 / point (skip the error address). 213 007761 1353 L7761, TAD L7753 / Load AC from memory address L7753 = result of the 214 / instruction at L7671. 215 007762 4366 JMS L7766 / Call the subroutine at L7766. 216 007763 3752 DCA I L7752 / Update the LINK field of the caller. 217 007764 6601 L7764, DCMA / [DISK INSTRUCTION]. Clears a load of disk state 218 / registers... Added into AC at instruction L7651. 219 007765 5642 JMP I SYSIO / Return from SYSIO subroutine. 220 221 007766 7671 L7766, 7671 / Start of subroutine. Called from L7670 and L7762. 222 007767 3351 DCA CA / Store AC to CURRENT ADDRESS and clear AC. 223 007770 6201 L7770, CDF 0 / Change Data Field. Used for storage from L7656. 224 007771 1621 TAD I L7621 / The value indirectly accessed by one of the magic 225 / link fields... 226 007772 3350 DCA WC / Store to WORD COUNT and clear AC. 227 007773 1351 TAD CA / Load AC from CURRENT ADDRESS. 228 007774 3621 DCA I L7621 / Store AC indirectly accessed by one of the magic 229 / link fields... 230 007775 6201 L7775, CDF 0 / Added into AC at instruction L7655. Return back to 231 / current field. 232 007776 1350 TAD WC / Load the WORD COUNT into AC. 233 007777 5766 JMP I L7766 / Return from subroutine back to caller... 234 $ C40 7633 C700 7634 C77 7632 CA 7751 DFSE 6621 DIML 6615 DISK 6623 DXAL 6643 L7600 7600 L7605 7605 L7613 7613 L7614 7614 L7621 7621 L7626 7626 L7627 7627 L7635 7635 L7650 7650 L7701 7701 L7736 7736 L7746 7746 L7747 7747 L7752 7752 L7753 7753 L7757 7757 L7760 7760 L7761 7761 L7764 7764 L7766 7766 L7770 7770 L7775 7775 SYSIO 7642 WC 7750