TempleOSCDV4.09.ISO

This commit is contained in:
Terry A. Davis authored and minexew committed 2018-09-08 21:47:32 +02:00
1 parent 2d56cda5f3
commit 353eac0dbe
88 files changed
+2449 -2043

No files matched your search

+46 -7
View File
@@ -1,18 +1,57 @@
Bool Option(I64 num,Bool val)
{//Set compiler $LK,"Option",A="FI:::/Doc/Options.TXT"$ to val.
return BEqu(&Fs->last_lex->opts,num,val);
return BEqu(&Fs->last_cc->opts,num,val);
}
Bool GetOption(I64 num)
{//Get state of compiler $LK,"option",A="MN:OPTf_ECHO"$.
return Bt(&Fs->last_lex->opts,num);
return Bt(&Fs->last_cc->opts,num);
}
asm {
_LAST_FUN:: //See $LK,"_CALL_IND",A="MN:_CALL_IND"$
PUSH RBP
MOV RBP,RSP
PUSH RSI
PUSH RDI
XOR RAX,RAX
MOV RAX,FS:CTask.last_fun[RAX]
TEST RAX,RAX
JZ @@10
MOV RDX,U64 CHashFun.exe_addr[RAX]
MOV RCX,U64 SF_ARG1[RBP] //argc
MOV RSI,U64 SF_ARG2[RBP] //argv
SHL RCX,3
SUB RSP,RCX
MOV RDI,RSP
REP_MOVSB
TEST RDX,RDX
JZ @@05
CALL RDX
POP RDI
POP RSI
POP RBP
RET1 16
@@05: MOV RCX,U64 SF_ARG1[RBP] //argc
SHL RCX,3
ADD RSP,RCX
XOR RAX,RAX
@@10: POP RDI
POP RSI
POP RBP
RET1 16
}
_extern _LAST_FUN I64 LastFun(I64 argc,I64 *argv); //Execute last fun with args.
I64 PassTrace(I64 i=0b10001111101)
{//Ctrls which optimizer passes are displayed.
I64 old=Fs->last_lex->pass_trace;
if (i) Fs->last_lex->saved_pass_trace=i;
Fs->last_lex->pass_trace=i;
I64 old=Fs->last_cc->pass_trace;
if (i) Fs->last_cc->saved_pass_trace=i;
Fs->last_cc->pass_trace=i;
return old;
}
@@ -29,7 +68,7 @@ Bool Echo(Bool val)
U0 StreamPrint(U8 *fmt,...)
{//Injects text into the compile stream. Used in #exe{} blocks.
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv),*st;
CCmpCtrl *cc=Fs->last_lex;
CCmpCtrl *cc=Fs->last_cc;
CStreamBlk *tempe=cc->last_stream_blk;
if (tempe!=&cc->next_stream_blk) {
st=MStrPrint("%s%s",tempe->body,buf);
@@ -43,7 +82,7 @@ U0 StreamPrint(U8 *fmt,...)
U0 StreamDir()
{
U8 *dirname;
if (dirname=DirFile(Fs->last_lex->lex_include_stk->full_name)) {
if (dirname=DirFile(Fs->last_cc->lex_include_stk->full_name)) {
StreamPrint("\"%s\"",dirname);
Free(dirname);
}