/ Disassembly of the DMS DF32 driver. / Nov 20 2023: / Downloaded the excellent start made by Dave R. from / https://forum.vcfed.org/index.php?attachments/dms-stuff-zip.1268325/ / Nov 21 2023: / Created this document, which hopes to still document things while / actually assembling to re-create the original driver. / Nov 21 2023: / Copied the RF08 work described above, in order to create a similar / document for the DF32 driver. / DIML=6615 DXAL=6643 DFSC=6622 DFSE=6621 RELOC 7600 C77, 0077 / Bootstrap entry point, and harmless constant JMS SYSIO / Call SYSIO entry point. 0005 / Function code. 5 is WRITE. 0373 / Block = first disk scratch block. 7200 / Buffer address. 0000 / Link field. HLT / Error HALT. JMS SYSIO / Call SYSIO entry point. 0005 / Function code. 5 is WRITE. 0374 / Block = second disk scratch block. 7400 / Buffer address. 0000 / Link field. HLT JMS SYSIO / Call SYSIO entry point. 0003 / Function code. 3 is READ. 0001 / Block = MONITOR (1ST PAGE OF SAVE). 7200 / Buffer address. 0000 / Link field. HLT / Error HALT. JMS SYSIO / Call SYSIO entry point. 0003 / Function code. 3 is READ. 0002 / Block = MONITOR (START). MONTOR, 7400 / Buffer address. Also Monitor starting address. 0000 / Link field. HLT / Error HALT. JMP I MONTOR / Jump to MONITOR START. C6, 0006 / The BOOTSTRAP entry point! A constant? C37, 0037 / Constant 0037. C40, 0040 / Constant 0040. C70, 0070 / Constant 0070. C3700, 3700 / Constant 3700. IOERR, ISZ RETRY / BUGBUG JMP L7760 / BUGBUG JMP SETUP / BUGBUG / / JMS I SYSIO / WORD DESIRED FUNCTION / WORD DESIRED BLOCK / WORD DESIRED CORE ADDRESS (low 12 bits). / WORD LINK FIELD (Filled by WRITE, used by READ). / ERROR RETURN HERE / NORMAL RETURN HERE / / FUNCTION WORD / ============= / / 0 1 2 3 4 5 6 7 8 9 10 11 / U U - Unused bits. / R - 0=Normal return. 1=Indirect return. / U U U - Unit number 0-7 (if DECtape?). / F F F - Memory field 0-7. / F F F - Function. READ=3. WRITE=5. / / The ERROR RETURN in the indirect case is a pointer to a location in memory / to return to. It will return to the pointer in the case of an ERROR or to / pointer+1 in the case of NO ERROR. / SYSIO, 0371 / SYSIO SUBROUTINE. Return address. CLA CMA / AC = 7777. This is the retry counter. / in case of a disk read or write error. DCA RETRY / Save to RETRY. Clear AC. TAD I SYSIO / AC = function code parameter. DCA FUNCWD / Save to FUNCWD. Clear AC. ISZ SYSIO / Move on to the BLOCK parameter. TAD I SYSIO / AC = disk block number to read/write. DCA CBLOCK / Save to CBLOCK. Clear AC. ISZ SYSIO / Move on to the ADDRESS parameter. TAD I SYSIO / AC = memory address to start reading from/ writing to. TAD C200 / AC = memory address + 0200. DCA LNKPTR / Save to LNKPTR. Clear AC. TAD FUNCWD / Reload function code parameter again to AC. RTL / Rotate twice left AC and L. SPA CLA / Skip if AC sign bit is '0'. Clear AC anyhow. STL / Set LINK for indirect return. TAD FUNCWD / Get function word C200, AND C77 / Mask for memory field and function. DCA FUNCWD / Save function word TAD FUNCWD / Save function word AND C70 / Mask with 0070 = 000 000 111 000. / This isolates the memory field. CCDF=7773 TAD CCDF / Add to CDF 0. DCA BUFCDF / Save to BUFCDF. Clear AC. ISZ SYSIO / Move on to the link parameter. TAD SYSIO / Get link parameter SZL / Skip unless indirect return. CLA CMA / Set -1 for indirect return. DCA LINKF / Save link or -1. JMS L7763 / CALL SUBROUTINE at L7763. ISZ SYSIO / Move parameter pointer (subroutine return address) / on to the error address of the caller. TAD I SYSIO / AC = error return content SZL / Skip unless indirect return. DCA SYSIO / Store for indirect return. SETUP, CLA / Seems redundant TAD CBLOCK / Add into AC current block number. AND C37 / And the block number (in AC) with 0037. CLL RTR / Quickly multiply by 128. RTR RTR TAD CBLOCK / Add another to multiply by 129 (block size). IAC / Increment to align sector and protection boundaries. DCA L7763 / Store the result to L7763. Clear AC. SZL / Skip the next instruction if L=0. TAD C40 / Load into 0040 AC. TAD CBLOCK / Get current block number. RAL / Double it. AND C3700 / Get drive bits. TAD FUNCWD / Add in Field and function bits. DIML / Send them to the controller. CLA / Get a clean AC. TAD FUNCWD / Get function AND C6 / Get read/write command TAD L7760 / BUGBUG DCA IOSTRT / BUGBUG TAD N201 / Load AC with the value at address N201 = 7577. DCA WC / Store AC to WC. Clear AC. TAD N201 / Load AC with the value at address N201 = 7577. TAD LNKPTR / Add into AC the value at address LNKPTR. DCA CA / Store the result to CA. Clear AC. TAD L7763 / Load AC with the value at memory address L7763 IOSTRT, DMAW/DMAR / Used for storage from L7652. 6603=READ. 6605=WRITE. DFSC / [DISK INSTRUCTION]. Skip next instruction if either / the error flag is set or the data completion flag / is set. JMP .-1 / Loop back to 'DISK' instruction if READ or WRITE / instruction has not 'finished'... DFSE / Skip the next instruction if no error occurred / (DRL, PER, WLS or NXD errors). / Sense is reversed on the RF08! JMP IOERR / An error occurred. / No error occurred during the disk read or write. ISZ SYSIO / Move parameter pointer to normal return. JMP L7760 / BUGBUG N201, 7577 / Value -201, used to get back to start of buffer. LINKF, 0370 / Indirect return flag 0 / *** APPEARS UNUSED *** WC, . / WORD COUNT (WC) !!!!!!!!!!!!!!!! CA, . / CURRENT ADDRESS (CA) !!!!!!!!!!!!!!!! CBLOCK, 0000 / Current block number. LNKPTR, 0000 / LINK pointer. 0000 / *** APPEARS UNUSED *** 0000 / *** APPEARS UNUSED *** FUNCWD, 0005 / Function word 0000 / *** APPEARS UNUSED *** / Get here from L7742 following an 'OK' disk read or write. L7760, DCMA / [DISK INSTRUCTION]. Clears a load of disk state / registers... Added into AC at instruction L7651. JMS L7763 / Call the subroutine at L7763. JMP I SYSIO / Return from SYSIO subroutine. L7763, 1 / Start of subroutine. TAD I LINKF / BUGBUG DCA CA / Store AC to CURRENT ADDRESS and clear AC. BUFCDF, CDF 0 / Change to caller's Data Field. TAD I LNKPTR / The value indirectly accessed by one of the magic / link fields... DCA WC / Store to WORD COUNT and clear AC. TAD CA / Load AC from CURRENT ADDRESS. DCA I LNKPTR / Store AC indirectly accessed by one of the magic / link fields... CDF 0 / Return back to current field. TAD WC / Load the WORD COUNT into AC. DCA I LINKF / BUGBUG JMP I L7763 / Return from subroutine back to caller... RETRY, -1 1 / Superfluous $