Showing changes from revision #1 to #2:
Added | Removed | Changed
On entry
Register | Contents | |
---|---|---|
R0 | Pointer to list of stub descriptions each having the following format: | |
Offset | Contents | |
+0 | Library chunk id (1 or 2) | |
+4 | Entry vector base | |
+8 | Entry vector limit | |
+12 | Static data base | |
+16 | Static data limit | |
R1 | Pointer to workspace start | |
R2 | Pointer to workspace limit | |
R3 | –1 | |
R4 | 0 | |
R5 | –1 | |
R6 | Bits 0-15=0, Bits 16-31=Root stack size in KB |
On exit
Entry vectors specified by the stubs descriptions are patched to contain branches to routines in the library.
If R5 > R4 on entry the users statics are copied to the bottom of the workspace specified in R1 and the Client static data offset (at byte offset +24 from the stack base) is initialised.
For each library chunk the library statics are copied either into the workspace specified in R1 if R5 > R4 on entry or to the static data area specified in the chunks stub description if R5 <= R4.
The Library static data offset (at byte offset +20 from the stack base) is initialised.
Space for the root stack chunk is claimed from the workspace specified in R1.
The stub list pointed to in R0 is terminated by an entry with a library chunk id of –1
APCS | Register | APCS | Contents |
---|---|---|---|
APCS-RISCOS | R0 | a1 | Argument 1 |
R1 | a2 | Argument 2 | |
R2 | a3 | Argument 3 | |
R3 | a4 | Argument 4 | |
R4 | v1 | Register variable 1 | |
R5 | v2 | Register variable 2 | |
R6 | v3 | Register variable 3 | |
R7 | v4 | Register variable 4 | |
R8 | v5 | Register variable 5 | |
R9 | v6 | Register variable 6 | |
R10 | sl | Stack Limit / Stack Chunk Handle | |
R11 | fp | Frame pointer | |
R12 | ip | Used as temporary workspace | |
R13 | sp | Stack pointer | |
R14 | lr | Link register | |
R15 | pc | Program counter |
Chunk 1 is 192 bytes containing 48 entries
Statics are 800 bytes
Chunk 2 is 732 bytes containing 183 entries
Statics are 2888 bytes