Woody Home Page
 
   
AR1688 Z80 Memory Map
  
July 6, 2008
Bill Gates retired a few days ago. On that day when I was playing with my 8-bit toy, I can not help to remember a programming joke about him. It was over 30 years ago, when he and the lucky Paul Allen were building BASIC on an 8-bit CPU, they were told that the memory size they could use had been increased from 4k bytes to 8k bytes. They were happy to know it and also worried about what to do with those extra spaces.
I am 30 years behind Bill Gates, 30 years later, I am still working on 8-bit CPU and worrying about memory spaces calculated in kilobytes.
Z80 has 64k bytes memory space. We are using it in the following way:
0x0000-0x1fff: AR1688 internal SRAM, used to run Z80 program
0x2000-0x3fff: AR1688 internal SRAM, used as Z80 software global var and stack. Global var starts from the bottom and increase, stack starts from the top and decrease. So it is possible that the stack will over flow to wash away global var and make everything unpredictable
0x4000-0x7fff: AR1688 internal SRAM, there are several parts sharing those address spaces. For example, the 96k bytes DSP memory is allocated into 6 parts for Z80 to access on those addresses. And there is an extra part of SRAM used as heap, which is, the memory managed by the malloc/free functions
0x8000-0xffff: Address spaces for external program flash, LCD, network chip RTL8019AS and DM9003. Again 32k is not large enough for all those, so we have different 32k bytes "banks" to access different parts

No comments for this page yet.

More options? Please login or register account. metropolitan-tundra