RSOLinkJump

C Specification


#include <revolution/rso.h>
#include <revolution/RSOLink.h>

int RSOLinkJump(RSOObjectHeader* rsoImp,const RSOObjectHeader* rsoExp,void *buff);

Arguments

rsoImp Pointer to the module information to link.
rsoExp Pointer to the module information to reference.
buff Jump code for the referenced module.

Return Values

Number of processed codes.

Description

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, it is meaningless to use this function if the buffer is in the same main memory as in the referenced module (rsoExp), because there is no need for the relay code.

Differences from RSOLinkFar

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.

See Also

RSO API Introduction
RSOGetJumpCodeSize, RSOMakeJumpCode

Revision History

2006/12/19 Initial version.


CONFIDENTIAL