[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Language Card RAM Question?
- Subject: Re: Language Card RAM Question?
- From: dempson@actrix.gen.nz (David Empson)
- Date: Wed, 10 Jul 2002 00:59:50 +1200
- Newsgroups: comp.sys.apple2
- Organization: TelstraClear
- References: <HP2W8.594270$Gs.38446367@bin5.nnrp.aus1.giganews.com>
- User-agent: MacSOUP/2.4.6
- Xref: archiver1.google.com comp.sys.apple2:21121
Bryan Parkoff <BParkoff@satx.rr.com> wrote:
> I understand that AppleSoft BASIC is stored in $00/D000-$00/F7FF and
> Integer BASIC is stored in $01/E000-$01/F7FF.
Nope.
On an original Apple ][, Integer BASIC is located in ROM at $E000-$F7FF
(strictly speaking, part of the $F000-$F7FF area is support code such as
Sweet 16 and the mini-assembler, which aren't part of Integer BASIC, but
we'll ignore that).
On an Apple ][+, IIe or IIc, Applesoft BASIC is located in ROM at
$D000-$F7FF.
On an Apple IIgs, Applesoft BASIC is located in ROM at
$FF/D000-$FF/F7FF, but the shadowing mechanism also makes it appear in
$00/D000-$00/F7FF, which is where it actually runs.
> They are both on IIe, IIc, and IIgs.
Integer BASIC is not present in the ROM for a ][+, IIe, IIc or IIgs.
The only way you can get Integer BASIC on these machines is to load it
from disk.
If you boot from a DOS 3.3 floppy disk which loads Integer BASIC into
the language card, then it appears in RAM which overlaps the same
address space as Applesoft. Bank-switching is used to access either the
ROM (Applesoft) or language card RAM (Integer) as appropriate.
This is _not_ the same thing as bank 1 of the IIgs (that is the
equivalent of auxiliary memory in an Apple IIe or IIc).
> It is not possible on II/II+ because 6502 microprocessor can only
> handle memory up to 64K.
The same applies to the IIe and IIc. The 65C02 microprocessor can also
only handle memory up to 64K.
If you think about it, a Apple ][+ with 48KB of RAM on the motherboard
and a language card in slot 0 actually has at least 76 KB of memory in
total: 48 KB motherboard RAM plus 12 KB motherboard ROM plus 16 KB of
RAM on the language card.
The CPU is only able to directly address 64 KB at a time, so bank
switching techniques must be used to access the rest.
The language card operates by turning off the motherboard ROM and making
12 KB of its own RAM appear in the same range of addresses
($D000-$FFFF).
The language card actually contains 16 KB of RAM, not 12 KB, and the
extra 4 KB is implemented as a second bank which appears in the
$D000-$DFFF area. This extra bank is not used when you are running
Integer BASIC in the language card, but it is used by Apple II Pascal
and ProDOS.
The IIe, IIc and IIgs have the equivalent of the language card in slot
0, built into the motherboard (there is no physical slot 0 in a IIe or
IIgs).
In addition, the IIe and IIc support a second bank of 64KB of RAM,
called "auxiliary memory" (named after the auxiliary slot in the Apple
IIe). This operates by replacing the entire main 64 KB of RAM with
another 64 KB of RAM (parts of it are bank switched independently of
other parts). The auxiliary 64 KB of RAM also contains a language card
in the $D000-$FFFF area, so in the IIc or a 128K IIe, there are actually
four RAM banks plus one ROM bank in the $D000-$DFFF area, and two RAM
banks plus one ROM bank in the $E000-$FFFF area.
The IIgs emulates this whole mess in its banks $E0 and $E1 (except the
ROM is not addressable in these banks), and shadows the behavior in bank
0 and bank 1. Bank 0 corresponds to main memory of the ][, ][+, IIe or
IIc, and bank 1 corresponds to auxiliary memory of the IIe or IIc.
> I assume that language card has two separate RAMs. Both RAMS points to
> $D000-$F7FF on II/II+. The language card has its own work to swap both RAMs
> when we switch between Integer BASIC and AppleSoft BASIC. What do you
> think?
The language card only has one set of RAM (organised as two banks in
$D000-$DFFF, but that isn't relevant for a discussion of Integer BASIC).
When you use the INT and FP commands in DOS 3.3, all that happens is the
computer accesses an I/O location which causes either the motherboard
ROM or the language card RAM to appear in the $D000-$FFFF area.
Switching between languages doesn't require copying any data - it just
changes the way that the computer's memory is organised, so that you now
have access to a different block of code in the same range of memory
locations.
--
David Empson
dempson@actrix.gen.nz