OS-9 Assembly Code Development: Difference between revisions
No edit summary |
|||
Line 6: | Line 6: | ||
== Process Module Structure == | == Process Module Structure == | ||
There are 9 different types of modules in 4 possible languages: | |||
{| class="wikitable" | |||
|+ | |||
! colspan="3" |Module Types | |||
! | |||
! colspan="2" |Language | |||
|- | |||
|'''Code''' | |||
|'''Module Type''' | |||
|'''Name''' | |||
| | |||
|'''Code''' | |||
|'''Language''' | |||
|- | |||
|$1x | |||
|Program Module | |||
|Prgm | |||
| | |||
|$x0 | |||
|Data (non-executable) | |||
|- | |||
|$2x | |||
|Subroutine Module | |||
|Sbrtn | |||
| | |||
|$x1 | |||
|6809 Object Code | |||
|- | |||
|$3x | |||
|Multi-module | |||
|Multi | |||
| | |||
|$x2 | |||
|BASIC09 I-Code | |||
|- | |||
|$4x | |||
|Data Module | |||
|Data | |||
| | |||
|$x3 | |||
|PASCAL I-Code | |||
|- | |||
|$5x-$Bx | |||
|User-definable module | |||
| | |||
| | |||
|$x4-$xF | |||
|Reserved for Future Use | |||
|- | |||
|$Cx | |||
|OS9 System Module | |||
|Systm | |||
| | |||
| | |||
| | |||
|- | |||
|$Dx | |||
|OS9 File Manager Module | |||
|FlMgr | |||
| | |||
| | |||
| | |||
|- | |||
|$Ex | |||
|OS9 Device Driver Module | |||
|Drivr | |||
| | |||
| | |||
| | |||
|- | |||
|$Fx | |||
|OS9 Device Descriptor Module | |||
|Devic | |||
| | |||
| | |||
| | |||
|} | |||
The two most used will be Program Modules and Data Modules. | |||
== Writing Position Independent Code == | |||
== Accessing Variables and Data Structures == | == Accessing Variables and Data Structures == |
Revision as of 14:56, 3 June 2024
Overview
Each process in NitrOS9 is allocated its own 64K address space. When run, the program object code is loaded into one memory space, and the variables and data structures are loaded into the other. This includes separate execution and data directories and std in, std out and std err for each process. In addition, NitrOS9 keeps an separate MMU table (DAT Image) for each process. So it is important to use the OS9 calls F$MapBlk and F$ClrBlk calls to map in memory blocks with the MMU.
When a new process is created, registers U, Y, DP and SP are set with U = start of data area, Y = end of data area, DP = page # of beginning page, SP = end of data area + 1.
Process Module Structure
There are 9 different types of modules in 4 possible languages:
Module Types | Language | ||||
---|---|---|---|---|---|
Code | Module Type | Name | Code | Language | |
$1x | Program Module | Prgm | $x0 | Data (non-executable) | |
$2x | Subroutine Module | Sbrtn | $x1 | 6809 Object Code | |
$3x | Multi-module | Multi | $x2 | BASIC09 I-Code | |
$4x | Data Module | Data | $x3 | PASCAL I-Code | |
$5x-$Bx | User-definable module | $x4-$xF | Reserved for Future Use | ||
$Cx | OS9 System Module | Systm | |||
$Dx | OS9 File Manager Module | FlMgr | |||
$Ex | OS9 Device Driver Module | Drivr | |||
$Fx | OS9 Device Descriptor Module | Devic |
The two most used will be Program Modules and Data Modules.