#include <revolution/rso.h>
#include <revolution/RSOLink.h>
int RSOLinkJump(RSOObjectHeader* rsoImp,const RSOObjectHeader* rsoExp,void *buff);
rsoImp |
Pointer to the module information to link. |
rsoExp |
Pointer to the module information to reference. |
buff |
Jump code for the referenced module. |
Number of processed codes.
Typically, the branch instructions (bx) have only the 28-bit offset (± 32 MB). Therefore, when a dynamic module is placed in external main memory (MEM2), functions in internal main memory (MEM1) cannot be accessed.
Use RSOLinkJump to link between the two.
The LinkJump function in the demo outputs a relay jump code buff. The external module is then accessed through this by linking from rsoImp.
The required buffer size is obtained through RSOGetJumpCodeSize to create a relay jump code, using RSOMakeJumpCode.
Note: Allocate the buffer from the same main memory (MEM2 or MEM1) as the referencing module (rsoImp).
However, there is no need for the relay code if this is the same memory as the referenced module (rsoExp).
Whereas in the RSOLinkFar, the relay jump code is dependent on the module that is referred to, RSOLinkJump is dependent on the referring module.
This is an effective method when the module being referenced across the memory is known.
RSO API Introduction
RSOGetJumpCodeSize RSOMakeJumpCode
12/19/2006 Initial version.
CONFIDENTIAL