IBM 5160

IMPORTANT:   The following applies to the IBM 5160, not the 5150.

IMPORTANT:   The following is an example.  Depending on your specific situation, you may need to enter in different figures.


I have an IBM 5160.  It has a 256-640KB type motherboard, in which all 4 banks of motherboard RAM are populated, i.e.  640 KB

One day, without me changing anything, I happen to notice that at power on, it no longer counts up to 640K of RAM, but 512K instead.
There is no error indication.

What has happened?

A possibility is a dirty RAM related switch in switch bank SW1 on the motherboard.  I flick switches 3 and 4 on and off a few times, returning them to their original position (for four banks, 3 and 4 both off).  Unfortunately, that was not the problem's cause.
Maybe there has been a failure on the motherboard that results in the POST not reading switches 3 and 4 correctly.  I perform the procedure at here.  Switches 3 and 4 are being read correctly.

Because of the flawed methodology described at here, there is a possibility that there has been a RAM chip failure in the RAM bank that starts at address 512K.

On my 256-640KB motherboard, address 512K corresponds to the third bank, bank 2.

Now, rather than a chip in bank 2 actually failing, maybe what has happened is that a chip in bank 2 has developed a bad connection with its socket.  Accordingly, I re-seat all of the RAM chips in bank 2.  Unfortunately, that was not the problem's cause.

To see if faulty RAM chip/s in bank 2 is the problem cause, some other options now are:
  Option #1:  Put a known good set of nine RAM chips into bank 2.
  Option #2:  Using one known good chip, swap it in turn with each bank 2 chip.  Note that this will not cater for multiple chip failure within the bank.  Option 1 is better.
  Option #3:  Run CheckIt diagnostic software; see below.
  Option #4:  Run DEBUG; see below.
  Option #5:  Type a program into Cassette BASIC; see below.
  Option #6:  Run Ruud's Diagnostic ROM; see below.


OPTION 3:  CheckIt software

Note: To execute, Checkit has a minimum RAM requirement, which may make it unsuitable if the RAM failure is in a low-numbered bank.
         If that is the case for you (Checkit will indicate that there is not enough memory), use option 4 instead (use of DEBUG).


Note: An early version of CheckIt, version 1.1, can run in IBM PC DOS 3.3 on a IBM 5150 fitted with only 256K of RAM.


So, I run CheckIt version 2.1 as follows:

1.  Run CheckIt.
2.  Select the memory test.
3.  Change the range of base memory to be tested to: 512K to 640K  (a start of 512K because that is the start address of bank 2, where I suspect a bad RAM chip is).
4.  Run the test.

After a few minutes, CheckIt reports that the test failed.  It then shows me a test summary.  I arrow down through the summary and see what I show at here.  It reveals bit 2 to be faulty from address 512K (80000 hex) onwards.

So, in my bank 2 (512K-576K), bit 2 is faulty.

By the way, the reason that CheckIt shows an 'A' as well as the '2' is because CheckIt tests using words, not bytes.  You can see in the screenshot that the addresses are incrementing by two.

So, CheckIt's

80000h, Bits .....A.......2..
80002h, Bits .....A.......2..

is the same as

80000h, Bits .....2..
80001h, Bits .....2..
80002h, Bits .....2..
80003h, Bits .....2..


OPTION 4:  DEBUG

Note: Of the RAM chips, the following is for the data ones only. It will not reveal a faulty RAM chip for parity, nor faulty parity circuitry.

What I will do here is use the DEBUG program of DOS to write some test bytes to part of bank 2, read those bytes back, and determine from the bytes read, which bit (or bits) is faulty.

Before doing that, I will temporarily (until next power on) disable the 5160 motherboard from reacting to RAM parity errors.  If I do not do that, a read from bank 2 will result in the motherboard displaying a PARITY CHECK message and then freezing.  Note that RAM diagnostic software does this disabling automatically.

So, I start by running DEBUG.  DEBUG presents a dash ("-") prompt.

I enter the following command (shown in brown), to disable reaction to RAM parity errors:

- o a0 0            (comment: outputting zero to I/O port A0 hex)

Now, I will write FF hex into the first 128 bytes of bank 2.
FF is all bits high (FF hex ---> 11111111 binary).
In the command that follows, the "8000:0" portion is the segment:offset of bank 2.  [my bank 2 is at 512K --> 512K = 524288 decimal = 80000 hex --> 8000:0]

- f 8000:0 80 ff           (comment: "80" is 128 decimal)

Now, I will read back the 128 bytes of FF just written.

Before proceeding, wait 10 seconds.      <--- Important  

- d 8000:0
8000:0000 FF FF FF FF FF FF FF FF-FF FF FF FF FF FF FF FF ................
8000:0010 FF FF FF FF FF FF FF FF-FF FF FF FF FF FF FF FF ................
8000:0020 FF FF FF FF FF FF FF FF-FF FF FF FF FF FF FF FF ................
8000:0030 FF FF FF FF FF FF FF FF-FF FF FF FF FF FF FF FF ................
8000:0040 FF FF FF FF FF FF FF FF-FF FF FF FF FF FF FF FF ................
8000:0050 FF FF FF FF FF FF FF FF-FF FF FF FF FF FF FF FF ................
8000:0060 FF FF FF FF FF FF FF FF-FF FF FF FF FF FF FF FF ................
8000:0070 FF FF FF FF FF FF FF FF-FF FF FF FF FF FF FF FF ................

So, no problem with all ones.
What about all zeroes?
Now, I will write 00 into the first 128 bytes of bank 2.

- f 8000:0 80 00

Now, I will read back the 128 bytes of 00 just written.

Before proceeding, wait 10 seconds.      <--- Important  

- d 8000:0
8000:0000 04 04 04 04 04 04 04 04-04 04 04 04 04 04 04 04 ................
8000:0010 04 04 04 04 04 04 04 04-04 04 04 04 04 04 04 04 ................
8000:0020 04 04 04 04 04 04 04 04-04 04 04 04 04 04 04 04 ................
8000:0030 04 04 04 04 04 04 04 04-04 04 04 04 04 04 04 04 ................
8000:0004 04 04 04 04 04 04 04 40-04 04 04 04 04 04 04 04 ................
8000:0050 04 04 04 04 04 04 04 04-04 04 04 04 04 04 04 04 ................
8000:0060 04 04 04 04 04 04 04 04-04 04 04 04 04 04 04 04 ................
8000:0070 04 04 04 04 04 04 04 04-04 04 04 04 04 04 04 04 ................

Okay; there is a problem.  We are reading back 04 instead of 00.

To establish the bit (or bits) in error, I exclusive OR the byte read with the byte written:  04  XOR  00  =  04
So, the bit (or bits) in error:  04 hex ---> 00000100 binary ---> bit 2

     +---+---+---+---+---+---+---+---+
Bit: | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
     +---+---+---+---+---+---+---+---+
     | 0   0   0   0   0   1   0   0 |
     +-------------------------------+
                           ^
                           |
          bit 2 problem ---+



OPTION 5:  Cassette BASIC

Note: Of the RAM chips, the following is for the data ones only. It will not reveal a faulty RAM chip for parity, nor faulty parity circuitry.

What I will do here is boot the IBM 5160 into Cassette BASIC, and then run a BASIC program that I type in.

STEP 1:  Boot the IBM 5160 into Cassette BASIC.
STEP 2:  Type in the following BASIC code, including the 'run' bit at the end.
STEP 3:  Note the value that gets displayed after the 'run' is typed in.

In the example used on this page, what would be displayed is '04', which like the 04 seen in option #4, would indicate that the bit 2 chip at address 512 KB is faulty.

10 out &hA0,0
20 def seg = &h8000
30 cbep = 0
40 poke 0,&hAA
50 cbep = cbep or (peek(0) xor &hAA)
60 poke 0,&h55
70 cbep = cbep or (peek(0) xor &h55)
80 poke 0,&hFF
90 cbep = cbep or (peek(0) xor &hFF)
100 poke 0,0
110 cbep = cbep or peek(0)
120 print hex$(cbep)
run

FYI: Line 10 will (on an IBM 5150/5160) stop any PARITY CHECK error from 'crashing the party'.

FYI: Line 20 gets BASIC to use a segment of 8000 hex (i.e. use the 512K address as a base). The 0 you see in POKE 0 and PEEK (0) means a zero offset from the segment.

FYI: 'cbep' is a variable used to hold the combined bit error pattern.



OPTION 6:  Ruud's Diagnostic ROM

This is a diagnostic ROM that you put into motherboard IC socket U18, in place of the IBM BIOS ROM.
Requires an MDA or CGA card.
Either you create the ROM yourself if you have the skillset/tools, or someone at here (for a price) could send you a ROM.

In the example used on this page, the diagnostic would report that the bit 2 chip at address 512 KB is faulty.

Ruud's Diagnostic ROM will also report most RAM addressing problems, and will report faulty RAM chips that are used for parity.

More information is at here.