207 lines
18 KiB
HTML
Executable File
207 lines
18 KiB
HTML
Executable File
<!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>AOTStoreCodeU8</span><span class=cF0>(</span><span class=cF9>CCmpCtrl</span><span class=cF0> *cc,</span><span class=cF1>U8</span><span class=cF0> b)
|
|
<a name="l2"></a>{
|
|
<a name="l3"></a> </span><span class=cF9>CAOTCtrl</span><span class=cF0> *aotc=cc->aotc;
|
|
<a name="l4"></a> </span><span class=cF9>I64</span><span class=cF0> i=aotc->rip>></span><span class=cF3>AOT_BIN_BLK_BITS</span><span class=cF0>;
|
|
<a name="l5"></a> </span><span class=cF9>CAOTBinBlk</span><span class=cF0> *tmpbin=aotc->bin;
|
|
<a name="l6"></a> </span><span class=cF1>while</span><span class=cF0> (i--)
|
|
<a name="l7"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>tmpbin=tmpbin->next</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l8"></a> i=aotc->rip>></span><span class=cF3>AOT_BIN_BLK_BITS</span><span class=cF0>+1;
|
|
<a name="l9"></a> tmpbin=&aotc->bin;
|
|
<a name="l10"></a> </span><span class=cF1>while</span><span class=cF0> (i--) {
|
|
<a name="l11"></a> </span><span class=cF1>if</span><span class=cF0> (!tmpbin->next)
|
|
<a name="l12"></a> tmpbin->next=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CAOTBinBlk</span><span class=cF7>)</span><span class=cF0>);
|
|
<a name="l13"></a> tmpbin=tmpbin->next;
|
|
<a name="l14"></a> }
|
|
<a name="l15"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l16"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l17"></a> tmpbin->body[aotc->rip++ & (</span><span class=cF3>AOT_BIN_BLK_SIZE</span><span class=cF0>-1)]=b;
|
|
<a name="l18"></a> </span><span class=cF1>if</span><span class=cF0> (aotc->lst) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l19"></a> </span><span class=cF1>if</span><span class=cF0> (aotc->lst_col>=24) {
|
|
<a name="l20"></a> </span><span class=cF6>'\n'</span><span class=cF0>;
|
|
<a name="l21"></a> aotc->lst_col=0;
|
|
<a name="l22"></a> }
|
|
<a name="l23"></a> </span><span class=cF6>"%02X "</span><span class=cF0>,b;
|
|
<a name="l24"></a> aotc->lst_col+=3;
|
|
<a name="l25"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l26"></a> </span><span class=cF1>if</span><span class=cF0> (aotc->rip>aotc->num_bin_U8s)
|
|
<a name="l27"></a> aotc->num_bin_U8s=aotc->rip;
|
|
<a name="l28"></a>}
|
|
<a name="l29"></a>
|
|
<a name="l30"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cFD>AOTStoreCodeU32</span><span class=cF0>(</span><span class=cF9>CCmpCtrl</span><span class=cF0> *cc,</span><span class=cF9>U32</span><span class=cF0> d)
|
|
<a name="l31"></a>{
|
|
<a name="l32"></a> </span><span class=cF9>CAOTCtrl</span><span class=cF0> *aotc=cc->aotc;
|
|
<a name="l33"></a> </span><span class=cF9>I64</span><span class=cF0> i=aotc->rip>></span><span class=cF3>AOT_BIN_BLK_BITS</span><span class=cF0>,j=(aotc->rip+</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>U32</span><span class=cF7>)</span><span class=cF0>)>></span><span class=cF3>AOT_BIN_BLK_BITS</span><span class=cF0>;
|
|
<a name="l34"></a> </span><span class=cF9>U32</span><span class=cF0> *_d;
|
|
<a name="l35"></a> </span><span class=cF9>CAOTBinBlk</span><span class=cF0> *tmpbin;
|
|
<a name="l36"></a> </span><span class=cF1>if</span><span class=cF0> (i!=j)
|
|
<a name="l37"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i<</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>U32</span><span class=cF7>)</span><span class=cF0>;i++)
|
|
<a name="l38"></a> </span><span class=cFD>AOTStoreCodeU8</span><span class=cF0>(cc,d.u8[i]);
|
|
<a name="l39"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l40"></a> tmpbin=aotc->bin;
|
|
<a name="l41"></a> </span><span class=cF1>while</span><span class=cF0> (i--)
|
|
<a name="l42"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>tmpbin=tmpbin->next</span><span class=cF7>)</span><span class=cF0>) {
|
|
<a name="l43"></a> i=aotc->rip>></span><span class=cF3>AOT_BIN_BLK_BITS</span><span class=cF0>+1;
|
|
<a name="l44"></a> tmpbin=&aotc->bin;
|
|
<a name="l45"></a> </span><span class=cF1>while</span><span class=cF0> (i--) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l46"></a> </span><span class=cF1>if</span><span class=cF0> (!tmpbin->next)
|
|
<a name="l47"></a> tmpbin->next=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CAOTBinBlk</span><span class=cF7>)</span><span class=cF0>);
|
|
<a name="l48"></a> tmpbin=tmpbin->next;
|
|
<a name="l49"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l50"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l51"></a> }
|
|
<a name="l52"></a> _d=tmpbin->body+ aotc->rip&(</span><span class=cF3>AOT_BIN_BLK_SIZE</span><span class=cF0>-1);
|
|
<a name="l53"></a> *_d=d;
|
|
<a name="l54"></a> aotc->rip+=</span><span class=cF1>sizeof</span><span class=cF0>(</span><span class=cF9>U32</span><span class=cF0>);
|
|
<a name="l55"></a> </span><span class=cF1>if</span><span class=cF0> (aotc->lst) {
|
|
<a name="l56"></a> </span><span class=cF1>if</span><span class=cF0> (aotc->lst_col>=24) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l57"></a> </span><span class=cF6>'\n'</span><span class=cF0>;
|
|
<a name="l58"></a> aotc->lst_col=0;
|
|
<a name="l59"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l60"></a> </span><span class=cF6>"%08X "</span><span class=cF0>,d;
|
|
<a name="l61"></a> aotc->lst_col+=9;
|
|
<a name="l62"></a> }
|
|
<a name="l63"></a> </span><span class=cF1>if</span><span class=cF0> (aotc->rip>aotc->num_bin_U8s)
|
|
<a name="l64"></a> aotc->num_bin_U8s=aotc->rip;
|
|
<a name="l65"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l66"></a>}
|
|
<a name="l67"></a>
|
|
<a name="l68"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cFD>AOTStoreCodeU64</span><span class=cF0>(</span><span class=cF9>CCmpCtrl</span><span class=cF0> *cc,</span><span class=cF9>U64</span><span class=cF0> q)
|
|
<a name="l69"></a>{
|
|
<a name="l70"></a> </span><span class=cF9>CAOTCtrl</span><span class=cF0> *aotc=cc->aotc;
|
|
<a name="l71"></a> </span><span class=cF9>I64</span><span class=cF0> i=aotc->rip>></span><span class=cF3>AOT_BIN_BLK_BITS</span><span class=cF0>,
|
|
<a name="l72"></a> j=(aotc->rip+</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF7>)</span><span class=cF0>)>></span><span class=cF3>AOT_BIN_BLK_BITS</span><span class=cF0>, *_q;
|
|
<a name="l73"></a> </span><span class=cF9>CAOTBinBlk</span><span class=cF0> *tmpbin;
|
|
<a name="l74"></a> </span><span class=cF1>if</span><span class=cF0> (i!=j)
|
|
<a name="l75"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i<</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>I64</span><span class=cF7>)</span><span class=cF0>;i++)
|
|
<a name="l76"></a> </span><span class=cFD>AOTStoreCodeU8</span><span class=cF0>(cc,q.u8[i]);
|
|
<a name="l77"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l78"></a> tmpbin=aotc->bin;
|
|
<a name="l79"></a> </span><span class=cF1>while</span><span class=cF0> (i--)
|
|
<a name="l80"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>tmpbin=tmpbin->next</span><span class=cF7>)</span><span class=cF0>) {
|
|
<a name="l81"></a> i=aotc->rip>></span><span class=cF3>AOT_BIN_BLK_BITS</span><span class=cF0>+1;
|
|
<a name="l82"></a> tmpbin=&aotc->bin;
|
|
<a name="l83"></a> </span><span class=cF1>while</span><span class=cF0> (i--) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l84"></a> </span><span class=cF1>if</span><span class=cF0> (!tmpbin->next)
|
|
<a name="l85"></a> tmpbin->next=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CAOTBinBlk</span><span class=cF7>)</span><span class=cF0>);
|
|
<a name="l86"></a> tmpbin=tmpbin->next;
|
|
<a name="l87"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l88"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l89"></a> }
|
|
<a name="l90"></a> _q=tmpbin->body+ aotc->rip&(</span><span class=cF3>AOT_BIN_BLK_SIZE</span><span class=cF0>-1);
|
|
<a name="l91"></a> *_q=q;
|
|
<a name="l92"></a> aotc->rip+=</span><span class=cF1>sizeof</span><span class=cF0>(</span><span class=cF9>I64</span><span class=cF0>);
|
|
<a name="l93"></a> </span><span class=cF1>if</span><span class=cF0> (aotc->lst) {
|
|
<a name="l94"></a> </span><span class=cF1>if</span><span class=cF0> (aotc->lst_col>=24) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l95"></a> </span><span class=cF6>'\n'</span><span class=cF0>;
|
|
<a name="l96"></a> aotc->lst_col=0;
|
|
<a name="l97"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l98"></a> </span><span class=cF6>"%016X "</span><span class=cF0>,q;
|
|
<a name="l99"></a> aotc->lst_col+=17;
|
|
<a name="l100"></a> }
|
|
<a name="l101"></a> </span><span class=cF1>if</span><span class=cF0> (aotc->rip>aotc->num_bin_U8s)
|
|
<a name="l102"></a> aotc->num_bin_U8s=aotc->rip;
|
|
<a name="l103"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l104"></a>}
|
|
<a name="l105"></a>
|
|
<a name="l106"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cFD>AOTStoreCodeU8At</span><span class=cF0>(</span><span class=cF9>CCmpCtrl</span><span class=cF0> *cc,</span><span class=cF9>I64</span><span class=cF0> rip,...)
|
|
<a name="l107"></a>{
|
|
<a name="l108"></a> </span><span class=cF9>CAOTCtrl</span><span class=cF0> *aotc=cc->aotc;
|
|
<a name="l109"></a> </span><span class=cF9>CAOTBinBlk</span><span class=cF0> *tmpbin;
|
|
<a name="l110"></a> </span><span class=cF9>I64</span><span class=cF0> i,j;
|
|
<a name="l111"></a> </span><span class=cF1>for</span><span class=cF0> (j=0;j<argc;j++) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l112"></a> i=rip>></span><span class=cF3>AOT_BIN_BLK_BITS</span><span class=cF0>+1;
|
|
<a name="l113"></a> tmpbin=&aotc->bin;
|
|
<a name="l114"></a> </span><span class=cF1>while</span><span class=cF0> (i--) {
|
|
<a name="l115"></a> </span><span class=cF1>if</span><span class=cF0> (!tmpbin->next) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l116"></a> tmpbin->next=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CAOTBinBlk</span><span class=cF7>)</span><span class=cF0>);
|
|
<a name="l117"></a> tmpbin->next->next=</span><span class=cF3>NULL</span><span class=cF0>;
|
|
<a name="l118"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l119"></a> tmpbin=tmpbin->next;
|
|
<a name="l120"></a> }
|
|
<a name="l121"></a> tmpbin->body[rip++ & (</span><span class=cF3>AOT_BIN_BLK_SIZE</span><span class=cF0>-1)]=argv[j];
|
|
<a name="l122"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l123"></a> </span><span class=cF1>if</span><span class=cF0> (rip>aotc->num_bin_U8s)
|
|
<a name="l124"></a> aotc->num_bin_U8s=rip;
|
|
<a name="l125"></a>}
|
|
<a name="l126"></a>
|
|
<a name="l127"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cFD>AsmLexExpression</span><span class=cF0>(</span><span class=cF9>CCmpCtrl</span><span class=cF0> *cc)
|
|
<a name="l128"></a>{
|
|
<a name="l129"></a> </span><span class=cF1>U8</span><span class=cF0> *machine_code;
|
|
<a name="l130"></a> </span><span class=cF9>I64</span><span class=cF0> res=0;
|
|
<a name="l131"></a> cc->asm_undef_hash=</span><span class=cF3>NULL</span><span class=cF0>;
|
|
<a name="l132"></a> cc->flags&=~(</span><span class=cF3>CCF_UNRESOLVED</span><span class=cF0>+</span><span class=cF3>CCF_LOCAL</span><span class=cF0>);
|
|
<a name="l133"></a> cc->abs_cnts=0;
|
|
<a name="l134"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>IsLexExpression2Bin</span><span class=cF7>(</span><span class=cF0>cc,&machine_code</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l135"></a> </span><span class=cF5>LexSkipEol</span><span class=cF0>(cc);
|
|
<a name="l136"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l137"></a> </span><span class=cF1>if</span><span class=cF0> (cc->abs_cnts.externs)
|
|
<a name="l138"></a> </span><span class=cF5>LexExcept</span><span class=cF0>(cc,</span><span class=cF6>"Extern Not Allowed at "</span><span class=cF0>);
|
|
<a name="l139"></a> </span><span class=cF1>if</span><span class=cF0> (cc->flags & </span><span class=cF3>CCF_UNRESOLVED</span><span class=cF0>)
|
|
<a name="l140"></a> </span><span class=cF5>LexExcept</span><span class=cF0>(cc,</span><span class=cF6>"Undefined sym at "</span><span class=cF0>);
|
|
<a name="l141"></a> res=</span><span class=cF5>Call</span><span class=cF0>(machine_code);
|
|
<a name="l142"></a> </span><span class=cF5>Free</span><span class=cF0>(machine_code);
|
|
<a name="l143"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l144"></a> </span><span class=cF1>return</span><span class=cF0> res;
|
|
<a name="l145"></a>}
|
|
<a name="l146"></a>
|
|
<a name="l147"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cFD>AsmLineLst</span><span class=cF0>(</span><span class=cF9>CCmpCtrl</span><span class=cF0> *cc)
|
|
<a name="l148"></a>{
|
|
<a name="l149"></a> </span><span class=cF9>CAOTCtrl</span><span class=cF0> *aotc=cc->aotc;
|
|
<a name="l150"></a> </span><span class=cF9>CLexFile</span><span class=cF0> *tmpf=cc->lex_include_stk;
|
|
<a name="l151"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e=tmpf->line_start,*doc_e2;
|
|
<a name="l152"></a> </span><span class=cF1>if</span><span class=cF0> (aotc->lst && aotc->lst_last_lfn==tmpf && doc_e) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l153"></a> </span><span class=cF1>if</span><span class=cF0> (doc_e2=aotc->lst_last_line) {
|
|
<a name="l154"></a> </span><span class=cF1>if</span><span class=cF0> (tmpf->flags& </span><span class=cF3>LFSF_DOC</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l155"></a> </span><span class=cF1>while</span><span class=cF0> (doc_e2->y<doc_e->y) {
|
|
<a name="l156"></a> </span><span class=cF6>"%h*c%08X "</span><span class=cF0>,24-aotc->lst_col,</span><span class=cF3>CH_SPACE</span><span class=cF0>,aotc->lst_last_rip;
|
|
<a name="l157"></a> aotc->lst_col=0;
|
|
<a name="l158"></a> doc_e2=</span><span class=cF5>LexPutLine</span><span class=cF0>(cc,doc_e2);
|
|
<a name="l159"></a> }
|
|
<a name="l160"></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="l161"></a> </span><span class=cF1>while</span><span class=cF0> (*doc_e2</span><span class=cF7>(</span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0> && doc_e2!=doc_e) {
|
|
<a name="l162"></a> </span><span class=cF6>"%h*c%08X "</span><span class=cF0>,24-aotc->lst_col,</span><span class=cF3>CH_SPACE</span><span class=cF0>,aotc->lst_last_rip;
|
|
<a name="l163"></a> aotc->lst_col=0;
|
|
<a name="l164"></a> doc_e2=</span><span class=cF5>LexPutLine</span><span class=cF0>(cc,doc_e2);
|
|
<a name="l165"></a> }
|
|
<a name="l166"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l167"></a> aotc->lst_last_line=doc_e2;
|
|
<a name="l168"></a> } </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l169"></a> aotc->lst_last_line=doc_e;
|
|
<a name="l170"></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="l171"></a> aotc->lst_last_line=</span><span class=cF3>NULL</span><span class=cF0>;
|
|
<a name="l172"></a> aotc->lst_last_lfn=tmpf;
|
|
<a name="l173"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l174"></a> aotc->lst_last_rip=aotc->rip;
|
|
<a name="l175"></a>}
|
|
</span></pre></body>
|
|
</html>
|