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>RSOLinkFar</title> 9</head> 10 11<body> 12 13<h1>RSOLinkFar</h1> 14 15<h2>C Specification</h2> 16<dl><dd><pre><code> 17#include <revolution/rso.h> 18#include <revolution/RSOLink.h> 19 20int RSOLinkFar(RSOObjectHeader* rsoImp,const RSOObjectHeader* rsoExp,void *buff); 21</code></pre></dd></dl> 22 23<h2>Arguments</h2> 24<p> 25<TABLE border="1" > 26 <tr> 27<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>rsoImp</EM></STRONG></CODE></TD> 28<TD width="520">Pointer to the module information to link.</TD> 29 </tr> 30 31 <tr> 32<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>rsoExp</EM></STRONG></CODE></TD> 33<TD width="520">Pointer to the module information to reference.</TD> 34 </tr> 35 <tr> 36<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>buff</EM></STRONG></CODE></TD> 37<TD width="520">Area in which to write the added code.</TD> 38 </tr> 39 40</TABLE> 41</p> 42 43<h2>Return Values</h2> 44<p> 45The number of processed codes. 46</p> 47 48 49<H2>Description</H2> 50<p> 51Typically, the 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>RSOLinkFar</code> to link between the two.<br>The <code>LinkFar</code> function in the demo outputs the relay jump code to <code>buff</code>. It enables access from the external module by linking to the code from <CODE>rsoImp</CODE>.<br>Request the necessary buffer size with <code><a href="./RSOGetFarCodeSize.html">RSOGetFarCodeSize</a></code>.<br> <B>Note:</B> Allocate buffer from the same main memory (<CODE>MEM2</CODE> or <CODE>MEM1</CODE>) as the referencing module (<CODE>rsoImp</CODE>). <br>In addition, normally after linking, the code in the module is overwritten. Thus, when using <code><a href="./RSOLinkList.html">RSOLinkListFixed</a></code>, proceed up to <code><a href="./RSOFixedLevel.html">RSO_FL_INTERNAL</a></code> at the release stage. 52</p> 53 54<h2>Differences from RSOLinkJump</h2> 55<p> 56Whereas in <code><a href="./RSOLinkJump.html">RSOLinkJump</a></code>, the relay jump code is dependent on the module that is referred to, <code>RSOLinkFar</code> is dependent on the referring module.<br>This is an effective method when the module referring across memory areas is known. 57</p> 58<h2>See Also</h2> 59<p> 60<code><a href="./intro.html">RSO API Introduction</a></code><br> <code><a href="./RSOGetFarCodeSize.html">RSOGetFarCodeSize</a></code> 61</p> 62<H2>Revision History</H2> 63<p> 642006/12/19 Added an explanation for the difference from RSOLinkJump.<br> 2006/09/25 Initial version. 65</p> 66 67</body> 68</html> 69