View Single Post
  #11  
Old 02-28-2009, 02:45 AM
philrrtx philrrtx is offline
Junior Member
 
Join Date: Jan 2009
Location: Round Rock, TX
Posts: 11
Thumbs up Instruction set annoyances

I reached the point where I wanted to run a memory test program and discovered two very annoying deficiencies (IMHO) with the 8080 instruction set.

The first annoyance is that the DCX (double register decrement) instruction doesn't set the condition flags based on the outcome of the subtract operation. That makes it less than convenient for use as a 16-bit loop counter. You have to explicitly check to see if both bytes are zero to find out whether you've reached the end of the loop. If the DCX automatically set the condition flags, you could just follow it with a JZ or JNZ to continue or exit the loop. Likewise the INX doesn't set condition flags, but the single register versions (INR/DCR) do. The 8080/8085 programming manual mentioned this as being a feature, but it's hard for me to figure out why they made it that way.

The other annoying thing I found was the behavior of the HLT instruction. I was basically transcoding a memory test I wrote for the PDP-8, where errors lead to halts, and a complete successful pass likewise leads to a halt. The idea is that when the program stops you can see what address it halted at to determine whether it detected an error or was successful. Unfortunately, when the 8080 enters a HLT on the Altair, the address bus gets tri-stated and you can't read the memory address you stopped at. You also can't restart the program without executing a Reset, because Intel made the HLT essentially a "wait for interrupt" instruction. The solution that I resorted to was to replace the HLTs with JMP $. When the program hangs in a tight (very tight) loop, you can at least press Stop and read what address it is looping on to see if you got an error or not.

In any event, my four 4KB synchronous memory cards all pass the test successfully, so it's on to trying to get the Processor Technology 3P+S I/O card working.

Has anyone heard from Grant lately? I sent him e-mail to the address on the web site before I joined the forums, then sent him a PM here, but haven't had a response to either. I'd like to find out what the prospects are of the museum buying a case and dress front panel from him for our box.
Reply With Quote