IMSAI 8080‎ > ‎

IMSAI 8080 page 2 – it's alive

Restoring basic function


I performed basic tests on each card, looking for obvious shorts, damage, and proper voltages delivered by the 7805 regulators. With the CP-A front panel and Z-80 card installed, I connected each data in line on the bus to ground via 100ohm resistors. This causes the processor to execute opcode 00, a "no operation" (NOP). (For reference, I found this idea on the N8VEM board archives). When the Z-80 executes a NOP, the processor runs four cycles, then advances the program counter. It took a while, but scoping the address lines showed that the processor was indeed moving through the addresses.  The machine was stuck in a never-ending run. This was the source of the "flickering" high address LEDs. I further verified that the MOSTEK Z-80 was working by swapping it into an Osborne 1, which booted up fine.

Based on the CP-A schematics, I hunted the problem with my machine stuck in RUN down to the XRDY line. The 7430 at U21 was borked, with no output registering on pin 8. It was stuck sort of high (about 2V), but probably due to the pull up on the Z-80 board (this is a sign that the output was indeed "floating.") The 7430 is an 8-input NAND and pin 8 is the output. Switching U21 with the 74LS30 at U9 (thank you, socketed chips!) brought some functionality back to the front panel: stop / run / examine. There was no deposit, since I hadn't installed a memory board, but deposit next advanced to the next address. Progress! I obtained a replacement 7430 and moved the 74LS30 back.

Next up, I tried to sort out EXAMINE, which wouldn't always go to the correct address. I spent some time tracking the signals on the board with a Saleae logic analyzer and confirmed that EXAMINE sent the proper sequence of C3 LAD HAD (jump) over the data bus to the CPU, but the LAD bit 6 sometimes got stuck high (channel 1 in the image below.) The machine should be jumping to address $0000, but instead it goes to $0040. 



I couldn't find anything wrong with the 8T97 (or 74LS367) open collector buffers from the CP-A. It turns out that several of the front panel switches are pretty sticky and often get stuck high—SA13, SA12, SA6, SA4 in particular. Working these up and down quite a few times has improved their function a bit, but long-term, I will work on refurbishing or replacing these switches. 

Here it is working, executing the "EXAMINE $0000." The front panel sends the jump command: C3 00 00.



Adding memory


I installed the IMS 8K SRAM board. The board uses 2102 SRAM in a configuration of eight 1K banks (CE0-CE7) with each chip corresponding to bits D00-D07. I could deposit and read roughly, but some bits stick high or low. In the 0000-03FF range, bit 7 was stuck low. I did find one bank of 1K (0C00-0FFF, CE3) that worked. I could reliably deposit and examine memory across this range. I switched the D07 - CE0 and CE1 (top row, right-most chips). That got bit 7 working at $0000, so I have a bottom 1K that can be used to toggle in some simple programs. Frankly, toggling in more than a few dozen bytes doesn't sound that appealing.

Below is a program to test the IMSAI inspired by Lawrence Woodman's "Cylon" program. This version is a little shorter (41 bytes), which makes toggling it into the front panel a bit easier (no pun intended.) I chose the slower relative jumps (JR) instead of absolute jumps (JP) to save a few bytes. I actually hand assembled it (fun times!) then checked the machine code with z80asm. This is my first Z-80 assembly program. (Update: had to add a command to set the stack pointer.)

.Z80-Assembler Release 1.7 Page 1
Source file: KITT1_1.asm
Title:       

LOC   OBJECT CODE   LINE   STMT SOURCE CODE
                       1      1 ;==========================================================================
                       2      2 ; K.I.T.T. program for IMSAI
                       3      3 ; Version 1.2
                       4      4 ;   replaced wait loop with DJNZ command (1-byte savings)
                       5      5 ;   added setup of stack pointer
                       6      6 ; z80asm cross-assembler (http://www.autometer.de/unix4fun/z80pack/)
                       7      7 ; z80asm -fb -l -sa KITT1.asm
                       8      8 ; hexdump KITT1.bin
                       9      9 ;==========================================================================
                      10     10 
                      11     11   ORG 0H
                      12     12 
0000  31 FF 01        13     13   LD SP,01FFH   ; put stack at top of page 1
                      14     14 START:
0003  b7              15     15   OR  A         ; clear the carry flag
0004  3e 01           16     16   LD  A,01H
                      17     17 LEFT:
0006  cd 1a 00        18     18   CALL  OUTPUT  ; output A to display
0009  17              19     19   RLA           ; rotate A one bit to left
000a  30 fa           20     20   JR  NC,LEFT   ; if no carry, repeat
000c  b7              21     21   OR  A         ; otherwise, clear carry and
000d  3e 40           22     22   LD  A,40H     ; restart light on second from left
                      23     23 RIGHT:
000f  cd 1a 00        24     24   CALL  OUTPUT
0012  1f              25     25   RRA           ; rotate right one bit
0013  30 fa           26     26   JR  NC,RIGHT  ; if no carry, keep going
0015  b7              27     27   OR  A         ; otherwise, clear carry and
0016  3e 02           28     28   LD  A,02H     ; restart light on second from right
0018  18 ec           29     29   JR  LEFT      ; repeat!
                      30     30 
                      31     31 OUTPUT:
001a  2f              32     32   CPL           ; complement A
001b  d3 ff           33     33   OUT (FFH),A   ; send to port FF
001d  2f              34     34   CPL           ; restore A
001e  08              35     35   EX  AF,AF'    ; temporarily store A
001f  db ff           36     36   IN  A,(FFH)   ; get user input - number of wait loops
                      37     37 WAIT:
0021  06 ff           38     38   LD  B,FFH     ; load our delay
                      39     39 LOOP:
0023  10 fe           40     40   DJNZ LOOP     ; decrease B until zero
0025  3d              41     41   DEC A         ;
0026  20 f9           42     42   JR  NZ,WAIT   ; keep looping
0028  08              43     43   EX  AF,AF'    ; restore A from AF'
0029  c9              44     44   RET

.Z80-Assembler Release 1.7 Page 2
Source file: KITT1_1.asm
Title:       Symboltable

START    0003 LEFT     0006 RIGHT    000f OUTPUT   001a
WAIT     0021 LOOP     0023

It's alive... alive!

Here's a new version that uses a lookup table and 37 bytes. A savings of four bytes! It's more flexible and can display different sequences. Hmmm... toggling between different sequences...

Z80-Assembler         Release 1.7                             Page 1
Source file: KITT2.asm
Title:       

LOC   OBJECT CODE   LINE   STMT SOURCE CODE
                       1      1 ;==========================================================================
                       2      2 ; K.I.T.T.2 program for IMSAI
                       3      3 ; a shorter version using indexed lookup
                       4      4 ; z80asm cross-assembler (http://www.autometer.de/unix4fun/z80pack/)
                       5      5 ;==========================================================================
                       6      6 
                       7      7   ORG 0H
                       8      8 
                       9      9 START:
0000  11 0e 00        10     10   LD DE,14      ; length of lookup table (LUT)
                      11     11 
                      12     12 INNER:
0003  21 17 00        13     13   LD HL,DATA-1  ; get the base address of LUT - 1
0006  19              14     14   ADD HL,DE     ; add length of LUT
0007  7e              15     15   LD  A,(HL)    ; get the byte to output
0008  d3 ff           16     16   OUT (FFH),A   ; send to display
                      17     17 
000a  db ff           18     18   IN  A,(FFH)   ; get user input - number of wait loops
                      19     19 WAIT:
000c  06 ff           20     20   LD  B,FFH     ; load our delay
                      21     21 LOOP:
000e  10 fe           22     22   DJNZ LOOP     ; decrease B until zero
0010  3d              23     23   DEC A         ;
0011  20 f9           24     24   JR  NZ,WAIT   ; keep looping
                      25     25 
0013  1d              26     26   DEC E         ; next byte in table
0014  20 ed           27     27   JR  NZ,INNER
0016  18 e8           28     28   JR  START     ;all displayed, start over
                      29     29 
                      30     30 DATA:
0018  fd fb f7 ef     31     31   DEFB  FDH,FBH,F7H,EFH,BFH,DFH,7FH
001c  bf df 7f        31     32
001f  df bf ef f7     32     33   DEFB  DFH,BFH,EFH,F7H,FBH,FDH,FEH
0023  fb fd fe        32     34

Z80-Assembler         Release 1.7                             Page 2
Source file: KITT2.asm
Title:       Symboltable

DATA     0018   INNER    0003   LOOP     000e   START    0000   
WAIT     000c     



Page listing - "IMSAI 8080 pages"