Z80 Assembly programming for the Amstrad CPC

The CPC was the 8 bit I grew up with... while slower in some ways than the C64, it had far superior graphical capabilities to the ZX Spectrum, and usually beats the MSX for graphical speed because of it's smaller screen footprint (16k on the CPC to 24k on the MSX) and its CRTC graphics chip is favoured by the modern clever demo authors...

While the budget tape-based 464 machine had 64k, the disk system - the 6128 - has 128k and a disk system... and after market upgrades can give the machine up to 576k

There were two major generations of the CPC, the regular version, and the version released in the 90... the CPC+, which has has hardware sprites, enhanced color
Cpu 3.5mhz Z80 3.5mhz Z80
Ram 64k+ 64k+
Vram 16k 128k
Resolution 4-color 320x200  256x212
Resolution 16-color 160x200
Hardware Sprites none
16 x 16x16 @ 16 color
Sound chip AY AY
Cartridge Rom none 512k
Joystick  UDLR + 3 fire UDLR + 2 fire

AY Sound Chip:
Register Meaning Bit Meaning   Details
0 Tone Pitch L - Channel A LLLLLLLL Lower value = Higher pitch
1 Tone Pitch H - Channel A ----HHHH Lower value = Higher pitch
2 Tone Pitch L - Channel B LLLLLLLL Lower value = Higher pitch
3 Tone Pitch H - Channel B ----HHHH Lower value = Higher pitch
4 Tone Pitch L - Channel C LLLLLLLL Lower value = Higher pitch
5 Tone Pitch H - Channel C ----HHHH Lower value = Higher pitch
6 Noise Generator ---NNNNN Higer = Faster noise
7 Mixer  --NNNTTT   N=Noise T=Tone (Channel --CBACBA 1=mute 0=normal)
8 Amplitude - Channel A ---EVVVV E=Envelope (1=Enabled) VVVV=Volume
9 Amplitude - Channel B ---EVVVV E=Envelope (1=Enabled) VVVV=Volume
10 Amplitude - Channel C ---EVVVV E=Envelope (1=Enabled) VVVV=Volume
11 Envelope L (Volume over time)  LLLLLLLL Lower=Faster Envelope
12 Envelope H (Volume over time)  HHHHHHHH Lower=Faster Envelope
13 Envelope Selection ----EEEE Envelope number (See PDF)
For more details, please see the AY sound chip PDF

Amstrad Links
Winape  - Not just the easiest to use CPC emulator, but the easiest Z80 platform for beginner ASM programmers!
  - A great source of CPC and ASM info.. My cheatsheet ASM list is based on the one from cantrell.org.uk
CRTC - Details of the amstrad CPC CRTC hardware
Amstrad Firmware guide - Pdf documenting the CPC firmware calls
CPC Firmware Guide - Detailed info on how the CPC hardware and firmware
Basic Manual - You'll want to know at least enough basic to do calls and operate the computer
CpcWiki - Web community full of helpful people!

General Z80 Assembly Tutorials:
B. Beginner series - Learn the basics
A. Advanced series - In more detail
M. Multiplatform series - programming methods that work on all systems

Visit www.ChibiAkumas.com to get my games and their source code! | Support me on patreon