Apple II memory expansion card technical reference manual

9 posts / 0 new
Last post
Boletus's picture
Offline
Last seen: 1 day 2 hours ago
Joined: Jan 25 2016 - 13:51
Posts: 67
Apple II memory expansion card technical reference manual

Hello,

 

I'm looking for the above manual, not the owner/user manual that is readily available online.

 

I want to address the I/O registers of the card and I need the I/O reference with an explanation of what does what.

 

Thanks

Luca

Online
Last seen: 1 hour 41 min ago
Joined: Jul 5 2018 - 09:44
Posts: 1558
Are you talking about the

Are you talking about the card that fits in a regular slot that is often called a "Slinky" card?  Provides 256k up to 1MB?

 

Boletus's picture
Offline
Last seen: 1 day 2 hours ago
Joined: Jan 25 2016 - 13:51
Posts: 67
Yes the slinky card

Yes , the slinky card

Boletus's picture
Offline
Last seen: 1 day 2 hours ago
Joined: Jan 25 2016 - 13:51
Posts: 67
What I know

I have basic information about how to index memory in the "slinky card":

there are three memory address registers and one data register in the slinky card that can be accessed at the I/O slot addresses

$C080 + Slot * 16 = ADDRL

$C081 + Slot * 16 = ADDRM

$C082 + Slot * 16 = ADDRH

$C083 + Slot * 16 = DATA

 

To access any byte in the 1Mb card memory region , You write the address in the ADDRH|ADDRM|ADDRL registers and read or write the byte in DATA register.

 

I would like to read the technical manual to know if there are any quirks in using this card .

Thanks

Luca

tokabln's picture
Offline
Last seen: 1 week 4 days ago
Joined: Dec 30 2015 - 10:48
Posts: 249
Maybe the following link will

Maybe the following link(s) will shine some light on what you are looking for:

 

https://archive.org/search?query=Apple+II+memory+expansion+card

 

https://archive.org/details/XREFAppleIIBooksAndNotesAPDA1989

S.Elliott's picture
Offline
Last seen: 5 hours 39 min ago
Joined: Jun 23 2022 - 16:26
Posts: 79
Fun quirk
Boletus wrote:

I would like to read the technical manual to know if there are any quirks in using this card .

 

There is one especially interesting quirk.  It's mentioned in Apple's manuals, but it's novel enough to be worth describing here.

As you may already know, Apple designed the DATA port so that it advances to the next address each time you access it.  That enables software to read contiguous  data by just sequentially reading them from the DATA port, without needing to manually update the ADDR ports.  Or write contiguous data by sequentially writing to the DATA port, without updating the ADDR ports.

But the method of incrementing those three ports includes a subtle quirk:

  • ADDRL increments-by-one after DATA has been accessed
  • ADDRM increments-by-one if the  highest-bit  of ADDRL changes from 1 to 0.
  • ADDRH increments-by-one if the  highest-bit  of ADDRM changes from 1 to 0.

Those last two implementation details can cause subtle bugs if software modifies the contents of just one ADDR port.  For instance, if ADDRL = $81 and a program tries to "go back 2 bytes" by writing ADRRL = $7F, this will cause ADDRM to increment by 1 because it detected the highest-bit of ADDRL changed from 1 to 0.

To avoid such bugs, Apple suggests programmers should always set all 3 ADDR ports when moving to a new address, and set them in the order: ADDRL, then ADDRM, then ADDRH

Boletus's picture
Offline
Last seen: 1 day 2 hours ago
Joined: Jan 25 2016 - 13:51
Posts: 67
S.Elliott wrote:Boletus wrote
S.Elliott wrote:
Boletus wrote:

I would like to read the technical manual to know if there are any quirks in using this card .

 

There is one especially interesting quirk.  It's mentioned in Apple's manuals, but it's novel enough to be worth describing here.

As you may already know, Apple designed the DATA port so that it advances to

 

THANK YOU for the detailed explanation, the only two programming examples I found work like that  and I was about to follow those   but I was lacking the information of why :)

 

I imagine that the DATA register should also be accessed with CPU instructions that do not access twice the memory location to avoid an unwanted double increment of the ADDR registers.

 

I've already seen a similar beaviour, even if not a direct consequence of that, using DEBUG program under APPLE II OS/9 to test the card . DEBUG, always checks that a byte has been really written to memory by reading it back to warn the user of erroneous writes to ROM memory areas, so the ADDR registers are incremented twice.

 

THANK YOU for Your help!

 

Luca

 

 

 

S.Elliott's picture
Offline
Last seen: 5 hours 39 min ago
Joined: Jun 23 2022 - 16:26
Posts: 79
Try the RamFactor documentation for better technical details
Boletus wrote:
I imagine that the DATA register should also be accessed with CPU instructions that do not access twice the memory location to avoid an unwanted double increment of the ADDR registers.

Right.  For the same reason, you don't want to use read-modify-write instructions like INC and DEC.

 Applied Engineering has some good programming tips and workarounds in Chapter 6 of the manual for their RamFactor card, which works just like  Apple's card.

AE RAMFactor v.1.5 manual on Apple2.org

RAMFactor is backward-compatible with the Apple II Memory Expansion Card, so the programming guidelines are similar...but Applied Engineering's documentation is a lot more helpful!  (RAMFactor adds some features that aren't present on the Apple II Memory Expansion Card.)

Boletus's picture
Offline
Last seen: 1 day 2 hours ago
Joined: Jan 25 2016 - 13:51
Posts: 67
S.Elliott wrote:Boletus wrote
S.Elliott wrote:
Boletus wrote:
I imagine that the DATA register should also be accessed with CPU instructions that do not access twice the memory location to avoid an unwanted double increment of the ADDR registers.

Right.  For the same reason, you don't want to use read-modify-write instructions like INC and DEC.

 Applie

 

Oh! I now understand why Mame  emulator uses the same code for both cards , "memexp" and "ramfactor" ..

 

// device type definition

extern const device_type A2BUS_MEMEXP;

extern const device_type A2BUS_RAMFACTOR;

Mame..

 

I'll check the ramfactor docs for sure,

thanks a lot for Your help!!

 

Luca

 

Log in or register to post comments