SP512 RAM expansion

The SP512 is a 512K RAM expansion for the CPC464 made by Vortex GmbH which is is fitted inside the CPC464.

There are 3 connections to the main CPC464 P.C.B.

  1. One connection to the socket where the Z80 CPU is sited,
  2. One connection to the socket where the Gate Array (40007/40010) is sited,
  3. One connection point to a resistor on the main P.C.B,

The SP512 can't be fitted to:

It is not worth the effort trying to connect the SP512 to the above computers when there are alternative RAM expansions available.

Image showing top of SP512 RAM expansion P.C.B.:

[SP512 RAM expansion P.C.B. - top]

In the middle is the socket for the Z80 CPU. Above that socket is the cable and connector which connect to the site of the Z80 CPU on the main P.C.B. To the right are two sockets for different versions of the Gate-Array. Above those sockets is the cable and connector which connect to the site of the Gate-Array on the main P.C.B. Notice the three positions that the lead can be put into. In this picture, the lead is in position 2. Position 1 is obscured by the lead.

Image showing bottom of SP512 RAM expansion P.C.B.:

[SP512 RAM expansion P.C.B. - bottom]

The SP512 has an on-board 16K EPROM which contains B.O.S (Banked Operating System) which is assigned to ROM position 6. This assignment is fixed and the ROM can't be disabled, so if you want to use a ROM board ensure position 6 is not used.

When the computer is turned on the message "BOS 2.1 SP512 (C)1987 vortex GmbH" is displayed followed by a short pause. RSX commands are now available. (Technical Note: B.O.S hooks into 'KL FIND COMMAND' to provide it's commands instead of using the recommended 'KL LOG EXT').

Fitting the SP512

  1. Turn the CPC464 over and remove the screws
  2. Turn the CPC464 over and lift the top from the base. There are two connections from the top to the base. One for the keyboard and one for the cassette sub P.C.B. Remove both of these.
  3. Ensure you have touched something metal to remove static electricity from your body. Touching a water pipe or the pipe into a radiator often does the job.
  4. Carefully remove the Z80 CPU from it's socket. Put it to one side.
  5. Carefully remove the Gate-Array from it's socket.

    There are two versions of the Gate-Array, '40007' and '40010'. These may be marked on the P.C.B. Otherwise this is how you can identify them:

    For the '40007', carefully remove both the Gate-Array and both pieces of metal together. Do not seperate.

    For the '40010', use an I.C. lifting tool or follow the tip below.

    Tip for removing ICs:

    You can remove ICs using a flat head screwdriver. Put the head of the screw driver under the IC at one end of the socket and lever it up gently. Do the same on the other side. Repeat on both sides until the I.C. can be removed from the socket. Be careful not to break any it's feet. If any feet have bent, then carefully straigten them back into position. If any feet have broken then you have to find a replacement IC.

  6. Lay the SP512 P.C.B. flat on a table with a piece of packing material underneath.
  7. Fit the Z80 into the socket on the SP512 P.C.B, align the notch on the Z80 with the notch on the socket. Press firmly into position.
  8. Fit the Gate-Array into the appropiate socket on the SP512 P.C.B, align the notch on the Gate-Array with the notch on the socket. Press firmly into position.

    NOTE:

    There are two sockets that the Gate-Array can fit into.

    Either of these may be fitted to your CPC464 and with some P.C.B. designs there is often space for both. My CPC464 had a 40010 type.

  9. The SP512 has three positions for the connection from the SP512 to the CPC464 P.C.B. The SP512 has been designed so that it can be used with various revisions of the CPC464 P.C.B. I had to adjust this to connect the SP512 to my CPC464.

    To find the appropiate position:

    1. Hold the SP512 P.C.B. above the CPC464 P.C.B, align the connector for the Z80 CPU so it is over the socket for the Z80 on the CPC464 P.C.B.
    2. Make a note of the position of the Gate-Array socket on the CPC464 P.C.B.
    3. Adjust the connector so that it is over the socket for the Gate-Array on the CPC464 P.C.B.
  10. Connect the SP512 to the CPC464 P.C.B. press the connector for the Z80 and the Gate-Array firmly into position.
  11. Hook the end of the lead from the SP512 onto the top of resistor R112 on the CPC464 P.C.B..
  12. On some CPCs there is a rubber or foam block stuck to the bottom of the main P.C.B. You may need to cut this so that the SP512 P.C.B. will be almost horizontal and so that the two pieces of the CPC464 can close together. This can be cut with a pair of scissors. You can put the old piece of the foam/rubber onto the top of the SP512 so that it can be used to stop the underneath of the keyboard from touching the SP512 P.C.B.
  13. Connect the leads between the top of the CPC464 keyboard with the bottom (one for keyboard, one for cassette).
  14. Close the two pieces of the CPC464 together.
  15. Turn it over and fit the screws.
  16. Connect power lead to computer and switch it on.

Removal of the SP512

Removal of the SP512 is almost the reverse of fitting.

  1. Turn the CPC464 over and remove the screws.
  2. Turn the CPC464 over and lift the top from the base. One for the keyboard and one for the cassette sub P.C.B. Remove both of these.
  3. Ensure you have touched something metal to remove static electricity from your body. Touching a water pipe or the pipe into a radiator often does the job.
  4. Carefully disconnect the SP512 from the CPC464 P.C.B. There are three connections.
  5. Lay the SP512 P.C.B. flat on a table with a piece of packing material underneath.
  6. Carefully remove the Z80 CPU from the SP512.
  7. Put the Z80 into the socket marked 'IC111' on the CPC464 P.C.B. aligning the notch on the Z80 with the notch in the socket. Press firmly into position.
  8. Carefully remove the Gate-Array from the SP512:

    There are two versions of the Gate-Array. One is marked '40010', the other has a flat piece of metal stuck to the top of it with white paste, this is the '40007' type. For the 40007, remove both the IC and the metal together. Do not seperate.

  9. Put the Gate-Array into the socket marked 'IC116' on the CPC464 P.C.B. aligning the notch on the Gate-Array with the notch in the socket. Press firmly into position. The position of the Gate-Array may be identified on the P.C.B.
  10. Connect the leads between the top of the CPC464 keyboard with the bottom (one for keyboard, one for cassette).
  11. Close the two pieces of the CPC464 together.
  12. Turn it over and fit the screws.
  13. Connect power lead to computer and switch it on.

SP512 RAM expansion - before and after fitting

This image shows the CPC464 main P.C.B. before the RAM expansion is fitted. From this picture you can see the original locations of the Z80 CPU and the Gate-Array:

[CPC464 P.C.B. before RAM expansion is fitted]

This image shows the CPC464 main P.C.B. after the RAM expansion is fitted. Notice the P.C.B. of the RAM expansion, the new location of the Z80 CPU and Gate-Array:

[CPC464 P.C.B. after RAM expansion is fitted]

B.O.S. commands

The information in this section is incomplete. I do not have a manual for the SP512 so I have discovered these commands and their functions by disassembling B.O.S.

|GET

(Located at &D720 in B.O.S. ROM)

Syntax:

Not known at this time.

|PUT

(Located at &D7F0 in B.O.S. ROM)

Syntax:

Not known at this time.

|RAMREAD

(Located at &C56E in B.O.S. ROM)

Syntax:

Not known at this time.

|RAMWRITE

(Located at &C5E9 in B.O.S. ROM)

Syntax:

Not known at this time.

|GOTO

(Located at &C7F0 in B.O.S. ROM)

Syntax:

Not known at this time.

|GOSUB

(Located at &C7BC in B.O.S. ROM)

Syntax:

Not known at this time.

|RETURN

(Located at &C790 in B.O.S. ROM)

Syntax:

Not known at this time.

|SCREEN.OUT

(Located at &D082 in B.O.S. ROM)

Syntax:

Not known at this time.

|SCREEN.IN

(Located at &D0BB in B.O.S. ROM)

Syntax:

Not known at this time.

|RECORDS

(Located at &C6C7 in B.O.S. ROM)

Syntax:

Not known at this time.

|A

(Located at &C32F in B.O.S. ROM)

Produces an error if disc interface is not connected.

Syntax:

Not known at this time.

|B

(Located at &C32F in B.O.S. ROM)

Produces an error if disc interface is not connected.

Syntax:

Not known at this time.

|FIELD

(Located at &D680 in B.O.S. ROM)

Syntax:

Not known at this time.

|OPEN

(Located at &D572 in B.O.S. ROM)

Syntax:

Not known at this time.

|CLOSE

(Located at &D650 in B.O.S. ROM)

Syntax:

Not known at this time.

|MD

(Located at &C474 in B.O.S. ROM)

Syntax:

Not known at this time.

|PEEK - Read a byte of data from main RAM or SP512 RAM

(Located at &CC43 in B.O.S. ROM)

Syntax:

|PEEK,<RAM bank>,<address>,@<byte>

<RAM bank>: See table below. Range 0-8.
<RAM bank>Description
0Main RAM of CPC464
11st bank of 64K RAM on SP512 RAM expansion
22nd bank of 64K RAM on SP512 RAM expansion
..
..
..
88th bank of 64K RAM on SP512 RAM expansion

<address>:memory address within 64K block. Range 0-65535 (&0000-&ffff)

<byte>: integer variable to receive value of data.

Example

  1. a%=0:|PEEK,0,16384,@a%

    Read the value from address 16384 in the main CPC464 RAM and put result into variable a%.

  2. a%=0:|PEEK,1,16384,@a%

    Read the value from address 16384 in the 1st 64K RAM of the SP512 RAM expansion and put result into variable a%.

|POKE - Write a byte of data to main RAM or SP512 RAM

(Located at &CCE6 in B.O.S. ROM)

Syntax:

|POKE,<RAM bank>,<address>,<byte>

Details:

<RAM bank>: See table below. Range 0-8.
<RAM bank>Description
0Main RAM of CPC464
11st bank of 64K RAM on SP512 RAM expansion
22nd bank of 64K RAM on SP512 RAM expansion
..
..
..
88th bank of 64K RAM on SP512 RAM expansion

<address>:memory address within 64K block. Range 0-65535 (&0000-&ffff)

<byte>: byte to write. Range 0-255 (&00-&FF)

Example:

  1. |POKE,0,16384,255

    Poke 255 to memory address 16384 in main CPC464 memory.

  2. |POKE,1,16384,254

    Poke 254 to memory address 16384 in 1st 64K RAM bank of SP512 RAM expansion.

|CALL

(Located at &CC75 in B.O.S. ROM)

Syntax:

Not known at this time.

|RAMCLOSE

(Located at &C69A in B.O.S. ROM)

Syntax:

Not known at this time.

|RAMFIELD

(Located at &C523 in B.O.S. ROM)

Syntax:

Not known at this time.

|RAMOPEN

(Located at &C483 in B.O.S. ROM)

Syntax:

Not known at this time.

|SAVE

(Located at &D1DA in B.O.S. ROM)

Syntax:

Not known at this time.

|LOAD

(Located at &D2F7 in B.O.S. ROM)

Syntax:

Not known at this time.

|RUN

(Located at &D3B7 in the B.O.S. ROM)

Syntax:

Not known at this time.

|XM - Enter the built in monitor

(Located at &F0C0 in the B.O.S. ROM)

At the '*' prompt you can single character commands, or press ESC to return to BASIC. A command may have 0 or more parameters. Pressing ',' will allow you to enter the next parameter.

Legend:

Values given in angle brackets '<' '>' define parameters that can be entered.

[] surround optional parameters.

Example syntax:

M<start address>[,<end address>]

Command is 'M'.

<start address> is the first parameter and is a 4 digit hexidecimal value. Pressing ENTER at this point will execute the command using the <start address> parameter. But if you press ',' instead of ENTER, then you can enter the the optional <end address> parameter. Pressing ENTER now will execute the command using both the <start address> and <end address> parameter.

B - Set breakpoints

Syntax:

B

Details:

Set the memory address for each of the 8 breakpoints.

Pressing B will show the following:

*B
-B1-    -B2-    -B3-    -B4-    -B5-    -B6-    -B7-    -B8-
0000    0000    0000    0000    0000    0000    0000    0000

The first breakpoint will be selected. You can enter the address of the breakpoint (enter all 4 hexidecimal digits), or press RETURN to keep the current breakpoint and select the next.

Press ESC once at any time to return to the monitor prompt.

Set the breakpoint address to '0000' to disable that breakpoint.

D - Dump memory

Syntax:

D<start address>[,<end address>]

Details:

Display a dump of the memory.

Shows memory bytes and their ASCII equivalent.

You must enter a start memory address, and an optional end memory address.

Each line shows the data for 16 consecutive memory addresses.

The first column shows the memory address. The next 16 columns show the bytes. The last column shows the ASCII for each byte.

F - Find byte

Syntax:

F<start address>,<end address>,<byte>

Details:

Find a byte of data (<byte>) between <start address> and <end address> inclusive. Displays a list of memory addresses where the byte is found.

G

Syntax:

G<address>

Details:

Unknown function at this time.

I - Read file into memory

Syntax:

I<filename>

Details:

Reads the binary file named <filename> into memory at the start address specified in it's header.

NOTE: It is not possible to define where the file is loaded into memory.

O - Write memory data to a file on tape/disc

Syntax:

O<filename>,<start address>,<length>,<execution address>

Details:

Writes the data between <start address> and <end address> inclusive to the file called <filename>. The file is saved as binary and will have the execution address defined as <execution address>. When 'RUN' from BASIC, the file will be loaded to <start address> and executed at <execution address>.

Pressing ESC during the operation will abort the save and return back to the monitor prompt.

L - Dissassemble memory

Syntax:

L<start address>[,<end address>]

Details

Displays a dissassembly listing starting at <start address> and ending at <end address> (if specified). If <end address> is not defined, will show 24 lines of dissassembly.

Pressing ESC once will pause the output, pressing any key will then resume output. Pressing ESC twice during output will return to the monitor prompt.

First column shows memory address. Second column shows Z80 instruction opcodes in hexidecimal. Third column shows mneumonic for Z80 instruction.

Example:

*LF0C0
F0C0  F5        PUSH AF
F0C1  3E02      LD A,&02
F0C3  CD0EBC    CALL &BC0E
F0C6  CDA4F1    CALL &F1A4
.
.
.

S - Modify memory

Syntax:

S<start address>

Details:

Modify data in memory a byte/address at a time.

Example:

*SFF00
FF00     DD  DD
FF01     E5  E6

First column shows memory address. Second column shows original data value, third column shows new value. For each memory address you can press ENTER to leave the byte as it is, or enter the new value (2 hexidecimal digits) and press RETURN to write the modified value to memory. Pressing ESC once will return to the monitor prompt.

P

Details:

Function not known. Enable/Disable output to printer?

T

Syntax:

T<address>[,<count>]

Details:

Unknown function at this time.

R - View/Alter registers

Syntax:

R

Details:

Displays the Z80 register values and allows you to alter them.

Pressing R shows:

*R
-AF-   -BC-    -DE-    -HL-    -IX-    -IY-    -SP-    -XP-
FFFF   FFFF    0000    FFFF    BFFE    7D43    BF7C    FBFF

The first register pair (AF) is selected. You can enter the new value for the register pair by entering a 4 digit hexidecimal value. Pressing ENTER will select the next register pair (BC). Pressing ESC once will return to the monitor prompt.

M - Move memory

Syntax

M<start address<,<length>,<destination address>.

Details

Move the memory data starting at <start address< with length <length> to the address given as <destination address>.

X

Details

Unknown function at this time

Y

Syntax:

Y<byte>

Details

Unknown function at this time.

Z

Syntax:

Z<byte>

Details

Unknown function at this time.

|ROMOFF

(Located at &FEF9 in B.O.S. ROM)

Syntax:

Not known at this time.

|FAST

(Located at &F1A4 in B.O.S. ROM)

Used to speed up drawing of characters in screen mode 2. Doesn't work in screen mode 0 or 1.

Syntax:

Not known at this time.

|SLOW

(Located at &BB51 in B.O.S. ROM)

Restores original method of drawing characters for screen mode 2.

Syntax:

Not known at this time.

|DISBOS

(Located at &C173 in B.O.S. ROM)

Can be used to disable B.O.S.

Syntax:

Not known at this time.

|CPM

(Located at &C2F0 in B.O.S. ROM)

Produces an error if disc interface is not fitted.

Syntax:

Not known at this time.

|DERROR

(Located at &E04B in B.O.S. ROM)

Produces an error if disc interface is not fitted.

Syntax:

Not known at this time.

|ATTRIBUT

(Located at &E23B in B.O.S. ROM)

Produces an error if disc interface is not fitted.

Syntax:

Not known at this time.

|DIR

(Located at &DF46 in B.O.S. ROM)

Produces an error if disc interface is not fitted.

Syntax:

Not known at this time.

|ERA

(Located at &E21C in B.O.S. ROM)

Produces an error if disc interface is not fitted.

Syntax:

Not known at this time.

|FORMAT

(Located at &c348 in B.O.S. ROM)

Syntax:

Not known at this time.

|REN

(Located at &E1C9 in B.O.S. ROM)

Produces an error if disc interface is not fitted.

Syntax:

Not known at this time.

|RESET

(Located at &E1C0 in B.O.S. ROM)

Syntax:

Not known at this time.

|SELECT - Select drive

(Located at &E2E9 in B.O.S. ROM)

Syntax:

Not known at this time.

|USER

(Located at &E2B1 in B.O.S. ROM)

Produces an error if disc interface is not fitted.

Syntax:

Not known at this time.

|DRIVE - Select drive

See |SELECT

|FILES

(Located at &D9DB in B.O.S. ROM)

Syntax:

Not known at this time.

|ID

(Located at &CB43 in B.O.S. ROM)

Syntax:

Not known at this time.

|CONFIG

(Located at &CBDF in B.O.S. ROM)

Syntax:

Not known at this time.

|SPOOL.ON

(Located at &CD5A in B.O.S. ROM)

Re-directs output to printer or a file.

Syntax:

Not known at this time.

|SPOOL.CONT

(Located at &CD53 in B.O.S. ROM)

See |SPOOL.ON

Syntax:

Not known at this time.

|SPOOL.OFF

(Located at &CD4B in B.O.S. ROM)

See |SPOOL.ON

Syntax:

Not known at this time.

|BANK

(Located at &C913 in B.O.S. ROM)

Syntax:

Not known at this time.

|LIST

(Located at &CAC5 in B.O.S. ROM)

Syntax:

Not known at this time.

|COMMON

(Located at &c711 in B.O.S. ROM)

Syntax:

Not known at this time.

|NEW

(Located at &C6F2 in B.O.S. ROM)

Syntax:

Not known at this time.

|DEV

(At &C6E6 in B.O.S. ROM)

Syntax:

Not known at this time.

|VIDEO.ON

(Located at &D02E in B.O.S. ROM)

Syntax:

Not known at this time.

|FORWARD

(Located at &D10C in B.O.S. ROM)

Syntax:

Not known at this time.

|BACKWARD

(Located at &D125 in B.O.S. ROM)

Syntax:

Not known at this time.

|SCREENS

(Located at &CD16 in B.O.S. ROM)

Syntax:

Not known at this time.

|BOS

(Located at &C81D in B.O.S. ROM)

ROM Startup function. Installs RSX commands.

Technical information

This section describes how you can access the RAM of the SP512.

The exact decoding (e.g. complete or partial) of I/O port addresses is not confirmed at this time.

The port addresses given are recommended and are those used by B.O.S..

I/O port &FBBD:

BitFunction
7Unknown
6Unknown (Discology utility uses it - does it choose RAM in 32K blocks instead of 64K blocks??)
5When 1, bits 2..0 define which 64k block of SP512 RAM to select. When 0, chooses internal 64K RAM of CPC464.
4Unknown
3Unknown
2..0Used to choose the 64K block of the SP512 to select

I/O port &7F00:

BitFunction
7Set to 1
61 = make RAM visible in range &8000-&FFFF, 0 = make RAM visible in range &0000-&7FFF
5Set to 1 to activate SP512. If bit 5 of &FBBD is 1 will select SP512 ram, otherwise select RAM of CPC464.
31 = Upper ROM disable, 0 = Upper ROM enable
21 = Lower ROM disable, 0 = lower ROM enable
1,0Screen mode

Notes:

  1. When bit 5 is 0, then bit 6 is ignored.
  2. When reading, ROM has priority over the RAM.

Programs known to use SP512