1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 5 <meta http-equiv="Content-Style-Type" content="text/css" /> 6 <link rel="stylesheet" href="../css/manpage.css" type="text/css" /> 7 <link rel="stylesheet" href="../css/timetable.css" type="text/css" /> 8 <title>callc - Condition call</title> 9 </head> 10 <body> 11 <h1>callc - Condition call</h1> 12 13 <h2>Calling Format</h2> 14 <div class="section"> 15 <pre class="definition"> 16callc status0, status1, mode, label 17</pre> 18 </div> 19 20 <h2>Operands</h2> 21 <div class="section"> 22 <table class="arguments"> 23 <thead> 24 <tr> 25 <th>Name</th> 26 <td>Description</td> 27 </tr> 28 </thead> 29 <tr> 30 <th>status0</th> 31 <td> 32 Value of status register 0 (the value is either 0 or 1).<br> 33 </td> 34 </tr> 35 <tr> 36 <th>status1</th> 37 <td> 38 Value of status register 1 (the value is either 0 or 1).<br> 39 </td> 40 </tr> 41 <tr> 42 <th>mode</th> 43 <td> 44 Conditional mode (0: OR, 1: AND, 2: Only status register 0, 3: Only status register 1)<br> 45 </td> 46 </tr> 47 <tr> 48 <th>label</th> 49 <td> 50 Label name.<br> 51 </td> 52 </tr> 53 </table> 54 </div> 55 56 <h2>Overview</h2> 57 <div class="section"> 58 <p> 59 Calls a function conditionally based on the status register values.<br> The value specified by <SPAN class="argument">status0</SPAN> (or <SPAN class="argument">status1</SPAN>) is tested for equality with the value of status register 0 (or 1). When <SPAN class="argument">mode</SPAN> is 0, the result is true when either status register 0 or status register 1 matches their respective arguments.<br> When <SPAN class="argument">mode</SPAN> is 1, both status registers must match their respective arguments.<br> When <SPAN class="argument">mode</SPAN> is 2, status register 0 must match <SPAN class="argument">status0</SPAN>.<br> When <SPAN class="argument">mode</SPAN> is 3, status register 1 must match <SPAN class="argument">status1</SPAN>.<br> When the specified condition is true, this instruction causes control to jump to the address of the specified label.<br> Once code has been executed up to the <CODE>ret</CODE> instruction following the label address, execution will return to the address immediately after this instruction. You cannot call a label unless a <CODE>ret</CODE> instruction has been set for it.<br> 60 </p> 61 <p class="notice"> 62 You can nest <CODE>call</CODE> instructions (<CODE>call</CODE>, <CODE>callc</CODE>, and <CODE>callb</CODE>) up to four times. Behavior is undefined if these are nested five or more times.<br> Behavior is also undefined when a nested <CODE>call</CODE> instruction is invoked immediately before a <CODE>ret</CODE> instruction.<br> 63 </p> 64 </div> 65 66 <h2>Operation</h2> 67 <div class="section"> 68<pre class="definition"> 69switch ( mode ) 70{ 71 case 0 : 72 if ( status0 == Status_register0 || status1 == Status_register1 ) 73 call label 74 break; 75 case 1 : 76 if ( status0 == Status_register0 && status1 == Status_register1 ) 77 call label 78 break; 79 case 2 : 80 if ( status0 == Status_register0 ) 81 call label 82 break; 83 case 3 : 84 if ( status1 == Status_register1 ) 85 call label 86 break; 87} 88</pre> 89 </div> 90 91 <h2>Code Example</h2> 92 <div class="section"> 93<pre class="definition"> 94callc 1 , 1 , 0 , subfunction0 // Call subfunction0 if either status register 0 or status register 1 is 1 95 96subfunction0: 97.. 98ret 99</pre> 100 </div> 101 102 103 <h2>Revision History</h2> 104 <div class="section"> 105 <dl class="history"> 106 <dt>2011/12/20</dt> 107 <dd>Initial version.<br /> 108 </dd> 109 </dl> 110 </div> 111 112 <hr><p>CONFIDENTIAL</p></body> 113</html>