Code: Select all
83E1: 48 PHA ; Save all registers. 83E2: 8A TXA 83E3: 48 PHA 83E4: 98 TYA 83E5: 48 PHA 83E6: A9 84 LDA #84 ; add a new return address that points to the tail of this 83E8: 48 PHA ; subroutine which will pull the registers back off the stack. 83E9: A9 03 LDA #03 83EB: 48 PHA 83EC: A0 05 LDY #05 83EE: BA TSX 83EF: BD 07 01 LDA 0107,X ; grab the return address of our caller and the registers 83F2: 48 PHA ; pushed at the start of this routine and push them back 83F3: 88 DEY ; on the top of the stack. 83F4: D0 F8 BNE 83EE 83F6: A0 0A LDY #0A ; now move the top ten bytes of the stack down two bytes 83F8: BD 09 01 LDA 0109,X ; removing the copy of the address of our immediate caller 83FB: 9D 0B 01 STA 010B,X ; burried the most deeply but leaving the values of the 83FE: CA DEX ; registers pushed at the start of this routine. 83FF: 88 DEY 8400: D0 F6 BNE 83F8 8402: 68 PLA ; as we didn't adjust the stack pointer when we moved the stack 8403: 68 PLA ; down by two bytes, discard two bytes from the top. 8404: 68 PLA ; This bit is executed twice, once as part of the original call 8405: A8 TAY ; and then again when the calling subroutine returns to here. 8406: 68 PLA 8407: AA TAX 8408: 68 PLA 8409: 60 RTS
So looking at Watford DDFS 1.53 the same applies with the routine being at 82D7 and in Opus DDOS 3.45 it can be found at A2EC.
Now clearly this is a generally applicable subroutine, not something specific to floppy discs or even filing systems in general, though it is going to be a bit slow compared to each subroutine pushing and popping registers directly so would seem more applicable for a case where is speed is limited by the floppy disc itself and space is at a premium, but I have never seen it anywhere else. Now if two DFS ROMs had a very similar piece of code to program a command into the 8271 that would not be surprising but this piece of common code suggests there is some link in the history of these DFSes. Possibilities seem to be:
- The other manufacturers signed a source license with Acorn.
- Someone who had worked on the Acorn DFS was hired to work for the others.
- Other manufacterers disassembled the Acorn DFS and copied the bits they liked.