[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: self test mode



Dennis Jenkins <dennis@usb.com> wrote:

>       One of the recent posts brought up a question that I've had for years:
> When you do a control-closed apple-reset, the machine does a self test.
> Where in the ROM is the code that does this?  I assume that is is
> 'hidden' in the cxxx area, normally switched out.  Where in the f8xx ROM
> space is the code that gets called by the IRQ/NMI/whatever when you
> press those keys?

The normal reset routine is at $FA62.  This does various tasks depending
on the machine.

In the case of the IIe, it jumps to some extended code in the
$C100-$C2FF area which tests the state of the Open Apple and Closed
Apple keys.  If both are released, it returns to the normal (II+ era)
code, which tests the reset check byte at $03F4 to determine whether a
cold or warm start is required.  If Closed Apple is pressed, it jumps to
the self-test code.  If Open Apple is pressed, it forces a cold start
and returns to the normal reset code.

Similar logic applies for the IIc and the IIgs, though the details vary.

The IIc self test code is pretty rudimentary in the original firmware.
A more extensive test was introduced with the "UniDisk" revision of the
IIc firmware, which doubled the size of the ROM (using a bank switch of
the complete ROM between two alternate 16K banks in the $C100-$FFFF
area).

The IIgs self test requires both Command and Option to be pressed, and
it is rather a lot larger than the IIc or IIe test code, using code in
bank $FF rather than the slot ROM space.