ZealOS/docs/Compiler/AsmInit.CC.html
TomAwezome 1b75d91002 Fix Mount AHCI Port selection.
Add arg to SATARep to specify drive types to show.
Add checks in AHCIPortInit to verify port signatures, add helper method to get signatures from port.
2021-08-02 16:40:05 -04:00

258 lines
31 KiB
HTML
Executable file

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=US-ASCII">
<meta name="generator" content="ZealOS V0.13">
<style type="text/css">
body {background-color:#fef1f0;}
.cF0{color:#000000;background-color:#fef1f0;}
.cF1{color:#0148a4;background-color:#fef1f0;}
.cF2{color:#3b7901;background-color:#fef1f0;}
.cF3{color:#057c7e;background-color:#fef1f0;}
.cF4{color:#bb2020;background-color:#fef1f0;}
.cF5{color:#9e42ae;background-color:#fef1f0;}
.cF6{color:#b57901;background-color:#fef1f0;}
.cF7{color:#b2b6af;background-color:#fef1f0;}
.cF8{color:#555753;background-color:#fef1f0;}
.cF9{color:#678fbb;background-color:#fef1f0;}
.cFA{color:#82bc49;background-color:#fef1f0;}
.cFB{color:#0097a2;background-color:#fef1f0;}
.cFC{color:#e26a6a;background-color:#fef1f0;}
.cFD{color:#c671bc;background-color:#fef1f0;}
.cFE{color:#c7ab00;background-color:#fef1f0;}
.cFF{color:#fef1f0;background-color:#fef1f0;}
</style>
</head>
<body>
<pre style="font-family:monospace;font-size:12pt">
<a name="l1"></a><span class=cF1>U0</span><span class=cF0> </span><span class=cFD>AsmParseInsFlags</span><span class=cF0>(</span><span class=cF9>CCompCtrl</span><span class=cF0> *cc, </span><span class=cF9>CInst</span><span class=cF0> *tmpins)
<a name="l2"></a>{
<a name="l3"></a> </span><span class=cF9>I64</span><span class=cF0> i;
<a name="l4"></a>
<a name="l5"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF3>TRUE</span><span class=cF0>)
<a name="l6"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l7"></a> </span><span class=cF1>switch</span><span class=cF0> (cc-&gt;token)
<a name="l8"></a> {
<a name="l9"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>TK_IDENT</span><span class=cF0>:
<a name="l10"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>i = </span><span class=cF5>ListMatch</span><span class=cF0>(cc-&gt;cur_str, </span><span class=cF6>&quot;NO\0CB\0CW\0CD\0CP\0IB\0IW\0ID\0&quot;</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0> &gt;= </span><span class=cFE>0</span><span class=cF0>)
<a name="l11"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l12"></a> tmpins-&gt;opcode_modifier = i;
<a name="l13"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l14"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l15"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l16"></a> </span><span class=cF1>return</span><span class=cF0>;
<a name="l17"></a>
<a name="l18"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>TK_I64</span><span class=cF0>:
<a name="l19"></a> </span><span class=cF1>if</span><span class=cF0> (cc-&gt;cur_i64 == </span><span class=cFE>16</span><span class=cF0>)
<a name="l20"></a> tmpins-&gt;flags |= </span><span class=cF3>IEF_OP_SIZE16</span><span class=cF0>;
<a name="l21"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (cc-&gt;cur_i64 == </span><span class=cFE>32</span><span class=cF0>)
<a name="l22"></a> tmpins-&gt;flags |= </span><span class=cF3>IEF_OP_SIZE32</span><span class=cF0>;
<a name="l23"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l24"></a> </span><span class=cF1>return</span><span class=cF0>;
<a name="l25"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l26"></a>
<a name="l27"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'+'</span><span class=cF0>:
<a name="l28"></a> tmpins-&gt;flags |= </span><span class=cF3>IEF_PLUS_OPCODE</span><span class=cF0>;
<a name="l29"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'/'</span><span class=cF0>:
<a name="l30"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Lex</span><span class=cF7>(</span><span class=cF0>cc</span><span class=cF7>)</span><span class=cF0> == </span><span class=cF3>TK_I64</span><span class=cF0> &amp;&amp; cc-&gt;cur_i64 &lt; </span><span class=cFE>8</span><span class=cF0>)
<a name="l31"></a> tmpins-&gt;slash_val = cc-&gt;cur_i64;
<a name="l32"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (cc-&gt;token == </span><span class=cF3>TK_IDENT</span><span class=cF0>)
<a name="l33"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l34"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>StrCompare</span><span class=cF7>(</span><span class=cF0>cc-&gt;cur_str, </span><span class=cF6>&quot;R&quot;</span><span class=cF7>)</span><span class=cF0>)
<a name="l35"></a> tmpins-&gt;slash_val = </span><span class=cF3>SV_R_REG</span><span class=cF0>;
<a name="l36"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>StrCompare</span><span class=cF7>(</span><span class=cF0>cc-&gt;cur_str, </span><span class=cF6>&quot;I&quot;</span><span class=cF7>)</span><span class=cF0>)
<a name="l37"></a> tmpins-&gt;slash_val = </span><span class=cF3>SV_I_REG</span><span class=cF0>;
<a name="l38"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l39"></a> </span><span class=cF1>return</span><span class=cF0>;
<a name="l40"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l41"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l42"></a> </span><span class=cF1>return</span><span class=cF0>;
<a name="l43"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l44"></a>
<a name="l45"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'!'</span><span class=cF0>: tmpins-&gt;flags |= </span><span class=cF3>IEF_DONT_SWITCH_MODES</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
<a name="l46"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'&amp;'</span><span class=cF0>: tmpins-&gt;flags |= </span><span class=cF3>IEF_DEFAULT</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
<a name="l47"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'%'</span><span class=cF0>: tmpins-&gt;flags |= </span><span class=cF3>IEF_NOT_IN_64_BIT</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
<a name="l48"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'='</span><span class=cF0>: tmpins-&gt;flags |= </span><span class=cF3>IEF_48_REX</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
<a name="l49"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'`'</span><span class=cF0>: tmpins-&gt;flags |= </span><span class=cF3>IEF_REX_ONLY_R8_R15</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
<a name="l50"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'^'</span><span class=cF0>: tmpins-&gt;flags |= </span><span class=cF3>IEF_REX_XOR_LIKE</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
<a name="l51"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'*'</span><span class=cF0>: tmpins-&gt;flags |= </span><span class=cF3>IEF_STI_LIKE</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
<a name="l52"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'$'</span><span class=cF0>: tmpins-&gt;flags |= </span><span class=cF3>IEF_ENDING_ZERO</span><span class=cF0>; </span><span class=cF1>break</span><span class=cF0>;
<a name="l53"></a>
<a name="l54"></a> </span><span class=cF1>default</span><span class=cF0>:
<a name="l55"></a> </span><span class=cF1>return</span><span class=cF0>;
<a name="l56"></a> }
<a name="l57"></a> </span><span class=cF5>Lex</span><span class=cF0>(cc);
<a name="l58"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l59"></a>}
<a name="l60"></a>
<a name="l61"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cFD>AsmHashLoad</span><span class=cF0>()
<a name="l62"></a>{</span><span class=cF2>//See </span><a href="https://zeal-operating-system.github.io/ZealOS/Compiler/OpCodes.DD.html#l1"><span class=cF4>::/Compiler/OpCodes.DD</span></a><span class=cF2>.</span><span class=cF0>
<a name="l63"></a> </span><span class=cF9>I64</span><span class=cF0> i, j, size, size_max;
<a name="l64"></a> CInternalType *tmpit;
<a name="l65"></a> </span><span class=cF9>CCompCtrl</span><span class=cF0> *cc;
<a name="l66"></a> </span><span class=cF9>CHashGeneric</span><span class=cF0> *tmph;
<a name="l67"></a> </span><span class=cF9>CHashReg</span><span class=cF0> *tmpr;
<a name="l68"></a> </span><span class=cF9>CHashOpcode</span><span class=cF0> *tmpo, *tmpo2, *tmpo_max;
<a name="l69"></a> </span><span class=cF9>CInst</span><span class=cF0> *tmpins;
<a name="l70"></a> </span><span class=cF9>CHashClass</span><span class=cF0> *tmpc;
<a name="l71"></a>
<a name="l72"></a> </span><span class=cFB>cmp</span><span class=cF0>.size_arg_mask[</span><span class=cFE>0</span><span class=cF0>] = </span><span class=cFE>0x3FF0FFFFFE</span><span class=cF0>;
<a name="l73"></a> </span><span class=cFB>cmp</span><span class=cF0>.size_arg_mask[</span><span class=cFE>1</span><span class=cF0>] = </span><span class=cFE>0x1110111112</span><span class=cF0>;
<a name="l74"></a> </span><span class=cFB>cmp</span><span class=cF0>.size_arg_mask[</span><span class=cFE>2</span><span class=cF0>] = </span><span class=cFE>0x2220222224</span><span class=cF0>;
<a name="l75"></a> </span><span class=cFB>cmp</span><span class=cF0>.size_arg_mask[</span><span class=cFE>4</span><span class=cF0>] = </span><span class=cFE>0x0440444448</span><span class=cF0>;
<a name="l76"></a> </span><span class=cFB>cmp</span><span class=cF0>.size_arg_mask[</span><span class=cFE>8</span><span class=cF0>] = </span><span class=cFE>0x0880888880</span><span class=cF0>;
<a name="l77"></a>
<a name="l78"></a> </span><span class=cFB>cmp</span><span class=cF0>.asm_hash = </span><span class=cF5>HashTableNew</span><span class=cF0>(</span><span class=cFE>1024</span><span class=cF0>);
<a name="l79"></a> size_max = </span><span class=cF1>offset</span><span class=cF0>(</span><span class=cF9>CHashOpcode</span><span class=cF0>.ins) + </span><span class=cF1>sizeof</span><span class=cF0>(</span><span class=cF9>CInst</span><span class=cF0>) &lt;&lt; </span><span class=cFE>5</span><span class=cF0>;
<a name="l80"></a> tmpo_max = </span><span class=cF5>MAlloc</span><span class=cF0>(size_max);
<a name="l81"></a>
<a name="l82"></a> cc = </span><span class=cF5>CompCtrlNew</span><span class=cF0>(</span><span class=cF5>FileRead</span><span class=cF7>(</span><span class=cF6>&quot;OpCodes.DD&quot;</span><span class=cF7>)</span><span class=cF0>,, </span><span class=cF6>&quot;OpCodes.DD&quot;</span><span class=cF0>);
<a name="l83"></a> cc-&gt;htc.hash_table_list = </span><span class=cF3>NULL</span><span class=cF0>;
<a name="l84"></a> </span><span class=cF5>Lex</span><span class=cF0>(cc);
<a name="l85"></a> </span><span class=cF1>while</span><span class=cF0> (cc-&gt;token)
<a name="l86"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l87"></a> </span><span class=cF1>if</span><span class=cF0> (cc-&gt;token != </span><span class=cF3>TK_IDENT</span><span class=cF0>)
<a name="l88"></a> </span><span class=cF5>LexExcept</span><span class=cF0>(cc, </span><span class=cF6>&quot;Expecting identifier at &quot;</span><span class=cF0>);
<a name="l89"></a> i = </span><span class=cF5>ListMatch</span><span class=cF0>(cc-&gt;cur_str, </span><span class=cF6>&quot;NONE\0R8\0R16\0R32\0R64\0SEG\0FSTACK\0MM\0XMM\0OPCODE\0KEYWORD\0ASM_KEYWORD\0&quot;</span><span class=cF0>);
<a name="l90"></a> </span><span class=cF1>if</span><span class=cF0> (i &lt;= </span><span class=cFE>0</span><span class=cF0>)
<a name="l91"></a> </span><span class=cF5>LexExcept</span><span class=cF0>(cc, </span><span class=cF6>&quot;Unknown Statement&quot;</span><span class=cF0>);
<a name="l92"></a> </span><span class=cF5>Lex</span><span class=cF0>(cc); </span><span class=cF2>//skip keyword</span><span class=cF0>
<a name="l93"></a> </span><span class=cF1>if</span><span class=cF0> (cc-&gt;token != </span><span class=cF3>TK_IDENT</span><span class=cF0>)
<a name="l94"></a> </span><span class=cF5>LexExcept</span><span class=cF0>(cc, </span><span class=cF6>&quot;Expecting identifier at &quot;</span><span class=cF0>);
<a name="l95"></a> </span><span class=cF1>switch</span><span class=cF0> (i)
<a name="l96"></a> {
<a name="l97"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>REGT_R8</span><span class=cF0>...</span><span class=cF3>REGT_XMM</span><span class=cF0>:
<a name="l98"></a> tmpr = </span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CHashReg</span><span class=cF7>)</span><span class=cF0>);
<a name="l99"></a> tmpr-&gt;str = cc-&gt;cur_str;
<a name="l100"></a> cc-&gt;cur_str = </span><span class=cF3>NULL</span><span class=cF0>;
<a name="l101"></a> </span><span class=cF5>Lex</span><span class=cF0>(cc); </span><span class=cF2>//skip keyword name</span><span class=cF0>
<a name="l102"></a> </span><span class=cF1>if</span><span class=cF0> (cc-&gt;token != </span><span class=cF3>TK_I64</span><span class=cF0>)
<a name="l103"></a> </span><span class=cF5>LexExcept</span><span class=cF0>(cc, </span><span class=cF6>&quot;Expecting int at &quot;</span><span class=cF0>);
<a name="l104"></a> tmpr-&gt;type = </span><span class=cF3>HTT_REG</span><span class=cF0>;
<a name="l105"></a> tmpr-&gt;reg_type = i;
<a name="l106"></a> tmpr-&gt;reg_num = cc-&gt;cur_i64;
<a name="l107"></a> </span><span class=cF5>HashAdd</span><span class=cF0>(tmpr, </span><span class=cFB>cmp</span><span class=cF0>.asm_hash);
<a name="l108"></a> </span><span class=cF5>Lex</span><span class=cF0>(cc); </span><span class=cF2>//Skip INT</span><span class=cF0>
<a name="l109"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l110"></a>
<a name="l111"></a> </span><span class=cF1>case</span><span class=cF0>: </span><span class=cF2>//OPCODE</span><span class=cF0>
<a name="l112"></a> </span><span class=cF1>if</span><span class=cF0> (cc-&gt;token != </span><span class=cF3>TK_IDENT</span><span class=cF0>)
<a name="l113"></a> </span><span class=cF5>LexExcept</span><span class=cF0>(cc, </span><span class=cF6>&quot;Expecting opcode at &quot;</span><span class=cF0>);
<a name="l114"></a> </span><span class=cF5>MemSet</span><span class=cF0>(tmpo_max, </span><span class=cFE>0</span><span class=cF0>, size_max);
<a name="l115"></a> tmpo_max-&gt;type = </span><span class=cF3>HTT_OPCODE</span><span class=cF0>;
<a name="l116"></a> tmpo_max-&gt;inst_entry_count = </span><span class=cFE>0</span><span class=cF0>;
<a name="l117"></a> tmpo_max-&gt;str = cc-&gt;cur_str;
<a name="l118"></a> cc-&gt;cur_str = </span><span class=cFE>0</span><span class=cF0>;
<a name="l119"></a> </span><span class=cF5>Lex</span><span class=cF0>(cc); </span><span class=cF2>//Skip OPCODE</span><span class=cF0>
<a name="l120"></a> </span><span class=cF1>while</span><span class=cF0> (cc-&gt;token &amp;&amp; cc-&gt;token != </span><span class=cF6>';'</span><span class=cF0> &amp;&amp; cc-&gt;token != </span><span class=cF6>':'</span><span class=cF0>)
<a name="l121"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l122"></a> tmpins = &amp;tmpo_max-&gt;ins[tmpo_max-&gt;inst_entry_count];
<a name="l123"></a> tmpins-&gt;ins_entry_num = tmpo_max-&gt;inst_entry_count++;
<a name="l124"></a> tmpins-&gt;slash_val = </span><span class=cF3>SV_NONE</span><span class=cF0>; </span><span class=cF2>//Not zero!!</span><span class=cF0>
<a name="l125"></a> </span><span class=cF1>while</span><span class=cF0> (cc-&gt;token == </span><span class=cF3>TK_I64</span><span class=cF0>) {
<a name="l126"></a> tmpins-&gt;opcode[tmpins-&gt;opcode_count++] = cc-&gt;cur_i64;
<a name="l127"></a> </span><span class=cF5>Lex</span><span class=cF0>(cc);
<a name="l128"></a> }
<a name="l129"></a> </span><span class=cF1>if</span><span class=cF0> (cc-&gt;token == </span><span class=cF6>','</span><span class=cF0>)
<a name="l130"></a> </span><span class=cF5>Lex</span><span class=cF0>(cc);
<a name="l131"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (cc-&gt;token != </span><span class=cF6>';'</span><span class=cF0>)
<a name="l132"></a> </span><span class=cF5>LexExcept</span><span class=cF0>(cc, </span><span class=cF6>&quot;Expecting ',' at &quot;</span><span class=cF0>);
<a name="l133"></a>
<a name="l134"></a> </span><span class=cFD>AsmParseInsFlags</span><span class=cF0>(cc, tmpins);
<a name="l135"></a>
<a name="l136"></a> tmpins-&gt;uasm_slash_val = tmpins-&gt;slash_val;
<a name="l137"></a> </span><span class=cF1>if</span><span class=cF0> (tmpins-&gt;flags &amp; </span><span class=cF3>IEF_STI_LIKE</span><span class=cF0> &amp;&amp; tmpins-&gt;slash_val != </span><span class=cF3>SV_I_REG</span><span class=cF0>)
<a name="l138"></a> tmpins-&gt;uasm_slash_val = </span><span class=cF3>SV_STI_LIKE</span><span class=cF0>;
<a name="l139"></a>
<a name="l140"></a> tmpins-&gt;arg1 = tmpins-&gt;arg2 = tmpins-&gt;size1 = tmpins-&gt;size2 = </span><span class=cFE>0</span><span class=cF0>;
<a name="l141"></a> </span><span class=cF1>if</span><span class=cF0> (cc-&gt;token == </span><span class=cF3>TK_IDENT</span><span class=cF0>)
<a name="l142"></a> {
<a name="l143"></a> j = </span><span class=cF5>DefineMatch</span><span class=cF0>(cc-&gt;cur_str, </span><span class=cF6>&quot;ST_ARG_TYPES&quot;</span><span class=cF0>);
<a name="l144"></a> tmpins-&gt;arg1 = j;
<a name="l145"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;</span><span class=cFB>cmp</span><span class=cF0>.size_arg_mask[</span><span class=cFE>1</span><span class=cF0>], j</span><span class=cF7>)</span><span class=cF0>)
<a name="l146"></a> tmpins-&gt;size1 = </span><span class=cFE>8</span><span class=cF0>;
<a name="l147"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;</span><span class=cFB>cmp</span><span class=cF0>.size_arg_mask[</span><span class=cFE>2</span><span class=cF0>], j</span><span class=cF7>)</span><span class=cF0>)
<a name="l148"></a> tmpins-&gt;size1 = </span><span class=cFE>16</span><span class=cF0>;
<a name="l149"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;</span><span class=cFB>cmp</span><span class=cF0>.size_arg_mask[</span><span class=cFE>4</span><span class=cF0>], j</span><span class=cF7>)</span><span class=cF0>)
<a name="l150"></a> tmpins-&gt;size1 = </span><span class=cFE>32</span><span class=cF0>;
<a name="l151"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;</span><span class=cFB>cmp</span><span class=cF0>.size_arg_mask[</span><span class=cFE>8</span><span class=cF0>], j</span><span class=cF7>)</span><span class=cF0>)
<a name="l152"></a> tmpins-&gt;size1 = </span><span class=cFE>64</span><span class=cF0>;
<a name="l153"></a>
<a name="l154"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Lex</span><span class=cF7>(</span><span class=cF0>cc</span><span class=cF7>)</span><span class=cF0> == </span><span class=cF3>TK_IDENT</span><span class=cF0>)
<a name="l155"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l156"></a> j = </span><span class=cF5>DefineMatch</span><span class=cF0>(cc-&gt;cur_str, </span><span class=cF6>&quot;ST_ARG_TYPES&quot;</span><span class=cF0>);
<a name="l157"></a> </span><span class=cF5>Lex</span><span class=cF0>(cc);
<a name="l158"></a> tmpins-&gt;arg2 = j;
<a name="l159"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;</span><span class=cFB>cmp</span><span class=cF0>.size_arg_mask[</span><span class=cFE>1</span><span class=cF0>],j</span><span class=cF7>)</span><span class=cF0>)
<a name="l160"></a> tmpins-&gt;size2 = </span><span class=cFE>8</span><span class=cF0>;
<a name="l161"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;</span><span class=cFB>cmp</span><span class=cF0>.size_arg_mask[</span><span class=cFE>2</span><span class=cF0>], j</span><span class=cF7>)</span><span class=cF0>)
<a name="l162"></a> tmpins-&gt;size2 = </span><span class=cFE>16</span><span class=cF0>;
<a name="l163"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;</span><span class=cFB>cmp</span><span class=cF0>.size_arg_mask[</span><span class=cFE>4</span><span class=cF0>], j</span><span class=cF7>)</span><span class=cF0>)
<a name="l164"></a> tmpins-&gt;size2 = </span><span class=cFE>32</span><span class=cF0>;
<a name="l165"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;</span><span class=cFB>cmp</span><span class=cF0>.size_arg_mask[</span><span class=cFE>8</span><span class=cF0>], j</span><span class=cF7>)</span><span class=cF0>)
<a name="l166"></a> tmpins-&gt;size2 = </span><span class=cFE>64</span><span class=cF0>;
<a name="l167"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l168"></a> }
<a name="l169"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l170"></a> size = </span><span class=cF1>offset</span><span class=cF0>(</span><span class=cF9>CHashOpcode</span><span class=cF0>.ins) + </span><span class=cF1>sizeof</span><span class=cF0>(</span><span class=cF9>CInst</span><span class=cF0>) * tmpo_max-&gt;inst_entry_count;
<a name="l171"></a> tmpo = </span><span class=cF5>MAlloc</span><span class=cF0>(size);
<a name="l172"></a> </span><span class=cF5>MemCopy</span><span class=cF0>(tmpo, tmpo_max, size);
<a name="l173"></a> tmpo-&gt;use_count = </span><span class=cFE>0</span><span class=cF0>;
<a name="l174"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>HashFind</span><span class=cF7>(</span><span class=cF0>tmpo-&gt;str, </span><span class=cFB>cmp</span><span class=cF0>.asm_hash, </span><span class=cF3>HTT_OPCODE</span><span class=cF7>)</span><span class=cF0>)
<a name="l175"></a> </span><span class=cF5>LexExcept</span><span class=cF0>(cc, </span><span class=cF6>&quot;Duplicate OPCODE entry &quot;</span><span class=cF0>);
<a name="l176"></a> </span><span class=cF5>HashAdd</span><span class=cF0>(tmpo, </span><span class=cFB>cmp</span><span class=cF0>.asm_hash);
<a name="l177"></a> </span><span class=cF2>//Parse aliases.</span><span class=cF0>
<a name="l178"></a> </span><span class=cF1>if</span><span class=cF0> (cc-&gt;token == </span><span class=cF6>':'</span><span class=cF0>)
<a name="l179"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l180"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF5>Lex</span><span class=cF7>(</span><span class=cF0>cc</span><span class=cF7>)</span><span class=cF0> == </span><span class=cF3>TK_IDENT</span><span class=cF0>)
<a name="l181"></a> {
<a name="l182"></a> tmpo2 = </span><span class=cF5>MAllocIdent</span><span class=cF0>(tmpo);
<a name="l183"></a> tmpo2-&gt;str = cc-&gt;cur_str;
<a name="l184"></a> cc-&gt;cur_str = </span><span class=cFE>0</span><span class=cF0>;
<a name="l185"></a> tmpo2-&gt;oc_flags |= </span><span class=cF3>OCF_ALIAS</span><span class=cF0>;
<a name="l186"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>HashFind</span><span class=cF7>(</span><span class=cF0>tmpo2-&gt;str, </span><span class=cFB>cmp</span><span class=cF0>.asm_hash, </span><span class=cF3>HTT_OPCODE</span><span class=cF7>)</span><span class=cF0>)
<a name="l187"></a> </span><span class=cF5>LexExcept</span><span class=cF0>(cc, </span><span class=cF6>&quot;Duplicate OPCODE ALIAS entry &quot;</span><span class=cF0>);
<a name="l188"></a> </span><span class=cF5>HashAdd</span><span class=cF0>(tmpo2, </span><span class=cFB>cmp</span><span class=cF0>.asm_hash);
<a name="l189"></a> }
<a name="l190"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l191"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l192"></a>
<a name="l193"></a> </span><span class=cF1>case</span><span class=cF0>: </span><span class=cF2>//KEYWORD</span><span class=cF0>
<a name="l194"></a> </span><span class=cF1>case</span><span class=cF0>: </span><span class=cF2>//ASM_KEYWORD</span><span class=cF0>
<a name="l195"></a> tmph = </span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CHashGeneric</span><span class=cF7>)</span><span class=cF0>);
<a name="l196"></a> tmph-&gt;str = cc-&gt;cur_str;
<a name="l197"></a> cc-&gt;cur_str = </span><span class=cF3>NULL</span><span class=cF0>;
<a name="l198"></a> </span><span class=cF5>Lex</span><span class=cF0>(cc); </span><span class=cF2>//skip keyword name</span><span class=cF0>
<a name="l199"></a> </span><span class=cF1>if</span><span class=cF0> (cc-&gt;token != </span><span class=cF3>TK_I64</span><span class=cF0>)
<a name="l200"></a> </span><span class=cF5>LexExcept</span><span class=cF0>(cc, </span><span class=cF6>&quot;Expecting int at &quot;</span><span class=cF0>);
<a name="l201"></a> tmph-&gt;user_data0 = cc-&gt;cur_i64;
<a name="l202"></a> </span><span class=cF1>if</span><span class=cF0> (i == </span><span class=cFE>10</span><span class=cF0>)
<a name="l203"></a> tmph-&gt;type = </span><span class=cF3>HTT_KEYWORD</span><span class=cF0>;
<a name="l204"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l205"></a> tmph-&gt;type = </span><span class=cF3>HTT_ASM_KEYWORD</span><span class=cF0>;
<a name="l206"></a> </span><span class=cF5>HashAdd</span><span class=cF0>(tmph, </span><span class=cFB>cmp</span><span class=cF0>.asm_hash);
<a name="l207"></a> </span><span class=cF5>Lex</span><span class=cF0>(cc); </span><span class=cF2>//Skip INT</span><span class=cF0>
<a name="l208"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l209"></a> }
<a name="l210"></a> </span><span class=cF1>if</span><span class=cF0> (cc-&gt;token != </span><span class=cF6>';'</span><span class=cF0>)
<a name="l211"></a> </span><span class=cF5>LexExcept</span><span class=cF0>(cc, </span><span class=cF6>&quot;Missing ';' at&quot;</span><span class=cF0>);
<a name="l212"></a> </span><span class=cF5>Lex</span><span class=cF0>(cc); </span><span class=cF2>//Skip ';'</span><span class=cF0>
<a name="l213"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l214"></a> </span><span class=cF5>Free</span><span class=cF0>(tmpo_max);
<a name="l215"></a> </span><span class=cF5>CompCtrlDel</span><span class=cF0>(cc);
<a name="l216"></a> </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cFE>0</span><span class=cF0>; i &lt; INTERNAL_TYPES_NUM; i++)
<a name="l217"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l218"></a> tmpit = &amp;</span><span class=cFD>internal_types_table</span><span class=cF0>[i];
<a name="l219"></a> tmpc = </span><span class=cFD>ParseClassNew</span><span class=cF0>;
<a name="l220"></a> tmpc-&gt;type = </span><span class=cF3>HTT_INTERNAL_TYPE</span><span class=cF0>;
<a name="l221"></a> tmpc-&gt;raw_type = tmpit-&gt;type;
<a name="l222"></a> </span><span class=cF5>Bts</span><span class=cF0>(&amp;tmpc-&gt;flags, </span><span class=cF3>Cf_INTERNAL_TYPE</span><span class=cF0>);
<a name="l223"></a> tmpc-&gt;size = tmpit-&gt;size;
<a name="l224"></a> tmpc-&gt;str = </span><span class=cF5>SysStrNew</span><span class=cF0>(tmpit-&gt;name);
<a name="l225"></a> </span><span class=cF5>HashAdd</span><span class=cF0>(tmpc, </span><span class=cFB>cmp</span><span class=cF0>.asm_hash);
<a name="l226"></a> </span><span class=cFB>cmp</span><span class=cF0>.internal_types[tmpc-&gt;raw_type] = tmpc;
<a name="l227"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l228"></a> </span><span class=cFB>sys_task</span><span class=cF0>-&gt;hash_table-&gt;next = </span><span class=cFB>cmp</span><span class=cF0>.asm_hash;
<a name="l229"></a>}
</span></pre></body>
</html>