Memory
RAM
The 'COMX 35' is called '35' due to the fact that it has 35 KB RAM. This includes 32 KB user RAM (of which roughly 30 KB is available for BASIC storage) and an additional 3 KB video RAM. For details about the video RAM see the Video Interface System page.
On a ‘clean start’ of the COMX the command PRINT MEM states that 30934 bytes are available which is 1834 Bytes less than 32 KB. The missing bytes are used as follows (see also Memory Map below):
- 1024 bytes for the System Parameter area at @4000-@43FF
- 17 bytes at @4400-@4410 reserved by COMX BASIC
- 256 bytes for stack growth around @BCE7-@BDE6
- 25 bytes of stack used on a clean start at @BDE7-@BDFF
- 512 bytes reserved for DOS at @BE00-@BFFF
DMA & Refresh
Dynamic RAM is refreshed by DMA. A counter is implemented with HW to count the number of CPU execution cycles, my current assumption is that every 5 machine cycles a DMA Out request is generated. This is very frequent but in the emulator it looks like this figure gives the right speed. If anyone has any facts on this please don't hesitate to drop me an email.
DMA Out generates a dummy memory read on the R[0] register location and after that a step of R[0] with 1.
Some games use the R[0] register value as a random generator as the value is stepped from 0 to @FFFF all the time. Except at start-up when R[0] is used as program counter at which stage DMA and Dynamic RAM Refresh is still disabled.
Memory Map
0000 - 3FFF | Build in system ROM |
4000 - 43FF | BASIC System Parameters |
4400 - 4410 | 17 Bytes reserved by COMX BASIC |
4411 - BDFF | BASIC Program and Data storage (top of stack: BDFF) |
BE00 - BFFF | Reserved for DOS |
C000 - DFFF | 8K Interface card expansion ROM |
E000 - EFFF | 4K Expansion box ROM |
F000 - F3FF | Reserved / Not used |
F400 - F7FF | Character Memory Access |
F800 - FFFF | Screen Page Memory Access |