⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 c_call.htm

📁 mips架构的bootloader,99左右的版本 但源代码现在没人更新了
💻 HTM
字号:
<title>The call Command</title><h1>call</h1><!--INDEX "call command" "execute subroutine" "argc argv" -->The call command executes a subroutine.<p></dl><h2>Format</h2><dl><dd>The format for the call command is:<p><pre>call adr [-s str|val]..</pre>where:<p><table><tr><td>adr	</td><td>is the address of the subroutine to be executed.</td></tr><tr><td>-s <i>str</i>	</td><td>is a string argument.</td></tr><tr><td><i>val</i>	</td><td>is a value to be passed.</td></tr></table>The call command calls a function using the standard C callingconvention. The "-s <i>str</i>" and <i>val</i> options permit arguments to be passed to the subroutine.<p></dl><h2>Functional Description</h2><dl><dd>The call command executes a downloaded subroutine, using a jalr instructionto pass control to the specified address.This does not affect the existing value of the savedregisters. Instead the subroutine is called directly from C codewithout restoring the saved registers. Control returns to PMONvia the usual subroutine return mechanism. <p>If the user specifies arguments,these are passed using the standard C calling convention. If the"-s" option is specified, the following argument is assumed to bea string. In this case the address of the string is passed to thesubroutine. If a numerical value is specified in place of the "-s",it will be evaluated according to the existing rules and passedto the function. Up to five arguments may be passed.<p>This command is usually used to provide a method of displayingapplication-specific data structures. For example, if your applicationhas a complex, linked-list data structure, you might find it helpfulto add a function to your program that can display the structure. The<i>call</i> command can then be used to invoke this function from thePMON prompt at any time in the execution, even between two single-stepoperations.<p>Examples illustrating the use of the call command follow.<p><pre>PMON> call prstat		Call the function whos name is 'prstat'.PMON> call prrec a0020000+8	Call the function 'prrec' and pass it				the value 0xa0020008 as the first argument.PMON> call printf -s "hello world"				Call the function printf and pass it the				address of the string "hello world".</pre></dl><h2>Files</h2><dl><dd>The call command is located in <a href="../mon/call.c">mon/call.c</a>.</dl><h2>See Also</h2><dl><dd><a href="c_g.htm">g command</a></dl><p><hr><b>Navigation:</b> <a href="index.htm">Document Home</a> | <a href="doctoc.htm">Document Contents</a> | <a href="docindex.htm">Document Index</a> <p>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -