Editing
SmartBox OS
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Memory == The first 256 bytes of memory are somewhat special, most zero page locations are reserved for use by the OS: {|class="wikitable" |- |&00-&14||General workspace, used to pass parameters to some OS routines, can also be used by other routines DURING their execution. |- |&15-&6F||Reserved |- |&70-&9F||Available to the user |- |&A0||Accumulator store for irqs (irq_A) |- |&A1-&A2||Two byte counter, decremented at 100hz, useful for temporary timing purposes (fcount) |- |&A3||RAM size, high byte of RAM size of machine, ie. for 32k this will be &80 (RAM_size) |- |&A4-&AF||Reserved |- |&B0-&FF||Used by the OS |- |} The rest of memory space is used for the processors stack, OS' buffers, tables, vectors and, of course, the user available memory. A breakdown of the rest of memory: * &100 to &1FF is the 65c02's stack. * &200-&2FF is used by the OS for various system functions and also contains the vector table, more on that later. * &300-&3FF is the serial input buffer. * &400-&47F is the internal job code call output buffer. (jobout_buf) * &480-&4FF is the internal job code call input buffer. (jobin_buf) * &500-&5FF is the job status table. * &600 to the end of RAM memory is for the user. The user should not assume what the top of AVAILABLE memory is and use the system variable HIMEM. In the controller the maximum limit of RAM is &8000 (which is 32k), from &8000-&DFFF lies the memory mapped hardware, from &E000 to &FFF9 lies the OS and from &FFFA to &FFFF lies the 65c02 vectors. So the user has his own limits of free memory. The lowest limit is called LOMEM and the highest limit is called HIMEM, everything between these boundaries is termed "available" for use by anyone, the user or the OS. Anyone can also claim memory, thus making private to them and not allowing anyone else to use it. You do this by altering the value of LOMEM, HIMEM should not be moved. Of course anyone claiming memory should first check that there is enough memory available for the amount they want to claim for. To take a common example, a downloadable routine which installs itself as a extension routine, The download routine will first of all read LOMEM, read HIMEM, check there is enough memory for the routine, download it to LOMEM and call it, the downloaded routine will then relocate itself and alter LOMEM so it is protected. There is one other memory limit, this is called TOPMEM, this is the absolute top limit of RAM, HIMEM will normally equal TOPMEM, but a future OS may alter HIMEM to below TOPMEM. TOPMEM should be ignored ideally, and HIMEM used.
Summary:
Please note that all contributions to Smart Box may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Smart Box:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
British English
Views
Read
Edit
View history
More
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information