Home > Previous Page >  96K RAM and AY Module
Archive Search  

96K RAM and AY Module

The 96K RAM and AY Module board designed by Klaudiusz Fatla is a combination of Edwin Blinks 96K RAM and AY-3-8910 sound generator design by Lex Van Sonderen.


The 96K RAM unit at power up is a 48k RAM extension giving the ACE 51K of RAM. You can check your RAM with ;

15384 @ u.

The ACE will respond with 0 meaning you have 51K of RAM. Location 15384 (two bytes) is a system variable which stores the first address past the last address in the RAM. The forth word '@' takes the number off the top of the stack, the address 15384 in this case, and put what it finds at that address and stores it on the top of the stack. Next the 'U.' (unsigned dot) which take to two byes off the stack (twos complement form) to give the correct value, 0 in this case.

Why 0? Well as we have increased the RAM to 51K. So, the first address past the last address in the RAM will be 0 as stored by system variable 15384. 19K RAM pack would return 32768, while a 35K would return 49152.

Paging Memory bank ACE Forth words. First clear the RAMTOP to below 16384:
16383 15384 !

Then type in the following three words of Forth

CODE PAGE0 175 C, 237 C, 79 C, 253 C, 233 C,
CODE PAGE1 62 C, 128 C, 237 C, 79 C, 253 C, 233 C,

Now you will have two new ACE Forth words 'PAGE0' and 'PAGE1'. Which will swap the two 48K pages, the LED will be bright to show which page is currently in use. Just a note that when you swap pages you also swap the return stack that's why we lowered the RAMTOP to below 16384. You could make a Forth word to move the return stack to the PAD swap pages then copy the return stack to the new memory page. One other thing! if you have an ACE Forth word definition which crosses over the 16384 page boundary you will have a crash then swapping pages. A possible solution is the reserve a few bytes of RAM which crosses the page boundaries.


The AY-3-8910 is a 3-voice programmable sound generator (PSG) designed by General Instrument, initially for use with their 16-bit CP1610 and other 8-bit microcomputers. The chip also has two general-purpose 8-bit parallel I/O ports, A and B. Its the same chip that's used in the sound card made by Essex Micro Electronic and also in AMI (more AY-3-8910 details can be found here on the AMI page).

The AY-3-8910/12 sound chip was widely used and can be found in the Amstrad CPC range, ZX Spectrum 128,+2,+3 and MSX etc. The sound chip is controlled be these two ports;

OUT FFFD# 65533d - Select a register 0-14.
IN FFFD# 65533d - Read the value of the selected register.
OUT BFFD# 49149d - Write to the selected register.

AceForth words:

: AS 65533 out ;            ( Select register on Top Of Stack      [AS - Address sound chip] )
: WS 49149 out ;            ( write TOS value to selected register [WS - Write Sound chip]   )

: RS AS 65533 IN . ;        ( Read register on TOS                 [RS - Read sound chip REG])

: SND AS WS ;               ( n1 n2  SND would select reg n1 and write n2 to the register   )

Some example sounds;

: SNDTEST 200 0 SND 254 7 SND  8 8 SND ; ( Makes a continuous sound [via the A channel]     )

: SNDOFF 255 7 SND ;                     ( Turns off all sound on all channels, A,B and C   )

: shot 8 6 SND 247 7 SND 16 8 SND 20 12 SND 1 13 SND ;

: explode 28 6 SND 247 7 SND 16 8 SND 20 12 SND 1 13 SND ;

: ping 200 0 SND 254 7 SND 16 8 SND 20 12 SND 1 13 SND ;

: sea 20 6 SND 247 7 SND 16 8 SND 50 12 SND 10 13 SND ;

AY player demo

Many thanks to Klaudiusz Fatla. Downloads Schematic, BOM, Case stl files and Gerber files.