1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<html> 3 4<head> 5<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> 6<META http-equiv="Content-Style-Type" content="text/css"> 7<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css"> 8<title>RSOLinkJump</title> 9</head> 10 11<body> 12 13<h1>RSOLinkJump</h1> 14 15<h2>Syntax</h2> 16<dl><dd><pre><code> 17#include <revolution/rso.h> 18 19int RSOLinkJump(RSOObjectHeader* rsoImp,const RSOObjectHeader* rsoExp,void *buff); 20</code></pre></dd></dl> 21 22<h2>Arguments</h2> 23<p> 24<TABLE border="1" > 25 <tr> 26<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>rsoImp</EM></STRONG></CODE></TD> 27<TD width="520">Pointer to the module information to link.</TD> 28 </tr> 29 30 <tr> 31<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>rsoExp</EM></STRONG></CODE></TD> 32<TD width="520">Pointer to the module information to reference.</TD> 33 </tr> 34 <tr> 35<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>buff</EM></STRONG></CODE></TD> 36<TD width="520">Jump code for the referenced module.</TD> 37 </tr> 38 39</TABLE> 40</p> 41 42<h2>Return Values</h2> 43<p> 44If linking succeeded, returns the number of codes that were processed.<BR>Returns -1 if linking failed. 45</p> 46 47 48<H2>Description</H2> 49<p> 50Typically, branch instructions (<CODE>bx</CODE>) have only a 28-bit offset (± 32 MB). Therefore, when a dynamic module is placed in external main memory (<CODE>MEM2</CODE>), functions in internal main memory (<CODE>MEM1</CODE>) cannot be accessed.<br>Use <code>RSOLinkJump</code> to link between the two.<br>The <code>LinkJump</code> function in the demo outputs a relay jump code, <SPAN class="argument">buff</SPAN>. The external module is then accessed through this by linking from <SPAN class="argument">rsoImp</SPAN>.<br> <code><a href="./RSOGetJumpCodeSize.html">RSOGetJumpCodeSize</a></code> gets the buffer size needed to create a relay jump code using <code><a href="./RSOMakeJumpCode.html">RSOMakeJumpCode</a></code>.<br><br> <B>Note:</B> Allocate the buffer from the same main memory (<CODE>MEM2</CODE> or <CODE>MEM1</CODE>) as the referencing module (<SPAN class="argument">rsoImp</SPAN>). However, there is no need for the relay code if this is the same memory as the referenced side (<SPAN class="argument">rsoExp</SPAN>).<BR><BR> If this function returns -1, indicating that linking failed, it means that <SPAN class="argument">rsoImp</SPAN> and <SPAN class="argument">buff</SPAN> are separated by ±32MB or more and cannot reach each other with a relative jump. When you allocate memory for <SPAN class="argument">rsoImp</SPAN> and <SPAN class="argument">buff</SPAN>, make sure to locate them within ±32MB of each other. 51</p> 52<H2>Differences from RSOLinkFar</H2> 53<p> 54In the <code><a href="./RSOLinkFar.html">RSOLinkFar</a></code> function, the relay jump code is dependent on the module that is referred to, but <code>RSOLinkJump</code> is dependent on the referring module.<br>This is an effective method when the module being referenced across the memory is known. 55</p> 56<h2>See Also</h2> 57<p> 58<code><a href="./intro.html">RSO API Introduction</a></code><br> 59<code><a href="./RSOGetJumpCodeSize.html">RSOGetJumpCodeSize</a></code> 60<code><a href="./RSOMakeJumpCode.html">RSOMakeJumpCode</a></code> 61</p> 62<H2>Revision History</H2> 63<p> 642008/07/10 Removed <CODE>RSOLink.h</CODE> from <B>Syntax</B>. Added a note indicating when a jump cannot be reached.<BR> 2006/12/19 Initial version.<BR> 65</p> 66 67<hr><p>CONFIDENTIAL</p></body> 68</html> 69