249 lines
23 KiB
Plaintext
249 lines
23 KiB
Plaintext
|
<!DOCTYPE html>
|
||
|
<html lang="en">
|
||
|
<head>
|
||
|
<meta charset="UTF-8">
|
||
|
<meta name="generator" content="TempleOS V5.03">
|
||
|
<meta name="viewport" content="width=device-width">
|
||
|
<link rel="stylesheet" href="/style/templeos.css">
|
||
|
<script src="/script/templeos.js"></script>
|
||
|
<style type="text/css">
|
||
|
.cF0{color:#000000;background-color:#ffffff;}
|
||
|
.cF1{color:#0000aa;background-color:#ffffff;}
|
||
|
.cF2{color:#00aa00;background-color:#ffffff;}
|
||
|
.cF3{color:#00aaaa;background-color:#ffffff;}
|
||
|
.cF4{color:#aa0000;background-color:#ffffff;}
|
||
|
.cF5{color:#aa00aa;background-color:#ffffff;}
|
||
|
.cF6{color:#aa5500;background-color:#ffffff;}
|
||
|
.cF7{color:#aaaaaa;background-color:#ffffff;}
|
||
|
.cF8{color:#555555;background-color:#ffffff;}
|
||
|
.cF9{color:#5555ff;background-color:#ffffff;}
|
||
|
.cFA{color:#55ff55;background-color:#ffffff;}
|
||
|
.cFB{color:#55ffff;background-color:#ffffff;}
|
||
|
.cFC{color:#ff5555;background-color:#ffffff;}
|
||
|
.cFD{color:#ff55ff;background-color:#ffffff;}
|
||
|
.cFE{color:#ffff55;background-color:#ffffff;}
|
||
|
.cFF{color:#ffffff;background-color:#ffffff;}
|
||
|
</style>
|
||
|
</head>
|
||
|
<body>
|
||
|
<pre id="content">
|
||
|
<a name="l1"></a><span class=cF1>U0</span><span class=cF0> </span><span class=cFD>AsmResolve</span><span class=cF0>(</span><span class=cF9>CCmpCtrl</span><span class=cF0> *cc,</span><span class=cF9>CAsmUnresolvedRef</span><span class=cF0> *tmpu,</span><span class=cF1>U8</span><span class=cF0> *label,</span><span class=cF1>Bool</span><span class=cF0> undefined)
|
||
|
<a name="l2"></a>{
|
||
|
<a name="l3"></a> </span><span class=cF9>CAOTImportExport</span><span class=cF0> *tmpie;
|
||
|
<a name="l4"></a> </span><span class=cF9>CAsmUndefHash</span><span class=cF0> *tmpauh;
|
||
|
<a name="l5"></a> </span><span class=cF9>I64</span><span class=cF0> res=</span><span class=cF5>Call</span><span class=cF0>(tmpu->machine_code);
|
||
|
<a name="l6"></a> </span><span class=cF1>if</span><span class=cF0> (undefined) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l7"></a> tmpauh=tmpu->asm_undef_hash;
|
||
|
<a name="l8"></a> </span><span class=cF1>while</span><span class=cF0> (tmpauh) {
|
||
|
<a name="l9"></a> </span><span class=cF1>if</span><span class=cF0> (tmpauh->hash->type & </span><span class=cF3>HTF_UNRESOLVED</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l10"></a> tmpie=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CAOTImportExport</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l11"></a> tmpie->next=tmpauh->hash->ie_lst;
|
||
|
<a name="l12"></a> tmpauh->hash->ie_lst=tmpie;
|
||
|
<a name="l13"></a> tmpie->rip=tmpu->rip;
|
||
|
<a name="l14"></a> tmpie->aot=cc->aot;
|
||
|
<a name="l15"></a> tmpie->type=tmpu->type;
|
||
|
<a name="l16"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l17"></a> tmpauh=tmpauh->next; </span><span class=cF2>//Technically, more than one won't work.</span><span class=cF0>
|
||
|
<a name="l18"></a> }
|
||
|
<a name="l19"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>tmpu->type&</span><span class=cF3>IEF_IMM_NOT_REL</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l20"></a> res-=tmpu->rel_rip;
|
||
|
<a name="l21"></a> </span><span class=cF1>if</span><span class=cF0> (tmpu->type==</span><span class=cF3>IET_REL_I8</span><span class=cF0> && !</span><span class=cF7>(</span><span class=cF3>I8_MIN</span><span class=cF0><=res<=</span><span class=cF3>I8_MAX</span><span class=cF7>)</span><span class=cF0> ||
|
||
|
<a name="l22"></a> tmpu->type==</span><span class=cF3>IET_REL_I16</span><span class=cF0> && !</span><span class=cF7>(</span><span class=cF3>I16_MIN</span><span class=cF0><=res<=</span><span class=cF3>I16_MAX</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l23"></a> </span><span class=cF5>PrintErr</span><span class=cF0>(</span><span class=cF6>"Branch out of range at line:%04d %s\n"</span><span class=cF0>,
|
||
|
<a name="l24"></a> tmpu->line_num,label);
|
||
|
<a name="l25"></a> </span><span class=cF5>LexExcept</span><span class=cF0>(cc);
|
||
|
<a name="l26"></a> }
|
||
|
<a name="l27"></a> </span><span class=cF1>if</span><span class=cF0> (tmpu->U8_avail && tmpu->type></span><span class=cF3>IET_IMM_U8</span><span class=cF0> && -124<=res<=123)
|
||
|
<a name="l28"></a> </span><span class=cF5>PrintWarn</span><span class=cF0>(</span><span class=cF6>"could use I8 displacement at line:%04d %s %s\n"</span><span class=cF0>,
|
||
|
<a name="l29"></a> tmpu->line_num,cc->aotc->last_label,label);
|
||
|
<a name="l30"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l31"></a> </span><span class=cFD>AOTStoreCodeU8At</span><span class=cF0>(cc,tmpu->rip,res.u8[0]);
|
||
|
<a name="l32"></a> </span><span class=cF1>if</span><span class=cF0> (tmpu->type>=</span><span class=cF3>IET_REL_I16</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l33"></a> </span><span class=cFD>AOTStoreCodeU8At</span><span class=cF0>(cc,tmpu->rip+1,res.u8[1]);
|
||
|
<a name="l34"></a> </span><span class=cF1>if</span><span class=cF0> (tmpu->type>=</span><span class=cF3>IET_REL_I32</span><span class=cF0>) {
|
||
|
<a name="l35"></a> </span><span class=cFD>AOTStoreCodeU8At</span><span class=cF0>(cc,tmpu->rip+2,res.u8[2],res.u8[3]);
|
||
|
<a name="l36"></a> </span><span class=cF1>if</span><span class=cF0> (tmpu->type>=</span><span class=cF3>IET_REL_I64</span><span class=cF0>)
|
||
|
<a name="l37"></a> </span><span class=cFD>AOTStoreCodeU8At</span><span class=cF0>(cc,tmpu->rip+4,res.u8[4],res.u8[5],
|
||
|
<a name="l38"></a> res.u8[6],res.u8[7]);
|
||
|
<a name="l39"></a> }
|
||
|
<a name="l40"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l41"></a>}
|
||
|
<a name="l42"></a>
|
||
|
<a name="l43"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cFD>AOTLocalsResolve</span><span class=cF0>(</span><span class=cF9>CCmpCtrl</span><span class=cF0> *cc)
|
||
|
<a name="l44"></a>{
|
||
|
<a name="l45"></a> </span><span class=cF9>CAOTCtrl</span><span class=cF0> *aotc=cc->aotc;
|
||
|
<a name="l46"></a> </span><span class=cF9>CAsmUnresolvedRef</span><span class=cF0> *tmpu=aotc->local_unresolved,*tmpu1;
|
||
|
<a name="l47"></a> </span><span class=cF9>CAsmUndefHash</span><span class=cF0> *tmpauh;
|
||
|
<a name="l48"></a> </span><span class=cF1>Bool</span><span class=cF0> undefined;
|
||
|
<a name="l49"></a> </span><span class=cF1>U8</span><span class=cF0> *label=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l50"></a>
|
||
|
<a name="l51"></a> </span><span class=cF1>while</span><span class=cF0> (tmpu) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l52"></a> undefined=</span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l53"></a> tmpu1=tmpu->next;
|
||
|
<a name="l54"></a> tmpauh=tmpu->asm_undef_hash;
|
||
|
<a name="l55"></a> </span><span class=cF1>while</span><span class=cF0> (tmpauh) {
|
||
|
<a name="l56"></a> </span><span class=cF1>if</span><span class=cF0> (tmpauh->hash->type & </span><span class=cF3>HTF_UNRESOLVED</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l57"></a> </span><span class=cF5>PrintErr</span><span class=cF0>(</span><span class=cF6>"Undefined sym at line:%04d %s %s\n"</span><span class=cF0>,
|
||
|
<a name="l58"></a> tmpu->line_num,aotc->last_label,tmpauh->hash->str);
|
||
|
<a name="l59"></a> </span><span class=cF5>LexExcept</span><span class=cF0>(cc);
|
||
|
<a name="l60"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l61"></a> label=tmpauh->hash->str;
|
||
|
<a name="l62"></a> tmpauh=tmpauh->next;
|
||
|
<a name="l63"></a> }
|
||
|
<a name="l64"></a> </span><span class=cF1>if</span><span class=cF0> (!undefined)
|
||
|
<a name="l65"></a> </span><span class=cFD>AsmResolve</span><span class=cF0>(cc,tmpu,label,</span><span class=cF3>FALSE</span><span class=cF0>);
|
||
|
<a name="l66"></a> </span><span class=cF5>Free</span><span class=cF0>(tmpu->machine_code);
|
||
|
<a name="l67"></a> </span><span class=cF5>LinkedLstDel</span><span class=cF0>(tmpu->asm_undef_hash);
|
||
|
<a name="l68"></a> </span><span class=cF5>Free</span><span class=cF0>(tmpu);
|
||
|
<a name="l69"></a> tmpu=tmpu1;
|
||
|
<a name="l70"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l71"></a> </span><span class=cF5>HashTableDel</span><span class=cF0>(cc->htc.local_hash_table);
|
||
|
<a name="l72"></a> cc->htc.hash_table_lst=cc->htc.local_hash_table=</span><span class=cF5>HashTableNew</span><span class=cF0>(16);
|
||
|
<a name="l73"></a> cc->htc.local_hash_table->next=cc->htc.glbl_hash_table;
|
||
|
<a name="l74"></a> aotc->local_unresolved=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l75"></a>}
|
||
|
<a name="l76"></a>
|
||
|
<a name="l77"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cFD>AOTGlblsResolve</span><span class=cF0>(</span><span class=cF9>CCmpCtrl</span><span class=cF0> *cc,</span><span class=cF9>CAOT</span><span class=cF0> *tmpaot)
|
||
|
<a name="l78"></a>{
|
||
|
<a name="l79"></a> </span><span class=cF9>CAOTCtrl</span><span class=cF0> *aotc=cc->aotc;
|
||
|
<a name="l80"></a> </span><span class=cF9>CHashFun</span><span class=cF0> *tmpf;
|
||
|
<a name="l81"></a> </span><span class=cF9>CAsmUnresolvedRef</span><span class=cF0> *tmpu=aotc->glbl_unresolved,*tmpu1;
|
||
|
<a name="l82"></a> </span><span class=cF9>I64</span><span class=cF0> i,j;
|
||
|
<a name="l83"></a> </span><span class=cF9>CAOTImportExport</span><span class=cF0> *tmpie,*tmpie1;
|
||
|
<a name="l84"></a> </span><span class=cF9>CAsmUndefHash</span><span class=cF0> *tmpauh;
|
||
|
<a name="l85"></a> </span><span class=cF9>CHashExport</span><span class=cF0> *tmpex;
|
||
|
<a name="l86"></a> </span><span class=cF1>U8</span><span class=cF0> *label;
|
||
|
<a name="l87"></a> </span><span class=cF1>Bool</span><span class=cF0> undefined;
|
||
|
<a name="l88"></a> </span><span class=cF9>CExternUsage</span><span class=cF0> *tmpeu,*tmpeu8;
|
||
|
<a name="l89"></a>
|
||
|
<a name="l90"></a> </span><span class=cF1>while</span><span class=cF0> (tmpu) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l91"></a> label=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l92"></a> undefined=</span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l93"></a> tmpu1=tmpu->next;
|
||
|
<a name="l94"></a> tmpauh=tmpu->asm_undef_hash;
|
||
|
<a name="l95"></a> </span><span class=cF1>while</span><span class=cF0> (tmpauh) {
|
||
|
<a name="l96"></a> </span><span class=cF1>if</span><span class=cF0> (tmpauh->hash->type & </span><span class=cF3>HTF_UNRESOLVED</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l97"></a> tmpex=tmpauh->hash;
|
||
|
<a name="l98"></a> </span><span class=cF1>if</span><span class=cF0> (tmpex->type & </span><span class=cF3>HTT_EXPORT_SYS_SYM</span><span class=cF0>&& tmpex->type & </span><span class=cF3>HTF_UNRESOLVED</span><span class=cF0> &&
|
||
|
<a name="l99"></a> !</span><span class=cF7>(</span><span class=cF0>tmpex->type & </span><span class=cF3>HTF_IMPORT</span><span class=cF7>)</span><span class=cF0> &&
|
||
|
<a name="l100"></a> </span><span class=cF7>(</span><span class=cF0>tmpf=</span><span class=cF5>HashFind</span><span class=cF0>(tmpex->str,cc->htc.hash_table_lst,</span><span class=cF3>HTT_FUN</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0> &&
|
||
|
<a name="l101"></a> !</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&tmpf->flags,</span><span class=cF3>Cf_EXTERN</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l102"></a> tmpex->val=tmpf->exe_addr;
|
||
|
<a name="l103"></a> tmpex->type&=~</span><span class=cF3>HTF_UNRESOLVED</span><span class=cF0>;
|
||
|
<a name="l104"></a> label=tmpauh->hash->str;
|
||
|
<a name="l105"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l106"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>tmpex->type & </span><span class=cF3>HTF_IMPORT</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l107"></a> </span><span class=cF1>if</span><span class=cF0> (cc->htc.local_var_lst) {
|
||
|
<a name="l108"></a> tmpex->type|=</span><span class=cF3>HTF_GOTO_LABEL</span><span class=cF0>;
|
||
|
<a name="l109"></a> tmpex->use_cnt++;
|
||
|
<a name="l110"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l111"></a> </span><span class=cF5>PrintErr</span><span class=cF0>(</span><span class=cF6>"Undefined sym at line:%04d %s\n"</span><span class=cF0>,
|
||
|
<a name="l112"></a> tmpu->line_num,tmpex->str);
|
||
|
<a name="l113"></a> </span><span class=cF5>LexExcept</span><span class=cF0>(cc);
|
||
|
<a name="l114"></a> }
|
||
|
<a name="l115"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (undefined) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l116"></a> </span><span class=cF5>PrintErr</span><span class=cF0>(</span><span class=cF6>"Two imports in same expression "</span><span class=cF0>
|
||
|
<a name="l117"></a> </span><span class=cF6>"not allowed at line:%04d %s\n"</span><span class=cF0>,
|
||
|
<a name="l118"></a> tmpu->line_num,tmpex->str);
|
||
|
<a name="l119"></a> </span><span class=cF5>LexExcept</span><span class=cF0>(cc);
|
||
|
<a name="l120"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l121"></a> undefined=</span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l122"></a> }
|
||
|
<a name="l123"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l124"></a> label=tmpauh->hash->str;
|
||
|
<a name="l125"></a> tmpauh=tmpauh->next;
|
||
|
<a name="l126"></a> }
|
||
|
<a name="l127"></a> </span><span class=cFD>AsmResolve</span><span class=cF0>(cc,tmpu,label,undefined);
|
||
|
<a name="l128"></a> </span><span class=cF5>Free</span><span class=cF0>(tmpu->machine_code);
|
||
|
<a name="l129"></a> </span><span class=cF5>LinkedLstDel</span><span class=cF0>(tmpu->asm_undef_hash);
|
||
|
<a name="l130"></a> </span><span class=cF5>Free</span><span class=cF0>(tmpu);
|
||
|
<a name="l131"></a> tmpu=tmpu1;
|
||
|
<a name="l132"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l133"></a>
|
||
|
<a name="l134"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i<=cc->htc.glbl_hash_table->mask;i++) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l135"></a> tmpex=cc->htc.glbl_hash_table->body[i];
|
||
|
<a name="l136"></a> </span><span class=cF1>while</span><span class=cF0> (tmpex) {
|
||
|
<a name="l137"></a> </span><span class=cF1>if</span><span class=cF0> (tmpex->type & </span><span class=cF7>(</span><span class=cF3>HTF_IMPORT</span><span class=cF0>|</span><span class=cF3>HTF_GOTO_LABEL</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l138"></a> </span><span class=cF1>if</span><span class=cF0> (tmpex->use_cnt && </span><span class=cF7>(</span><span class=cF0>tmpie=tmpex->ie_lst</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l139"></a> </span><span class=cF1>if</span><span class=cF0> (tmpex->type&</span><span class=cF3>HTF_GOTO_LABEL</span><span class=cF0>)
|
||
|
<a name="l140"></a> tmpie->flags|=</span><span class=cF3>IEF_GOTO_LABEL</span><span class=cF0>;
|
||
|
<a name="l141"></a> </span><span class=cF1>if</span><span class=cF0> (tmpex->import_name)
|
||
|
<a name="l142"></a> tmpie->str=</span><span class=cF5>StrNew</span><span class=cF0>(tmpex->import_name);
|
||
|
<a name="l143"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l144"></a> tmpie->str=</span><span class=cF5>StrNew</span><span class=cF0>(tmpex->str);
|
||
|
<a name="l145"></a> </span><span class=cF1>do</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l146"></a> tmpie1=tmpie->next;
|
||
|
<a name="l147"></a> </span><span class=cF5>QueIns</span><span class=cF0>(tmpie,tmpaot->last_ie);
|
||
|
<a name="l148"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>while</span><span class=cF0> (tmpie=tmpie1);
|
||
|
<a name="l149"></a> tmpex->ie_lst=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l150"></a> }
|
||
|
<a name="l151"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (tmpex->type & </span><span class=cF7>(</span><span class=cF3>HTF_EXPORT</span><span class=cF0>|</span><span class=cF3>HTF_RESOLVE</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l152"></a> </span><span class=cF1>if</span><span class=cF0> (tmpex->type & </span><span class=cF3>HTF_UNRESOLVED</span><span class=cF0>) {
|
||
|
<a name="l153"></a> </span><span class=cF5>PrintErr</span><span class=cF0>(</span><span class=cF6>"Undefined sym at %s\n"</span><span class=cF0>,tmpex->str);
|
||
|
<a name="l154"></a> </span><span class=cF5>LexExcept</span><span class=cF0>(cc);
|
||
|
<a name="l155"></a> }
|
||
|
<a name="l156"></a> </span><span class=cF1>if</span><span class=cF0> (tmpex->type & </span><span class=cF3>HTF_RESOLVE</span><span class=cF0>) {
|
||
|
<a name="l157"></a> tmpf=tmpex;
|
||
|
<a name="l158"></a> tmpeu=tmpf->ext_lst;
|
||
|
<a name="l159"></a> </span><span class=cF1>while</span><span class=cF0> (tmpeu) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l160"></a> tmpeu8=tmpeu->next;
|
||
|
<a name="l161"></a> j=tmpf->exe_addr-(tmpeu->rip+4);
|
||
|
<a name="l162"></a> </span><span class=cFD>AOTStoreCodeU8At</span><span class=cF0>(cc,tmpeu->rip,j.u8[0],j.u8[1],j.u8[2],j.u8[3]);
|
||
|
<a name="l163"></a> </span><span class=cF5>Free</span><span class=cF0>(tmpeu);
|
||
|
<a name="l164"></a> tmpeu=tmpeu8;
|
||
|
<a name="l165"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l166"></a> }
|
||
|
<a name="l167"></a> </span><span class=cF1>if</span><span class=cF0> (tmpex->type & </span><span class=cF3>HTF_EXPORT</span><span class=cF0>) {
|
||
|
<a name="l168"></a> tmpie=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CAOTImportExport</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l169"></a> tmpie->type=</span><span class=cF3>IET_REL32_EXPORT</span><span class=cF0>;
|
||
|
<a name="l170"></a> </span><span class=cF1>if</span><span class=cF0> (tmpex->type & </span><span class=cF3>HTT_FUN</span><span class=cF0>)
|
||
|
<a name="l171"></a> tmpie->rip=tmpf->exe_addr;
|
||
|
<a name="l172"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (tmpex->type & </span><span class=cF3>HTT_GLBL_VAR</span><span class=cF0>)
|
||
|
<a name="l173"></a> tmpie->rip=tmpex(</span><span class=cF9>CHashGlblVar</span><span class=cF0> *)->data_addr_rip;
|
||
|
<a name="l174"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l175"></a> tmpie->rip=tmpex->val;
|
||
|
<a name="l176"></a> tmpie->aot=cc->aot;
|
||
|
<a name="l177"></a> </span><span class=cF1>if</span><span class=cF0> (tmpex->type & </span><span class=cF3>HTF_IMM</span><span class=cF0>)
|
||
|
<a name="l178"></a> tmpie->type++;
|
||
|
<a name="l179"></a> tmpie->str=</span><span class=cF5>StrNew</span><span class=cF0>(tmpex->str);
|
||
|
<a name="l180"></a> tmpie->src_link=</span><span class=cF5>StrNew</span><span class=cF0>(tmpex->src_link);
|
||
|
<a name="l181"></a> </span><span class=cF5>QueIns</span><span class=cF0>(tmpie,tmpaot->last_ie);
|
||
|
<a name="l182"></a> }
|
||
|
<a name="l183"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l184"></a> tmpex=tmpex->next;
|
||
|
<a name="l185"></a> }
|
||
|
<a name="l186"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l187"></a>}
|
||
|
<a name="l188"></a>
|
||
|
<a name="l189"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cFD>AsmUnresolvedAdd</span><span class=cF0>(</span><span class=cF9>CCmpCtrl</span><span class=cF0> *cc,</span><span class=cF1>U8</span><span class=cF0> *machine_code,</span><span class=cF9>I64</span><span class=cF0> type,</span><span class=cF9>I64</span><span class=cF0> rip,</span><span class=cF9>I64</span><span class=cF0> rel_rip,
|
||
|
<a name="l190"></a> </span><span class=cF9>CAsmUndefHash</span><span class=cF0> *local_asm_undef_hash,</span><span class=cF9>CAsmUndefHash</span><span class=cF0> *glbl_asm_undef_hash,
|
||
|
<a name="l191"></a> </span><span class=cF9>I64</span><span class=cF0> line_num,</span><span class=cF1>Bool</span><span class=cF0> U8_avail)
|
||
|
<a name="l192"></a>{
|
||
|
<a name="l193"></a> </span><span class=cF9>CAsmUnresolvedRef</span><span class=cF0> *tmpu=</span><span class=cF5>MAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CAsmUnresolvedRef</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l194"></a> tmpu->machine_code=machine_code;
|
||
|
<a name="l195"></a> tmpu->type=type;
|
||
|
<a name="l196"></a> tmpu->rip=rip;
|
||
|
<a name="l197"></a> tmpu->rel_rip=rel_rip;
|
||
|
<a name="l198"></a> tmpu->aot=cc->aot;
|
||
|
<a name="l199"></a> tmpu->imm_flag=</span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l200"></a> tmpu->line_num=line_num;
|
||
|
<a name="l201"></a> tmpu->U8_avail=U8_avail;
|
||
|
<a name="l202"></a> tmpu->str=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l203"></a> </span><span class=cF1>if</span><span class=cF0> (local_asm_undef_hash) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l204"></a> tmpu->asm_undef_hash=local_asm_undef_hash;
|
||
|
<a name="l205"></a> tmpu->next=cc->aotc->local_unresolved;
|
||
|
<a name="l206"></a> cc->aotc->local_unresolved=tmpu;
|
||
|
<a name="l207"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l208"></a> tmpu->asm_undef_hash=glbl_asm_undef_hash;
|
||
|
<a name="l209"></a> tmpu->next=cc->aotc->glbl_unresolved;
|
||
|
<a name="l210"></a> cc->aotc->glbl_unresolved=tmpu;
|
||
|
<a name="l211"></a> </span><span class=cF1>if</span><span class=cF0> (glbl_asm_undef_hash->hash->type & </span><span class=cF3>HTF_IMPORT</span><span class=cF0>) {
|
||
|
<a name="l212"></a> tmpu->str=</span><span class=cF5>StrNew</span><span class=cF0>(glbl_asm_undef_hash->hash->str);
|
||
|
<a name="l213"></a> </span><span class=cF1>if</span><span class=cF0> (glbl_asm_undef_hash->hash->type & </span><span class=cF3>HTF_IMM</span><span class=cF0>)
|
||
|
<a name="l214"></a> tmpu->imm_flag=</span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l215"></a> }
|
||
|
<a name="l216"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l217"></a>}
|
||
|
</span></pre></body>
|
||
|
</html>
|