ZealOS/docs/Compiler/CMisc.CC.html
TomAwezome 9aa9e44ea6 Add SSE instruction support to assembler.
(Only 2-arg instructions implemented. CosmiC assembler needs expanding to allow 3+ arg instructions.)
(Only <= 4 byte instructions implemented. CosmiC assembler needs expanding to allow instructions larger than 4 bytes.)
(Bugs: Unassembler incorrectly reports 0x66 prefixed opcodes, non-128-bit instruction arguments report as U128. CosmiC does not yet have support for U128.)
Fix Std Font characters.
Add links to ZealOS-specific apps in Personal Menu.
Remove all files in /Downloads.
2021-10-08 02:06:11 -04:00

215 lines
23 KiB
HTML
Executable file

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=US-ASCII">
<meta name="generator" content="ZealOS V1.02">
<style type="text/css">
body {background-color:#1f1f1f;}
.cF0{color:#e3e3e3;background-color:#1f1f1f;}
.cF1{color:#4f84a6;background-color:#1f1f1f;}
.cF2{color:#73a255;background-color:#1f1f1f;}
.cF3{color:#297582;background-color:#1f1f1f;}
.cF4{color:#b34f4b;background-color:#1f1f1f;}
.cF5{color:#8a52c3;background-color:#1f1f1f;}
.cF6{color:#b7822f;background-color:#1f1f1f;}
.cF7{color:#444444;background-color:#1f1f1f;}
.cF8{color:#6d6d6d;background-color:#1f1f1f;}
.cF9{color:#94bfde;background-color:#1f1f1f;}
.cFA{color:#a1ce97;background-color:#1f1f1f;}
.cFB{color:#6db4be;background-color:#1f1f1f;}
.cFC{color:#e88e88;background-color:#1f1f1f;}
.cFD{color:#ca94e8;background-color:#1f1f1f;}
.cFE{color:#d4b475;background-color:#1f1f1f;}
.cFF{color:#1f1f1f;background-color:#1f1f1f;}
</style>
</head>
<body>
<pre style="font-family:monospace;font-size:12pt">
<a name="l1"></a><span class=cF1>Bool</span><span class=cF0> </span><span class=cF5>Option</span><span class=cF0>(</span><span class=cF9>I64</span><span class=cF0> num, </span><span class=cF1>Bool</span><span class=cF0> val)
<a name="l2"></a>{</span><span class=cF2>//Set compiler </span><a href="https://zeal-operating-system.github.io/ZealOS/Doc/Options.DD.html#l1"><span class=cF4>Option</span></a><span class=cF2> to value.</span><span class=cF0>
<a name="l3"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF5>BEqual</span><span class=cF0>(&amp;</span><span class=cF5>Fs</span><span class=cF0>-&gt;last_cc-&gt;opts, num, val);
<a name="l4"></a>}
<a name="l5"></a>
<a name="l6"></a></span><span class=cF1>Bool</span><span class=cF0> </span><span class=cF5>OptionGet</span><span class=cF0>(</span><span class=cF9>I64</span><span class=cF0> num)
<a name="l7"></a>{</span><span class=cF2>//Get state of compiler </span><a href="https://zeal-operating-system.github.io/ZealOS/Kernel/KernelA.HH.html#l1676"><span class=cF4>option</span></a><span class=cF2>.</span><span class=cF0>
<a name="l8"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF5>Bt</span><span class=cF0>(&amp;</span><span class=cF5>Fs</span><span class=cF0>-&gt;last_cc-&gt;opts, num);
<a name="l9"></a>}
<a name="l10"></a>
<a name="l11"></a></span><span class=cF1>asm</span><span class=cF0> {
<a name="l12"></a></span><span class=cFD>_LAST_FUN</span><span class=cF0>:: </span><span class=cF2>//See </span><a href="https://zeal-operating-system.github.io/ZealOS/Kernel/KUtils.CC.html#l415"><span class=cF4>_CALL_IND</span></a><span class=cF0>
<a name="l13"></a> </span><span class=cF1>PUSH</span><span class=cF0> </span><span class=cFC>RBP</span><span class=cF0>
<a name="l14"></a> </span><span class=cF1>MOV</span><span class=cF0> </span><span class=cFC>RBP</span><span class=cF0>, </span><span class=cFC>RSP</span><span class=cF0>
<a name="l15"></a> </span><span class=cF1>PUSH</span><span class=cF0> </span><span class=cFC>RSI</span><span class=cF0>
<a name="l16"></a> </span><span class=cF1>PUSH</span><span class=cF0> </span><span class=cFC>RDI</span><span class=cF0>
<a name="l17"></a>
<a name="l18"></a> </span><span class=cF1>XOR</span><span class=cF0> </span><span class=cFC>RAX</span><span class=cF0>, </span><span class=cFC>RAX</span><span class=cF0>
<a name="l19"></a> </span><span class=cF1>MOV</span><span class=cF0> </span><span class=cFC>RAX</span><span class=cF0>, </span><span class=cFC>FS</span><span class=cF0>:</span><span class=cF9>CTask</span><span class=cF0>.last_fun[</span><span class=cFC>RAX</span><span class=cF0>]
<a name="l20"></a> </span><span class=cF1>TEST</span><span class=cF0> </span><span class=cFC>RAX</span><span class=cF0>, </span><span class=cFC>RAX</span><span class=cF0>
<a name="l21"></a> </span><span class=cF1>JZ</span><span class=cF0> @@10
<a name="l22"></a> </span><span class=cF1>MOV</span><span class=cF0> </span><span class=cFC>RDX</span><span class=cF0>, </span><span class=cF9>U64</span><span class=cF0> </span><span class=cF9>CHashFun</span><span class=cF0>.exe_addr[</span><span class=cFC>RAX</span><span class=cF0>]
<a name="l23"></a>
<a name="l24"></a> </span><span class=cF1>MOV</span><span class=cF0> </span><span class=cFC>RCX</span><span class=cF0>, </span><span class=cF9>U64</span><span class=cF0> </span><span class=cF3>SF_ARG1</span><span class=cF0>[</span><span class=cFC>RBP</span><span class=cF0>] </span><span class=cF2>// argc</span><span class=cF0>
<a name="l25"></a> </span><span class=cF1>MOV</span><span class=cF0> </span><span class=cFC>RSI</span><span class=cF0>, </span><span class=cF9>U64</span><span class=cF0> </span><span class=cF3>SF_ARG2</span><span class=cF0>[</span><span class=cFC>RBP</span><span class=cF0>] </span><span class=cF2>// argv</span><span class=cF0>
<a name="l26"></a> </span><span class=cF1>SHL</span><span class=cF0> </span><span class=cFC>RCX</span><span class=cF0>, </span><span class=cFE>3</span><span class=cF0>
<a name="l27"></a> </span><span class=cF1>SUB</span><span class=cF0> </span><span class=cFC>RSP</span><span class=cF0>, </span><span class=cFC>RCX</span><span class=cF0>
<a name="l28"></a> </span><span class=cF1>MOV</span><span class=cF0> </span><span class=cFC>RDI</span><span class=cF0>, </span><span class=cFC>RSP</span><span class=cF0>
<a name="l29"></a> </span><span class=cF1>REP_MOVSB</span><span class=cF0>
<a name="l30"></a> </span><span class=cF1>TEST</span><span class=cF0> </span><span class=cFC>RDX</span><span class=cF0>, </span><span class=cFC>RDX</span><span class=cF0>
<a name="l31"></a> </span><span class=cF1>JZ</span><span class=cF0> @@05
<a name="l32"></a>
<a name="l33"></a> </span><span class=cF1>CALL</span><span class=cF0> </span><span class=cFC>RDX</span><span class=cF0>
<a name="l34"></a> </span><span class=cF1>POP</span><span class=cF0> </span><span class=cFC>RDI</span><span class=cF0>
<a name="l35"></a> </span><span class=cF1>POP</span><span class=cF0> </span><span class=cFC>RSI</span><span class=cF0>
<a name="l36"></a> </span><span class=cF1>POP</span><span class=cF0> </span><span class=cFC>RBP</span><span class=cF0>
<a name="l37"></a> </span><span class=cF1>RET1</span><span class=cF0> </span><span class=cFE>16</span><span class=cF0>
<a name="l38"></a>
<a name="l39"></a>@@05: </span><span class=cF1>MOV</span><span class=cF0> </span><span class=cFC>RCX</span><span class=cF0>, </span><span class=cF9>U64</span><span class=cF0> </span><span class=cF3>SF_ARG1</span><span class=cF0>[</span><span class=cFC>RBP</span><span class=cF0>] </span><span class=cF2>// argc</span><span class=cF0>
<a name="l40"></a> </span><span class=cF1>SHL</span><span class=cF0> </span><span class=cFC>RCX</span><span class=cF0>, </span><span class=cFE>3</span><span class=cF0>
<a name="l41"></a> </span><span class=cF1>ADD</span><span class=cF0> </span><span class=cFC>RSP</span><span class=cF0>, </span><span class=cFC>RCX</span><span class=cF0>
<a name="l42"></a> </span><span class=cF1>XOR</span><span class=cF0> </span><span class=cFC>RAX</span><span class=cF0>, </span><span class=cFC>RAX</span><span class=cF0>
<a name="l43"></a>@@10: </span><span class=cF1>POP</span><span class=cF0> </span><span class=cFC>RDI</span><span class=cF0>
<a name="l44"></a> </span><span class=cF1>POP</span><span class=cF0> </span><span class=cFC>RSI</span><span class=cF0>
<a name="l45"></a> </span><span class=cF1>POP</span><span class=cF0> </span><span class=cFC>RBP</span><span class=cF0>
<a name="l46"></a> </span><span class=cF1>RET1</span><span class=cF0> </span><span class=cFE>16</span><span class=cF0>
<a name="l47"></a>}
<a name="l48"></a></span><span class=cF1>_extern</span><span class=cF0> </span><span class=cFD>_LAST_FUN</span><span class=cF0> </span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>LastFun</span><span class=cF0>(</span><span class=cF9>I64</span><span class=cF0> argc, </span><span class=cF9>I64</span><span class=cF0> *argv); </span><span class=cF2>//Execute last function with args.</span><span class=cF0>
<a name="l49"></a>
<a name="l50"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>PassTrace</span><span class=cF0>(</span><span class=cF9>I64</span><span class=cF0> i=</span><span class=cFE>0b10001111101</span><span class=cF0>)
<a name="l51"></a>{</span><span class=cF2>//Ctrls which optimizer passes are displayed.</span><span class=cF0>
<a name="l52"></a> </span><span class=cF9>I64</span><span class=cF0> old = </span><span class=cF5>Fs</span><span class=cF0>-&gt;last_cc-&gt;pass_trace;
<a name="l53"></a>
<a name="l54"></a> </span><span class=cF1>if</span><span class=cF0> (i)
<a name="l55"></a> </span><span class=cF5>Fs</span><span class=cF0>-&gt;last_cc-&gt;saved_pass_trace = i;
<a name="l56"></a> </span><span class=cF5>Fs</span><span class=cF0>-&gt;last_cc-&gt;pass_trace = i;
<a name="l57"></a>
<a name="l58"></a> </span><span class=cF1>return</span><span class=cF0> old;
<a name="l59"></a>}
<a name="l60"></a>
<a name="l61"></a></span><span class=cF1>Bool</span><span class=cF0> </span><span class=cF5>Trace</span><span class=cF0>(</span><span class=cF1>Bool</span><span class=cF0> val=</span><span class=cF3>ON</span><span class=cF0>)
<a name="l62"></a>{</span><span class=cF2>//Displays assembly code output from compiler.</span><span class=cF0>
<a name="l63"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF5>Option</span><span class=cF0>(</span><span class=cF3>OPTf_TRACE</span><span class=cF0>, val);
<a name="l64"></a>}
<a name="l65"></a>
<a name="l66"></a></span><span class=cF1>Bool</span><span class=cF0> </span><span class=cF5>Echo</span><span class=cF0>(</span><span class=cF1>Bool</span><span class=cF0> val)
<a name="l67"></a>{</span><span class=cF2>//Displays text as it is being compiled.</span><span class=cF0>
<a name="l68"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF5>Option</span><span class=cF0>(</span><span class=cF3>OPTf_ECHO</span><span class=cF0>, val);
<a name="l69"></a>}
<a name="l70"></a>
<a name="l71"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>StreamPrint</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *format, ...)
<a name="l72"></a>{</span><span class=cF2>//Injects text into the compile stream. Used in #exe{} blocks.</span><span class=cF0>
<a name="l73"></a> </span><span class=cF1>U8</span><span class=cF0> *buf = </span><span class=cF5>StrPrintJoin</span><span class=cF0>(</span><span class=cF3>NULL</span><span class=cF0>, format, argc, argv), *st;
<a name="l74"></a> </span><span class=cF9>CCompCtrl</span><span class=cF0> *cc = </span><span class=cF5>Fs</span><span class=cF0>-&gt;last_cc;
<a name="l75"></a> </span><span class=cF9>CStreamBlk</span><span class=cF0> *tmpe = cc-&gt;last_stream_blk;
<a name="l76"></a>
<a name="l77"></a> </span><span class=cF1>if</span><span class=cF0> (tmpe != &amp;cc-&gt;next_stream_blk)
<a name="l78"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l79"></a> st = </span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>&quot;%s%s&quot;</span><span class=cF0>, tmpe-&gt;body, buf);
<a name="l80"></a> </span><span class=cF5>Free</span><span class=cF0>(tmpe-&gt;body);
<a name="l81"></a> tmpe-&gt;body = st;
<a name="l82"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l83"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l84"></a> </span><span class=cF5>PrintErr</span><span class=cF0>(</span><span class=cF6>&quot;No exe{} block\n&quot;</span><span class=cF0>);
<a name="l85"></a> </span><span class=cF5>Free</span><span class=cF0>(buf);
<a name="l86"></a>}
<a name="l87"></a>
<a name="l88"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>StreamDir</span><span class=cF0>()
<a name="l89"></a>{
<a name="l90"></a> </span><span class=cF1>U8</span><span class=cF0> *dirname;
<a name="l91"></a>
<a name="l92"></a> </span><span class=cF1>if</span><span class=cF0> (dirname = </span><span class=cF5>DirFile</span><span class=cF7>(</span><span class=cF5>Fs</span><span class=cF0>-&gt;last_cc-&gt;lex_include_stack-&gt;full_name</span><span class=cF7>)</span><span class=cF0>)
<a name="l93"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l94"></a> </span><span class=cF5>StreamPrint</span><span class=cF0>(</span><span class=cF6>&quot;\&quot;%s\&quot;&quot;</span><span class=cF0>, dirname);
<a name="l95"></a> </span><span class=cF5>Free</span><span class=cF0>(dirname);
<a name="l96"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l97"></a>}
<a name="l98"></a>
<a name="l99"></a></span><span class=cF9>CD2I32</span><span class=cF0> *</span><span class=cF5>LexD2I32</span><span class=cF0>(</span><span class=cF9>CCompCtrl</span><span class=cF0> *cc, </span><span class=cF9>CD2I32</span><span class=cF0> *p)
<a name="l100"></a>{</span><span class=cF2>//Not CosmiC. Sprite-like lex 2D point.</span><span class=cF0>
<a name="l101"></a> </span><span class=cF1>if</span><span class=cF0> (cc-&gt;token != </span><span class=cF6>'('</span><span class=cF0>)
<a name="l102"></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="l103"></a> </span><span class=cF5>Lex</span><span class=cF0>(cc); </span><span class=cF2>// Skip (</span><span class=cF0>
<a name="l104"></a> p-&gt;x = </span><span class=cF5>LexExpressionI64</span><span class=cF0>(cc);
<a name="l105"></a> </span><span class=cF1>if</span><span class=cF0> (cc-&gt;token != </span><span class=cF6>','</span><span class=cF0>)
<a name="l106"></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="l107"></a> </span><span class=cF5>Lex</span><span class=cF0>(cc); </span><span class=cF2>// Skip ,</span><span class=cF0>
<a name="l108"></a> p-&gt;y = </span><span class=cF5>LexExpressionI64</span><span class=cF0>(cc);
<a name="l109"></a> </span><span class=cF1>if</span><span class=cF0> (cc-&gt;token != </span><span class=cF6>')'</span><span class=cF0>)
<a name="l110"></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="l111"></a> </span><span class=cF5>Lex</span><span class=cF0>(cc); </span><span class=cF2>// Skip )</span><span class=cF0>
<a name="l112"></a>
<a name="l113"></a> </span><span class=cF1>return</span><span class=cF0> p;
<a name="l114"></a>}
<a name="l115"></a>
<a name="l116"></a></span><span class=cF9>CD3I32</span><span class=cF0> *</span><span class=cF5>LexD3I32</span><span class=cF0>(</span><span class=cF9>CCompCtrl</span><span class=cF0> *cc,</span><span class=cF9>CD3I32</span><span class=cF0> *p)
<a name="l117"></a>{</span><span class=cF2>//Not CosmiC. Sprite-like lex 3D point.</span><span class=cF0>
<a name="l118"></a> </span><span class=cF1>if</span><span class=cF0> (cc-&gt;token != </span><span class=cF6>'('</span><span class=cF0>)
<a name="l119"></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="l120"></a> </span><span class=cF5>Lex</span><span class=cF0>(cc); </span><span class=cF2>// Skip (</span><span class=cF0>
<a name="l121"></a> p-&gt;x = </span><span class=cF5>LexExpressionI64</span><span class=cF0>(cc);
<a name="l122"></a> </span><span class=cF1>if</span><span class=cF0> (cc-&gt;token != </span><span class=cF6>','</span><span class=cF0>)
<a name="l123"></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="l124"></a> </span><span class=cF5>Lex</span><span class=cF0>(cc); </span><span class=cF2>// Skip ,</span><span class=cF0>
<a name="l125"></a> p-&gt;y = </span><span class=cF5>LexExpressionI64</span><span class=cF0>(cc);
<a name="l126"></a> </span><span class=cF1>if</span><span class=cF0> (cc-&gt;token != </span><span class=cF6>','</span><span class=cF0>)
<a name="l127"></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="l128"></a> </span><span class=cF5>Lex</span><span class=cF0>(cc); </span><span class=cF2>// Skip ,</span><span class=cF0>
<a name="l129"></a> p-&gt;z = </span><span class=cF5>LexExpressionI64</span><span class=cF0>(cc);
<a name="l130"></a> </span><span class=cF1>if</span><span class=cF0> (cc-&gt;token != </span><span class=cF6>')'</span><span class=cF0>)
<a name="l131"></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="l132"></a> </span><span class=cF5>Lex</span><span class=cF0>(cc); </span><span class=cF2>// Skip )</span><span class=cF0>
<a name="l133"></a>
<a name="l134"></a> </span><span class=cF1>return</span><span class=cF0> p;
<a name="l135"></a>}
<a name="l136"></a>
<a name="l137"></a></span><span class=cF1>U8</span><span class=cF0> *</span><span class=cFD>CmdLinePrompt</span><span class=cF0>()
<a name="l138"></a>{
<a name="l139"></a> </span><span class=cF9>I64</span><span class=cF0> i;
<a name="l140"></a> </span><span class=cF1>U8</span><span class=cF0> *res, *st;
<a name="l141"></a>
<a name="l142"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Fs</span><span class=cF0>-&gt;new_answer)
<a name="l143"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l144"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Fs</span><span class=cF0>-&gt;answer_type &amp; ~</span><span class=cFE>1</span><span class=cF0> != </span><span class=cF3>RT_I0</span><span class=cF0>)
<a name="l145"></a> {
<a name="l146"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Fs</span><span class=cF0>-&gt;answer_type == </span><span class=cF3>RT_F64</span><span class=cF0>)
<a name="l147"></a> </span><span class=cF6>&quot;%8.6fs ansf=%15.7g\n&quot;</span><span class=cF0>, </span><span class=cF5>Fs</span><span class=cF0>-&gt;answer_time, </span><span class=cF5>Fs</span><span class=cF0>-&gt;answer;
<a name="l148"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l149"></a> </span><span class=cF6>&quot;%8.6fs ans=0x%08X=%d\n&quot;</span><span class=cF0>, </span><span class=cF5>Fs</span><span class=cF0>-&gt;answer_time, </span><span class=cF5>Fs</span><span class=cF0>-&gt;answer, </span><span class=cF5>Fs</span><span class=cF0>-&gt;answer;
<a name="l150"></a> }
<a name="l151"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l152"></a> {
<a name="l153"></a> </span><span class=cF6>&quot;%8.6fs\n&quot;</span><span class=cF0>, </span><span class=cF5>Fs</span><span class=cF0>-&gt;answer_time;
<a name="l154"></a> </span><span class=cF5>Fs</span><span class=cF0>-&gt;answer = </span><span class=cFE>0</span><span class=cF0>;
<a name="l155"></a> }
<a name="l156"></a> </span><span class=cF5>Fs</span><span class=cF0>-&gt;new_answer = </span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l157"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l158"></a> </span><span class=cF1>if</span><span class=cF0> (st = </span><span class=cF5>DirCur</span><span class=cF0>)
<a name="l159"></a> </span><span class=cF7>{</span><span class=cF0>
<a name="l160"></a> </span><span class=cF6>&quot;%s&quot;</span><span class=cF0>, st;
<a name="l161"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
<a name="l162"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l163"></a> </span><span class=cF6>'&gt;'</span><span class=cF0>;
<a name="l164"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>IsDebugMode</span><span class=cF0> &amp;&amp; </span><span class=cF5>IsRaw</span><span class=cF0>)
<a name="l165"></a> </span><span class=cF5>RawDr</span><span class=cF0>;
<a name="l166"></a>
<a name="l167"></a> </span><span class=cF5>LBts</span><span class=cF0>(&amp;</span><span class=cF5>Fs</span><span class=cF0>-&gt;task_flags, </span><span class=cF3>TASKf_CMD_LINE_PROMPT</span><span class=cF0>);
<a name="l168"></a> st = </span><span class=cF5>StrGet</span><span class=cF0>(,, </span><span class=cF3>SGF_SHIFT_ESC_EXIT</span><span class=cF0>);
<a name="l169"></a> </span><span class=cF5>LBtr</span><span class=cF0>(&amp;</span><span class=cF5>Fs</span><span class=cF0>-&gt;task_flags, </span><span class=cF3>TASKf_CMD_LINE_PROMPT</span><span class=cF0>);
<a name="l170"></a>
<a name="l171"></a> i = </span><span class=cF5>StrLen</span><span class=cF0>(st);
<a name="l172"></a> res = </span><span class=cF5>MAlloc</span><span class=cF0>(i + </span><span class=cFE>1</span><span class=cF0> + </span><span class=cFE>2</span><span class=cF0>);
<a name="l173"></a> </span><span class=cF5>MemCopy</span><span class=cF0>(res, st, i + </span><span class=cFE>1</span><span class=cF0>);
<a name="l174"></a> i--;
<a name="l175"></a> </span><span class=cF1>while</span><span class=cF0> (i &gt;= </span><span class=cFE>0</span><span class=cF0> &amp;&amp; </span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>char_bmp_white_space</span><span class=cF0>, res[i]</span><span class=cF7>)</span><span class=cF0>)
<a name="l176"></a> i--;
<a name="l177"></a> i++;
<a name="l178"></a> </span><span class=cF1>if</span><span class=cF0> (i &gt; </span><span class=cFE>0</span><span class=cF0> &amp;&amp; res[i - </span><span class=cFE>1</span><span class=cF0>] == </span><span class=cF6>';'</span><span class=cF0>)
<a name="l179"></a> res[i++] = </span><span class=cF6>';'</span><span class=cF0>; </span><span class=cF2>// The Lex goes one beyond</span><span class=cF0>
<a name="l180"></a> res[i++] = </span><span class=cF6>'\n'</span><span class=cF0>; </span><span class=cF2>// #define goes to '\n'</span><span class=cF0>
<a name="l181"></a> res[i] = </span><span class=cFE>0</span><span class=cF0>;
<a name="l182"></a>
<a name="l183"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
<a name="l184"></a>
<a name="l185"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l186"></a>}
</span></pre></body>
</html>