mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2025-06-07 08:14:48 +00:00
Asm.CC clean up
This commit is contained in:
parent
49053b326b
commit
2707d9e157
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -151,7 +151,7 @@ pe_check_binary_ops2:
|
|||||||
if (stack_op.u16[0]==IC_DEREF && tmpc->ptr_stars_count)
|
if (stack_op.u16[0]==IC_DEREF && tmpc->ptr_stars_count)
|
||||||
tmpc--;
|
tmpc--;
|
||||||
else if (stack_op.u16[0]==IC_ADDR) {
|
else if (stack_op.u16[0]==IC_ADDR) {
|
||||||
cc->abs_counts.c_addres++;
|
cc->abs_counts.c_address++;
|
||||||
if (intermediate_code_table[tmpi->ic_code].type==IST_DEREF)
|
if (intermediate_code_table[tmpi->ic_code].type==IST_DEREF)
|
||||||
OptFree(tmpi);
|
OptFree(tmpi);
|
||||||
tmpc++;
|
tmpc++;
|
||||||
@ -644,12 +644,12 @@ I64 ParseUnaryTerm(CCompCtrl *cc,CParseStack *ps,CMemberList **_local_var,
|
|||||||
ICAdd(cc,IC_ABS_ADDR,
|
ICAdd(cc,IC_ABS_ADDR,
|
||||||
tmpf->exe_addr,comp.internal_types[RT_PTR]);
|
tmpf->exe_addr,comp.internal_types[RT_PTR]);
|
||||||
if (cc->flags&CCF_ASM_EXPRESSIONS)
|
if (cc->flags&CCF_ASM_EXPRESSIONS)
|
||||||
cc->abs_counts.abs_addres++;
|
cc->abs_counts.abs_address++;
|
||||||
} else
|
} else
|
||||||
ICAdd(cc,IC_IMM_I64,
|
ICAdd(cc,IC_IMM_I64,
|
||||||
tmpf->exe_addr,comp.internal_types[RT_PTR]);
|
tmpf->exe_addr,comp.internal_types[RT_PTR]);
|
||||||
}
|
}
|
||||||
cc->abs_counts.c_addres++;
|
cc->abs_counts.c_address++;
|
||||||
Lex(cc);
|
Lex(cc);
|
||||||
return PE_MAYBE_MODIFIERS;
|
return PE_MAYBE_MODIFIERS;
|
||||||
}
|
}
|
||||||
@ -657,7 +657,7 @@ I64 ParseUnaryTerm(CCompCtrl *cc,CParseStack *ps,CMemberList **_local_var,
|
|||||||
tmpex=tmpc;
|
tmpex=tmpc;
|
||||||
if (cc->flags&CCF_ASM_EXPRESSIONS &&
|
if (cc->flags&CCF_ASM_EXPRESSIONS &&
|
||||||
!(cc->flags&CCF_AOT_COMPILE) && tmpex->type&HTF_IMM) {
|
!(cc->flags&CCF_AOT_COMPILE) && tmpex->type&HTF_IMM) {
|
||||||
cc->abs_counts.c_addres++;
|
cc->abs_counts.c_address++;
|
||||||
ICAdd(cc,IC_IMM_I64,
|
ICAdd(cc,IC_IMM_I64,
|
||||||
tmpex->val,comp.internal_types[RT_PTR]);
|
tmpex->val,comp.internal_types[RT_PTR]);
|
||||||
Lex(cc);
|
Lex(cc);
|
||||||
@ -706,7 +706,7 @@ I64 ParseUnaryTerm(CCompCtrl *cc,CParseStack *ps,CMemberList **_local_var,
|
|||||||
break;
|
break;
|
||||||
case '$$':
|
case '$$':
|
||||||
if (cc->flags & CCF_ASM_EXPRESSIONS) {
|
if (cc->flags & CCF_ASM_EXPRESSIONS) {
|
||||||
cc->abs_counts.abs_addres++;
|
cc->abs_counts.abs_address++;
|
||||||
if (cc->flags&CCF_AOT_COMPILE)
|
if (cc->flags&CCF_AOT_COMPILE)
|
||||||
ICAdd(cc,IC_ABS_ADDR,cc->aotc->rip,comp.internal_types[RT_PTR]);
|
ICAdd(cc,IC_ABS_ADDR,cc->aotc->rip,comp.internal_types[RT_PTR]);
|
||||||
else
|
else
|
||||||
@ -833,7 +833,7 @@ pu_export_sys_sym:
|
|||||||
if (PREC_TERM>*max_prec)
|
if (PREC_TERM>*max_prec)
|
||||||
*max_prec=PREC_TERM;
|
*max_prec=PREC_TERM;
|
||||||
if (!(tmpex->type & (HTF_IMM|HTF_IMPORT)))
|
if (!(tmpex->type & (HTF_IMM|HTF_IMPORT)))
|
||||||
cc->abs_counts.abs_addres++;
|
cc->abs_counts.abs_address++;
|
||||||
if (tmpex->type & HTF_UNRESOLVED) {
|
if (tmpex->type & HTF_UNRESOLVED) {
|
||||||
if (!(cc->flags&CCF_ASM_EXPRESSIONS))
|
if (!(cc->flags&CCF_ASM_EXPRESSIONS))
|
||||||
LexExcept(cc,"Illegal forward ref at ");
|
LexExcept(cc,"Illegal forward ref at ");
|
||||||
@ -853,7 +853,7 @@ pu_export_sys_sym:
|
|||||||
ICAdd(cc,IC_ABS_ADDR,tmpex->val,comp.internal_types[RT_PTR]);
|
ICAdd(cc,IC_ABS_ADDR,tmpex->val,comp.internal_types[RT_PTR]);
|
||||||
else {
|
else {
|
||||||
if (tmpex->type&HTF_IMM)
|
if (tmpex->type&HTF_IMM)
|
||||||
cc->abs_counts.c_addres++;
|
cc->abs_counts.c_address++;
|
||||||
ICAdd(cc,IC_IMM_I64,tmpex->val,comp.internal_types[RT_PTR]);
|
ICAdd(cc,IC_IMM_I64,tmpex->val,comp.internal_types[RT_PTR]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
In("CC\n\n1\n\n6\n\n\n");
|
In("CC\n\n1\n\n5\n\n\n");
|
||||||
BootHDIns;
|
BootHDIns;
|
||||||
"\n\nSuccessful? ";
|
"\n\nSuccessful? ";
|
||||||
if(YorN)
|
if(YorN)
|
||||||
|
@ -91,8 +91,8 @@ CORE0_32BIT_INIT:: //Entry point for $LK,"BootRAM",A="MN:BootRAM"$.
|
|||||||
MOV ESP, BOOT_RAM_LIMIT //Tmp Stack
|
MOV ESP, BOOT_RAM_LIMIT //Tmp Stack
|
||||||
|
|
||||||
//Patch abs addresses
|
//Patch abs addresses
|
||||||
MOV ECX, U32 CPatchTableAbsAddr.abs_addres_count[ESI]
|
MOV ECX, U32 CPatchTableAbsAddr.abs_address_count[ESI]
|
||||||
LEA ESI, U32 CPatchTableAbsAddr.abs_addres[ESI]
|
LEA ESI, U32 CPatchTableAbsAddr.abs_address[ESI]
|
||||||
@@05: LODSD
|
@@05: LODSD
|
||||||
ADD EAX, EDI
|
ADD EAX, EDI
|
||||||
ADD U32 [EAX],EDI
|
ADD U32 [EAX],EDI
|
||||||
|
@ -440,9 +440,9 @@ class CBinFile
|
|||||||
class CPatchTableAbsAddr
|
class CPatchTableAbsAddr
|
||||||
{
|
{
|
||||||
U8 eit_abs_addr; //$LK,"IET_ABS_ADDR",A="MN:IET_ABS_ADDR"$
|
U8 eit_abs_addr; //$LK,"IET_ABS_ADDR",A="MN:IET_ABS_ADDR"$
|
||||||
U32 abs_addres_count;
|
U32 abs_address_count;
|
||||||
U8 zero;
|
U8 zero;
|
||||||
U32 abs_addres[1];
|
U32 abs_address[1];
|
||||||
};
|
};
|
||||||
|
|
||||||
//$LK,"CAOTImportExport",A="MN:CAOTImportExport"$ Types. Used in PatchTable.
|
//$LK,"CAOTImportExport",A="MN:CAOTImportExport"$ Types. Used in PatchTable.
|
||||||
@ -1940,8 +1940,8 @@ class CAOTBinBlk
|
|||||||
|
|
||||||
I64 class CAbsCountsI64
|
I64 class CAbsCountsI64
|
||||||
{
|
{
|
||||||
U16 abs_addres, //Only odd/even matters. Count of absolute addres in an exp.
|
U16 abs_address, //Only odd/even matters. Count of absolute address in an exp.
|
||||||
c_addres; //Only odd/even matters. Count of C addres in an exp.
|
c_address; //Only odd/even matters. Count of C address in an exp.
|
||||||
U32 externs; //Only nonzero matters. Some regions have externs banned.
|
U32 externs; //Only nonzero matters. Some regions have externs banned.
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1962,7 +1962,7 @@ class CAsmNum
|
|||||||
class CAsmNum2
|
class CAsmNum2
|
||||||
{
|
{
|
||||||
CAsmNum num;
|
CAsmNum num;
|
||||||
I64 U8_count,rel;
|
I64 u8_count,rel;
|
||||||
Bool imm_flag;
|
Bool imm_flag;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1970,7 +1970,7 @@ class CAsmInst
|
|||||||
{
|
{
|
||||||
CInst *tmpins;
|
CInst *tmpins;
|
||||||
CAsmNum2 imm,disp;
|
CAsmNum2 imm,disp;
|
||||||
I64 U8_count,last_opcode_U8,
|
I64 u8_count,last_opcode_U8,
|
||||||
REX,ModrM,SIB;
|
REX,ModrM,SIB;
|
||||||
Bool has_REX,has_ModrM,has_SIB,
|
Bool has_REX,has_ModrM,has_SIB,
|
||||||
has_addr_prefix,
|
has_addr_prefix,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user