[Coco] MMU testing utility

Barry Nelson barry.nelson at amobiledevice.com
Fri Sep 22 01:48:21 EDT 2017


From Extended Color BASIC 2.0 you should be able to poke values into the MMU registers and then read the memory and see the results. If you poke in a value that maps into the video display you should be able to see the memory contents on the screen.

http://www.lomont.org/Software/Misc/CoCo/Lomont_CoCoHardware.pdf <http://www.lomont.org/Software/Misc/CoCo/Lomont_CoCoHardware.pdf>

MMU (Memory Management Unit)

The first thing to learn about the GIME is to understand the MMU, and how addresses from the GIME memory space map to the CPU memory space. The MMU is controlled by addresses $FFA0-$FFAF, and more details are under the section on Memory Mapping.

Memory Mapping

This section covers how memory is mapped into the CPU space on the CoCo

The GIME chip can access 512K of memory, yet the 6809 CPU can only access 64K. The barrier is broken by a MMU (Memory Management Unit) that splits the access into 8 blocks visible to the CPU of 8K each.

To use the memory mapping, bit 6 of INIT0 ($FF90) must be set to 1,

There are two possible memory maps, Map 0 and Map 1, selected by bit 0 of the INIT1 ($FF91) register. Setting this bit to 0 enables Map 0 (using the pages stored in $FFA0-$FFA7), and setting this bit to 1 enables Map 1 (using pages in $FFA8-$FFAF).

A memory page is an 8K block in the GIME address space. A 128K system has 128/8=16 blocks, numbered hex $30-$3F. A 512K system has 64 blocks, numbered hex $00-$3F. To place a page in CPU memory for access, write the page number in the appropriate memory select register.

In RAM/ROM mode, the ROM pages ($3C-$3F) can be written to any of the eight available MMU slots. In all cases the last two bits of the page are ignored by the MMU and substituted by the last two bits of the slot number. This might cause some addressing confusion, and should be noted.

A memory page number is a 6-bit value. When reading the memory select registers, be sure to mask off the top two bits, since they can contain garbage.

The memory select registers are registers $FFA0-$FFAF. A write of a page value to the address on the left makes the page visible at the CPU address on the right.

     
Map 0

		Map 1 

$FFA0 -> $0000-$1FFF

$FFA8 -> $0000-$1FFF
$FFA1 -> $2000-$2FFF

$FFA9 -> $2000-$2FFF

$FFA2 -> $4000-$5FFF

$FFAA -> $4000-$5FFF

$FFA3 -> $6000-$7FFF

$FFAB -> $6000-$7FFF

$FFA4 -> $8000-$9FFF

$FFAC -> $8000-$9FFF

$FFA5 -> $A000-$BFFF 

$FFAD -> $A000-$BFFF 

$FFA6 -> $C000-$DFFF 

$FFAE -> $C000-$DFFF 

$FFA7 -> $E000-$FFFF

$FFAF -> $E000-$FFFF

Here are page values for GIME address, default page values on a power up, and default CPU addresses:

 
Page

GIME Address

CPU Address

Standard Page Contents

$00- 2F

00000-$5FFFF

N/A	
512K upgrade RAM, unused by BASIC; not present in 128K or smaller systems 

$30

$60000-$61FFF

N/A	
Hi-Res page #1

$31

$62000-$63FFF

N/A	
Hi-Res page #2

$32

$64000-$65FFF

N/A	
Hi-Res page #3

$33

$66000-$67FFF

N/A	
Hi-Res page #4

$34

$68000-$69FFF

N/A	
HGET/HPUT buffer

$35

$6A000-$6BFFF

N/A	
Secondary Stack

$36

$6C000-$6DFFF

N/A	
Hi-Res text screen RAM

$37              

$6E000-$6FFFF

N/A	Unused by BASIC
$38

$70000-$71FFF

$0000-$1FFF

BASIC memory

$39

$72000-$73FFF

$2000-$3FFF

BASIC memory

$3A

$74000-$75FFF

$4000-$5FFF

BASIC memory

$3B

$76000-$77FFF

$6000-$7FFF

BASIC memory

$3C

$78000-$79FFF

$8000-$9FFF

Extended Basic ROM

$3D

$7A000-$7BFFF

$A000-$BFFF

Color Basic ROM

$3E

$7C000-$7DFFF

$C000-$DFFF

Cartridge or Disk Basic ROM

$3F

$7E000-$7FFFF

$D000-$FFFF

Super Basic, GIME regs, I/O, Interrupts
 


More information about the Coco mailing list