DougIngraham
Veteran Member
I had an idea about combining console and serial disk operations over a single serial port. I wrote some code and posted it in the What did I do to my PDP-8 today thread. It was proposed we spin off a new thread for this topic so here it is. Have at it!
To start it off I will present how multiple entry points for multiple drives or devices have been done and a new approach I thought of to save some code.
This is a paraphrase of the entry decoding in the TCO8:
All of that is just to figure out which entry point was used so it can be mapped to a device. And while self modifying code is a time honored staple of the PDP-8, it generally does not lend clarity to the code. Here is my innovation which I hope to use in the next version of serial disk:
While mine is only a few words shorter, even 1 word difference in a handler is a huge difference. I like to think it is easier to understand as well although I might be biased in this regard. When used with a smart server all you need to do is an RDF to get the callers field and pass that and the value at start to the server. The server can read memory to get the address and put the JMS START instruction back. Although it would be better if the handler code could put the JMS START back in the table as the time spent doing this over a 9600 baud link would be nearly 8 milliseconds. The server would know immediately from the address what that entry point is for. It does not have to be a virtual disk, it could be any kind of device.
I would like to learn more about the DMS handlers. I have always suspected that the OS/8 system handler concept was mostly copied from DMS. Can you suggest a document I can look at?
To start it off I will present how multiple entry points for multiple drives or devices have been done and a new approach I thought of to save some code.
This is a paraphrase of the entry decoding in the TCO8:
Code:
DTA0, VER
DTA1, ISZ DTANO
DTA2, ISZ DTANO
DTA3, ISZ DTANO
DTA4, ISZ DTANO
DTA5, ISZ DTANO
DTA6, ISZ DTANO
DTA7, ISZ DTANO
D400, 400 /EXECUTES AS A HARMLESS AND
CLA CLL
TAD DTANO
CMA
TAD DTATAD /GENERATE "TAD DTAN" WHERE DTAN IS THE ONE THAT
DCA DTANO /WAS CALLED.
CLA CLL CML RTR /AC <- 2000
TAD DTANO /ALSO GENERATE "DCA DTAN" SO WE CAN RESTORE IT
DCA DTADCA
DTANO, 0 /GET CALLING ADDRESS.
DCA DTA /SAVE IT
TAD DTAISZ
DTADCA, 0 /RETRORE ENTRY POINT
DTAISZ, ISZ DTANO /BUMP DTANO FOR VARIOUS GROOVY REASONS
/WHICH WILL BE APPARENT LATER
DTATAD, TAD D400
Code:
UNCALC, -DTA0 /TAD THIS WITH VALUE AT START TO GET THE UNIT NUMBER
DTA0, VER
DTA1, JMS START
DTA2, JMS START
DTA3, JMS START
DTA4, JMS START
DTA5, JMS START
DTA6, JMS START
DTA7, JMS START
FIXUP, JMS START
START, .-. /SUBTRACT THE ADDRESS OF DTA0 FROM THIS TO GET THE UNIT NUMBER
CLA CMA CLL /AC AND LINK ARE IN UNKNOWN STATE UPON ENTRY. WE NEED -1
TAD START /GET ADDRESS OF CALLERS ARGUMENT LIST
DCA ENTADR /SO WE CAN GET THE ARGUMENTS AND REPLACE THE JMS START
CDF 00 /NOW WE CAN INDIRECT TO THIS FIELD
TAD I ENTADR /GET POINTER TO ARGUMENT LIST
DCA ARGADR /SAVE POINTER TO CALLERS ARGUMENTS
TAD FIXUP /PUT THE JMS START BACK IN THE TABLE
DCA I ENTADR
/CODE TO FETCH THE ARGUMENTS GOES HERE
ENTADR, .-. /POINTER TO CALLED ENTRY POINT
ARGADR, .-. /POINTER TO THE CALLERS ARGUMENTS
I would like to learn more about the DMS handlers. I have always suspected that the OS/8 system handler concept was mostly copied from DMS. Can you suggest a document I can look at?