bartop

palmoswerks ARCHIVE
Palm OS programming tips from a (former) CodeWarrior insider

header

Navigation

Search
Home
About
Stories
Stuff I Like
Articles
PilRC
CodeWarrior
palmos.techwood.org
DevTools List
Palm OS Dev FAQ

Above and Below A5

If you read the map files the CodeWarrior linker produces, there are lines that indicate how much data is above A5, and how much data is below A5. What does this mean, and why is the above/below distinction there?

The Palm OS global data space is a chunk of memory, up to 64K large, with the A5 register pointing into the middle of it. The 64K limit comes from the 68K instruction set; you can only reference memory plus or minus 32K from a register with a single instruction.

Palm OS itself stores a pointer to an application structure in this global data space, and in order to be application data independent, it always stores this structure at A5+0. This means that no other data can overlap this structure, and it causes the global data area to be bisected. This effectivly limits the size of any data item to 32K, since if it was larger it would have to overlap the Palm OS system structure.

To find the total size of your data area, just add the above and below numbers together. This is the size of the chunk that will be allocated out of the global heap by the system when your application starts.

Weblog Disclaimer

After reading Ray Ozzie's weblog comments about employee policies for weblogs and other websites, I've altered the layout for this site slightly. Now, at the bottom of every page is a small disclaimer stating that the opinions on this site are my own, and don't necessarily reflect those of Metrowerks. I hope this had been clear before; I'm just one part of a 500-odd person company owned by a much larger company.

brought to you by weblogger.com


Send feedback to combee@techwood.org
Copyright © 2004 Benjamin L. Combee
Palm OS is a registered trademark of PalmSource, Inc.
Metrowerks and CodeWarrior are registered trademarks of Metrowerks Inc.

The views expressed on this website/weblog are those of mine alone and do not necessarily reflect the views of PalmSource or Metrowerks.

This is a Manila Site

qwertYAK / frobnovich