Author Topic: Few Questions about RAM Programs  (Read 893 times)

0 Members and 1 Guest are viewing this topic.

Offline Alcoholics Anonymous

  • CPC664
  • ***
  • Posts: 51
  • Country: ca
  • Liked: 44
  • Likes Given: 0
Few Questions about RAM Programs
« on: 23:45, 27 January 15 »
I'm a bit of a cpc noob so I apologize for some probably simple questions :)

I'm looking at section 10.3 of the S968 firmware guide from the wiki.  In it, it says that a RAM program begins with memory available from address 0x0040 to 0xb0ff.  I'm a little confused about the difference between the "address of the highest usable byte in memory (0xb0ff)" and the "address of the highest byte in the memory pool (0xabff)".  What is the meaning behind this distinction?  Is there some circumstance where the memory in 0xabff - 0xb0ff is unavailable to the RAM program?

I'm aware that the RAM program is responsible for initializing background ROMs it might use, and for that I should be passing the current values of:

BC = Address of the highest usable byte in memory. (#B0FF)DE = Address of the lowest byte in the memory pool. (#0040)HL = Address of the highest byte in the memory pool. (#ABFF)

which are passed to the RAM program at startup so these background ROMs can shrink that space to reserve static memory for their own purposes.

What I would like to do on startup is ORG the RAM program at 0x0040 and move DE to point at the end of the RAM program's code, bss and data (ie the whole thing).  So what I would be passing to the ROM background programs at initialization would have the lowest byte of  the memory pool appear much higher than normal, probably far outside the lowest 16k of RAM.  I'm wondering if that's a problem -- I'm trying to think of a reason why a particular ROM would want to allocate space at the bottom of the pool rather than the top where it gets IX initialized to point at it automatically?