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>ifc - Start if block by condition</title> 9 </head> 10 <body> 11 <h1>ifc - Start if block by condition</h1> 12 13 <h2>Calling Format</h2> 14 <div class="section"> 15 <pre class="definition"> 16ifc status0, status1, mode 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 </table> 48 </div> 49 50 <h2>Overview</h2> 51 <div class="section"> 52 <p> 53 Runs conditional processing 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 against 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 its respective operand.<br> When <SPAN class="argument">mode</SPAN> is 1, both status registers must match their respective operands.<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 condition is <CODE>true</CODE>, the instructions between <CODE>ifc</CODE> and <CODE>endif</CODE> are executed. If there is an <CODE>else</CODE> instruction between <CODE>ifc</CODE> and <CODE>endif</CODE>, the instructions between <CODE>ifc</CODE> and <CODE>else</CODE> are executed.<br> When the condition is <CODE>false</CODE>, the instructions between <CODE>ifc</CODE> and <CODE>endif</CODE> are skipped and control moves to the instruction immediately after <CODE>endif</CODE>. If there is an <CODE>else</CODE> instruction between <CODE>ifc</CODE> and <CODE>endif</CODE>, the instructions between <CODE>else</CODE> and <CODE>endif</CODE> are executed.<br> This instruction must be followed by an <CODE>endif</CODE> instruction.<br> 54 </p> 55 <p class="notice"> 56 You can nest a combined total of up to eight <CODE>ifb</CODE> and <CODE>ifc</CODE> instructions.<br> 57 </p> 58 <p class="warning"> 59 At least one instruction must be inserted between <CODE>ifc</CODE> and <CODE>endif</CODE> as well as between <CODE>ifc</CODE> and <CODE>else</CODE>.<br> 60 </p> 61 </div> 62 63 <h2>Operation</h2> 64 <div class="section"> 65<pre class="definition"> 66switch ( mode ) 67{ 68 case 0 : 69 if ( status0 == Status_register0 || status1 == Status_register1 ) 70 condition = true 71 break; 72 case 1 : 73 if ( status0 == Status_register0 && status1 == Status_register1 ) 74 condition = true 75 break; 76 case 2 : 77 if ( status0 == Status_register0 ) 78 condition = true 79 break; 80 case 3 : 81 if ( status1 == Status_register1 ) 82 condition = true 83 break; 84} 85if ( condition == true ) 86{ 87 ... 88} 89</pre> 90 </div> 91 92 <h2>Code Example</h2> 93 <div class="section"> 94<pre class="definition"> 95ifc 1, 1, 0 // Executes the instructions between ifc and else when status register 0 or status register 1 is equal to 1 96 ... 97else 98 ... 99endif 100.. 101</pre> 102 </div> 103 104 105 <h2>Revision History</h2> 106 <div class="section"> 107 <dl class="history"> 108 <dt>2011/12/20</dt> 109 <dd>Initial version.<br /> 110 </dd> 111 </dl> 112 </div> 113 114 <hr><p>CONFIDENTIAL</p></body> 115</html>