Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.apple2.programmer > #2139

Re: Understanding a little something about bank-switched RAM

From ultramagnus_tcv <mikew@thecomputervalet.com>
Newsgroups comp.sys.apple2.programmer
Subject Re: Understanding a little something about bank-switched RAM
Date 2016-01-17 11:38 -0600
Organization A noiseless patient Spider
Message-ID <n7gjd4$7cc$1@dont-email.me> (permalink)
References <n7f0e9$rk9$1@dont-email.me> <1mh6lw9.wn5g0t17dttg9N%dempson@actrix.gen.nz>

Show all headers | View raw


Hey David,

Thanks for the response!

On 2016-01-17 05:54:49 +0000, David Empson said:

> Your diagram is correct, as far as the built-in 64 KB of memory is
> concerned. (If your //e has an extended 80-column card in the auxiliary
> slot, there is an auxiliary 64 KB bank which has the same pattern as
> main memory. Let's not go there for now.)

Yes, let's not go there for now. ;-) This portion of the book is only 
talking about a stock 64K Apple //e at the moment anyway.

> As far as the 16 KB squeezed into 12 KB at $D000-$FFFF is concerned [...]

Hmmmm... That's interesting. The book requires very careful reading. I 
read through that paragraph seeing 64k total, at which point is begins 
to break up the regions. It calls out the 48k and "the remaining 16k" 
corresponding to "one 8k region" and "two 4k regions." But 8k + 4k = 
12k.

Where's the last 4k?

> I don't recall offhand which is the "default" active bank (e.g. after a
> reset). Software which uses these banks always selects the desired one
> before loading anything into it.

I can't say whether this is definitive, but if I configure an Apple //e 
with no cards in Virtual ][, then read BSRBANK2 ($C011), the output is 
8D.

] CALL -151
* C011

c011- 8D
*
The book says, "If this location is >=$80, then Bank2 of bank-switched 
RAM has been selected; if not, Bank1 has been selected."

So, I guess that means we're in Bank2.

$C012 is 0D meaning that we're reading the ROM.

And if I attempt to switch to reading RAM, the machine crashes. Which 
seems to indicate that when I attempt to read Bank 1 or Bank 2, I 
disconnect the ROM. I suppose this confuses me a bit since I thought I 
am only affecting D000-DFFF which isn't where the monitor lives... ? 
Maybe there are some routines inside D000-DFFF that the monitor depends 
on...?

Perhaps I really shouldn't be trying this from the Monitor. Maybe I'd 
need to write out a proper program that flips switches independent of 
something like the monitor.

Hmmm... If I am currently writing in Bank2 and reading from ROM, what 
would happen if I copied D000-DFFF to D000-DFFF Bank2 and then switch 
to reading RAM...


]CALL -151

*C011

C011 - 8D (INDICATING BANK2 IS ON)
*C012

C012 - 0D (INDICATING READ FROM ROM)

*C081
*C081 (TWICE READ TO WRITE-ENABLE BANK2)

*D000<D000.DFFFM (WHICH SHOULD READ ROM AND COPY TO BANK2)

*C080 (Should keep Bank2 but switch to read RAM (not ROM))

C080- CRASH

Hmmm... maybe when I switch to Bank1, I'm not just switching that 4K 
area but _all_ bank-switchable RAM? I'll try copying the monitor.



]CALL -151

*C011

C011 - 8D (INDICATING BANK2 IS ON)
*C012

C012 - 0D (INDICATING READ FROM ROM)

*D000 (Just to see what's in memory at that location while reading from ROM)

D000 - 6F
*C081
*C081 (TWICE READ TO WRITE-ENABLE BANK2)

*F800<F800.FFFFM (Move Monitor to Bank2)

*C083 (Switch to Read from Bank2 RAM) *No Crash*
*C083 (Write-enable Bank2 RAM)

*C011

C011 - 8D (INDICATING BANK2 IS ON)
*C012

C012 - 8D (INDICATING READ FROM RAM) (!!)

*D000 (Read D000. Is it different from above??)

D000- 00 (It is!)
*D000: a9 00 (Let's try writing something)

*D000L
D000- a9 00 (Works!!)
[...]

*C082 (Read ROM / RO Bank2)

*C011

C011 - 8D (INDICATING BANK2 IS ON)
*C012

C012 - 0D (INDICATING READ FROM ROM)

*D000 (Read D000. Is it back to 6F?)

D000- 6F (It is!)

I think I've learned that when you switch to reading RAM, you're 
actually switching to read all of the regions that are bank-switchable, 
not just D000-DFFF.

I'm tired.

m

Back to comp.sys.apple2.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Understanding a little something about bank-switched RAM ultramagnus_tcv <mikew@thecomputervalet.com> - 2016-01-16 21:08 -0600
  Re: Understanding a little something about bank-switched RAM dempson@actrix.gen.nz (David Empson) - 2016-01-17 18:54 +1300
    Re: Understanding a little something about bank-switched RAM ultramagnus_tcv <mikew@thecomputervalet.com> - 2016-01-17 11:38 -0600
      Re: Understanding a little something about bank-switched RAM ultramagnus_tcv <mikew@thecomputervalet.com> - 2016-01-17 11:39 -0600
      Re: Understanding a little something about bank-switched RAM dempson@actrix.gen.nz (David Empson) - 2016-01-18 09:07 +1300
        Re: Understanding a little something about bank-switched RAM ultramagnus_tcv <mikew@thecomputervalet.com> - 2016-01-17 16:18 -0600
          Re: Understanding a little something about bank-switched RAM dempson@actrix.gen.nz (David Empson) - 2016-01-18 15:42 +1300
            Re: Understanding a little something about bank-switched RAM "Bill Garber" <willy46pa@comcast.net> - 2016-01-17 22:27 -0500
              Re: Understanding a little something about bank-switched RAM ultramagnus_tcv <mikew@thecomputervalet.com> - 2016-01-18 10:53 -0600
            Re: Understanding a little something about bank-switched RAM ultramagnus_tcv <mikew@thecomputervalet.com> - 2016-01-18 10:50 -0600
          Re: Understanding a little something about bank-switched RAM michael.pohoreski@gmail.com - 2016-01-18 09:40 -0800
            Re: Understanding a little something about bank-switched RAM ultramagnus_tcv <mikew@thecomputervalet.com> - 2016-01-18 17:23 -0600
              Re: Understanding a little something about bank-switched RAM michael.pohoreski@gmail.com - 2016-01-19 23:05 -0800
                Re: Understanding a little something about bank-switched RAM ultramagnus_tcv <mikew@thecomputervalet.com> - 2016-01-20 10:06 -0600
  Re: Understanding a little something about bank-switched RAM michael.pohoreski@gmail.com - 2016-01-17 05:09 -0800
    Re: Understanding a little something about bank-switched RAM ultramagnus_tcv <mikew@thecomputervalet.com> - 2016-01-17 18:36 -0600
  Re: Understanding a little something about bank-switched RAM "Bill Garber" <willy46pa@comcast.net> - 2016-01-17 11:45 -0500
    Re: Understanding a little something about bank-switched RAM dempson@actrix.gen.nz (David Empson) - 2016-01-18 09:07 +1300
      Re: Understanding a little something about bank-switched RAM "Bill Garber" <willy46pa@comcast.net> - 2016-01-17 15:33 -0500
      Re: Understanding a little something about bank-switched RAM michael.pohoreski@gmail.com - 2016-01-18 09:30 -0800
        Re: Understanding a little something about bank-switched RAM dempson@actrix.gen.nz (David Empson) - 2016-01-20 18:17 +1300

csiph-web