The Museum of HP Calculators

HP Forum Archive 13

[ Return to Index | Top of Index ]

HP82973A INT54 driver and HP3421A
Message #1 Posted by Ellis Easley on 25 Sept 2003, 11:49 a.m.

The INT54 document in the Museum FTP site ( has an example program which controls the 3421A. I haven't tried it yet but I studied it and I think it has a couple of errors that could cause problems. First, after the "enter" subroutine has read the voltage reading from the 3421A into the location "buffer", it appends terminator characters to the text using 8086 string move instructions, first "CR/LF" using a word length store string (stosw), and then the "$" terminator required by the DOS call using a byte length instruction (stosb). Because the program does two string move instructions, it is depending on the state of the "direction" flag to be set to "increment" to make sure DI is bumped up two by the stosw so the destination of the stosb will be correct, but the program has not done a "cld" (I remember it as "clear decrement") to make sure this is the case. (If anybody can show me where DOS requires the direction flag to always be set to increment, I would appreciate knowing about it. I had a run-in with this situation a few years ago.) Second, the program allows 32 bytes to be transferred in the "enter" subroutine (I don't think the 3421A would ever send this many bytes) but the space reserved for the location "buffer" is only 32 bytes, so if the program was adapted to an application where more than 29 bytes were transferred, there wouldn't be room for the three terminator characters. Since "buffer" is at the end of the program, you would probably get away with it in an old machine running MSDOS, which would be likely since the board needs a slow ISA bus, but if you were running in virtual mode, this might cause a fault.

Also, there was a discussion about the protocol used by the 3421A to communicate with its option boards. There is a pretty good description in the 3421A Operating, Programming, and Configuration Manual, section II (Option Assembly Installation and Configuration), chapter 9 (44464A Breadboard Option). It says the prototyping Breadboard is logically the same as the 8 bit I/O option board (44465A) but without the isolated receivers and drivers. Data is sent and received from the mainframe serially and the 44464A and 44465A have an 8 bit parallel/serial shift register plus a separate 8 bit latch to implement a an 8 bit I/O port. I haven't seen a description of the logic of the 44462A 10 channel mux option board, but I imagine it is similar with a 10 bit shift register. One interesting item is that the 3421A borrows "red" and "wrt" from the HPL language to use as commands for controlling the 44464A and 44465A.

Re: HP82973A INT54 driver and HP3421A
Message #2 Posted by Philip on 25 Sept 2003, 2:55 p.m.,
in response to message #1 by Ellis Easley

A quick review of the DOS technical manual doesn't seem to indicate a default status of the Direction Flag which implies to me you should not assume the state of the flag and you must explicitly set or clear the Direction Flag based on your need.

Also, thanks for the pointer the INT54 Doc. I'm working on writing a program to control either the 3421 or 3468 using the 82973A (just for fun) using the example in the doc you mentioned.

Re: HP82973A INT54 driver and HP3421A
Message #3 Posted by Ellis Easley on 25 Sept 2003, 5:13 p.m.,
in response to message #2 by Philip

I'm glad I could help! I downloaded that file and printed it out some time ago but I never read the whole thing till now.

Years ago, I worked for Tandy when they built their first AT compatible. I had written a disk drive diagnostic that ran fine on a real AT but hung up every time I ran it on our prototype (which worked fine otherwise, including running DOS). We traced the problem to the fact that the BIOS that Tandy licensed from Phoenix (also at an early revision level) used a series of string moves without clearing the direction flag, and my diagnostic happened to set the flag in a display routine. Somebody tried to argue that maybe DOS expected the flag to be cleared at all times. But they couldn't produce any documentation, and besides we could see where the IBM BIOS used a similar series of string moves and did establish the state of the direction flag first, so Phoenix added it. Presumably, Phoenix used a "cleanroom" system: one group of software engineers studied the IBM BIOS source code (which IBM published) and wrote a specification which was then designed and coded by another group of programmers.

[ Return to Index | Top of Index ]

Go back to the main exhibit hall