SharedCLibrary_LibInitAPCS_A documentation
Jon Abbott (1421) 2651 posts |
Does anyone have the original documentation for SharedCLibrary_LibInitAPCS_A? There must have been either been a book or a text file that accompanied the very first version of Acorn’s C compiler, which I’ve yet to track down. I’d very much appreciate a copy so I can shim it to SharedCLibrary_LibInitAPCS_32 to get the original Magnetic Scrolls games working on the Pi (Corruption, Jinxter, The Guild of Thieves) EDIT: From disassembling Corruption and CLib 1.01: SharedCLibrary_LibInitAPCS_A / SharedCLibrary_0(SWI &80680)On entry
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. NotesThe stub list pointed to in R0 is terminated by an entry with a library chunk id of –1 -Register conventions
Library kernel functionsChunk 1 is 152 bytes containing 38 entries (APCS-R has 48) they appear to match APCS-R’s, the last being _kernel_fpavailable C Library FunctionsChunk 2 is 672 bytes containing 168 entries (APCS-R has 183), they appear to match APCS-R, the last being __assert |