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

Re: Where Memory Location Starts?



Bryan Parkoff <BParkoff@satx.rr.com> wrote:

> Where Memory Location Starts?
> 
>     I reviewed one of these reference book about the cold reboot after the
> power is turned on.  By the way, cold reboot starts to read at memory
> address: 00/0000.

No, that's not right.

> 00/0000 has one jump routine that it goes to 00/FFFx before the routine
> from 00/FFFx is to check the memory address: 00/03Fx to see if the vector
> is valid.  If it is not valid, it will use cold reboot.
>     Is it the way how it works to start 00/0000 first?

On hardware reset, the 6502 processor uses the vector at FFFC and FFFD
to fetch the address of the reset routine.  (On the IIgs, the vector is
00/FFFC-FFFD.)  The initial reset routine is located deep in the monitor
firmware (FA62 for the IIe, I haven't checked the IIgs recently).

In the original Apple ][ ("old monitor ROM"), the reset vector points to
FA59, which is the cold entry point for the system monitor.  Pressing
the RESET key will always drop into the monitor, from where you can
reinitialize BASIC or manually boot from a desired slot.  There is no
mechanism in this version of the monitor to automatically boot from a
disk.

In the Apple ][+ ("autostart ROM"), the reset routine does some first
stage initialization and then checks the reset vector at 03F2-03F4: if
location 03F4 contains the correct check value (must equal the content
of loation 03F3 exclusive-ORed with the value #$A5) then the reset
routine jumps to the address pointed to be 03F2 and 03F3.  If the check
value is wrong, then it goes to the cold reset routine, which clears the
screen, prints the appropriate "Apple ][" message on the top line, and
starts the slot scan to find a bootable device.

If the "language card" is installed in slot 0 of an Apple ][+ and is
active at the point when the reset occurs, the vector at FFFC-FFFD is
fetched from the RAM on the language card.  This may result in a
different reset sequence, depending on the code that is present in the
card.  For example, the Pascal operating system will reinitialize itself
and return to the main menu.

If you have an Integer/Applesoft ROM card installed in any slot, with
the switch set to "up" position, then a hardware reset will enable the
ROM on the card, so its reset code is used.

The IIe modifies the behaviour slightly.  Firstly, the IIe's built-in
equivalent of the language card ("bank switched memory") is always
disabled by a hardware reset, so the ROM will control the reset
sequence.  (A ROM card in a standard slot can still override this.)
Secondly, the IIe adds support for the Open Apple and Closed Apple keys
(equivalent paddle buttons 0 and 1).  Holding down the Open Apple key
during reset forces a cold start (by forcefully zapping the reset vector
check value at 03F4, causing the subsequent check to fail), and Closed
Apple invokes the machine's self-test.

The IIc and IIgs have similar logic, but the IIgs does a lot more work
at reset time, including invoking reinitialization routines for each
toolset.

-- 
David Empson
dempson@actrix.gen.nz