diff --git a/compiler/aasmtai.pas b/compiler/aasmtai.pas index 1ad518025d..dc6317c807 100644 --- a/compiler/aasmtai.pas +++ b/compiler/aasmtai.pas @@ -175,7 +175,8 @@ interface localsymofs : longint; localindexreg : tregister; localscale : byte; - localgetoffset : boolean + localgetoffset, + localforceref : boolean end; plocaloper = ^tlocaloper; @@ -540,7 +541,7 @@ interface procedure allocate_oper(opers:longint); procedure loadconst(opidx:longint;l:aint); procedure loadsymbol(opidx:longint;s:tasmsymbol;sofs:longint); - procedure loadlocal(opidx:longint;s:pointer;sofs:longint;indexreg:tregister;scale:byte;getoffset:boolean); + procedure loadlocal(opidx:longint;s:pointer;sofs:longint;indexreg:tregister;scale:byte;getoffset,forceref:boolean); procedure loadref(opidx:longint;const r:treference); procedure loadreg(opidx:longint;r:tregister); procedure loadoper(opidx:longint;o:toper); @@ -1847,7 +1848,7 @@ implementation end; - procedure tai_cpu_abstract.loadlocal(opidx:longint;s:pointer;sofs:longint;indexreg:tregister;scale:byte;getoffset:boolean); + procedure tai_cpu_abstract.loadlocal(opidx:longint;s:pointer;sofs:longint;indexreg:tregister;scale:byte;getoffset,forceref:boolean); begin if not assigned(s) then internalerror(200204251); @@ -1866,6 +1867,7 @@ implementation localindexreg:=indexreg; localscale:=scale; localgetoffset:=getoffset; + localforceref:=forceref; end; typ:=top_local; end; @@ -2234,7 +2236,10 @@ begin end. { $Log$ - Revision 1.92 2004-11-01 10:34:08 peter + Revision 1.93 2005-01-31 17:07:50 peter + * fix [regpara] in intel assembler + + Revision 1.92 2004/11/01 10:34:08 peter * regalloc bind to instructions need to get real ait_instruction Revision 1.91 2004/10/15 09:14:16 mazen diff --git a/compiler/i386/ra386int.pas b/compiler/i386/ra386int.pas index 9e4992bae9..390771f0b4 100644 --- a/compiler/i386/ra386int.pas +++ b/compiler/i386/ra386int.pas @@ -1171,7 +1171,13 @@ Unit Ra386int; oper.SetSize(typesize,true); end else - if not oper.SetupVar(tempstr,GotOffset) then + if oper.SetupVar(tempstr,GotOffset) then + begin + { force OPR_LOCAL to be a reference } + if oper.opr.typ=OPR_LOCAL then + oper.opr.localforceref:=true; + end + else Message1(sym_e_unknown_id,tempstr); { record.field ? } if actasmtoken=AS_DOT then @@ -1521,6 +1527,15 @@ Unit Ra386int; end; end; + { Word,Dword,etc shall now be seen as normal (pascal) typename identifiers } + case actasmtoken of + AS_DWORD, + AS_BYTE, + AS_WORD, + AS_QWORD : + actasmtoken:=AS_ID; + end; + case actasmtoken of AS_OFFSET, @@ -2045,7 +2060,10 @@ begin end. { $Log$ - Revision 1.87 2005-01-25 18:48:34 peter + Revision 1.88 2005-01-31 17:07:50 peter + * fix [regpara] in intel assembler + + Revision 1.87 2005/01/25 18:48:34 peter * spaces in register names Revision 1.86 2005/01/20 17:05:53 peter diff --git a/compiler/ncgbas.pas b/compiler/ncgbas.pas index bc781330ac..a9f3cad209 100644 --- a/compiler/ncgbas.pas +++ b/compiler/ncgbas.pas @@ -138,6 +138,7 @@ interface {$ifdef x86} scale : byte; {$endif x86} + forceref, getoffset : boolean; indexreg : tregister; sofs : longint; @@ -150,6 +151,7 @@ interface scale:=op.localoper^.localscale; {$endif x86} getoffset:=op.localoper^.localgetoffset; + forceref:=op.localoper^.localforceref; sym:=tabstractnormalvarsym(pointer(op.localoper^.localsym)); dispose(op.localoper); case sym.localloc.loc of @@ -185,11 +187,16 @@ interface if getoffset then Message(asmr_e_invalid_reference_syntax); { Subscribed access } - if sofs<>0 then + if forceref or + (sofs<>0) then begin op.typ:=top_ref; new(op.ref); reference_reset_base(op.ref^,sym.localloc.register,sofs); + op.ref^.index:=indexreg; +{$ifdef x86} + op.ref^.scalefactor:=scale; +{$endif x86} end else begin @@ -495,7 +502,10 @@ begin end. { $Log$ - Revision 1.74 2004-12-12 12:56:18 peter + Revision 1.75 2005-01-31 17:07:50 peter + * fix [regpara] in intel assembler + + Revision 1.74 2004/12/12 12:56:18 peter * compile fixes for x86_64 Revision 1.73 2004/12/03 16:04:47 peter diff --git a/compiler/rautils.pas b/compiler/rautils.pas index 580f6810d9..24b843869b 100644 --- a/compiler/rautils.pas +++ b/compiler/rautils.pas @@ -74,7 +74,7 @@ type OPR_CONSTANT : (val:aint); OPR_SYMBOL : (symbol:tasmsymbol;symofs:aint); OPR_REFERENCE : (ref:treference); - OPR_LOCAL : (localsym:tabstractnormalvarsym;localsymofs:aint;localindexreg:tregister;localscale:byte;localgetoffset:boolean); + OPR_LOCAL : (localsym:tabstractnormalvarsym;localsymofs:aint;localindexreg:tregister;localscale:byte;localgetoffset,localforceref:boolean); OPR_REGISTER : (reg:tregister); {$ifdef m68k} OPR_REGLIST : (regset : tcpuregisterset); @@ -1049,7 +1049,7 @@ end; ai.loadsymbol(i-1,symbol,symofs); OPR_LOCAL : ai.loadlocal(i-1,localsym,localsymofs,localindexreg, - localscale,localgetoffset); + localscale,localgetoffset,localforceref); OPR_REFERENCE: ai.loadref(i-1,ref); {$ifdef ARM} @@ -1569,7 +1569,10 @@ end; end. { $Log$ - Revision 1.102 2005-01-20 17:05:53 peter + Revision 1.103 2005-01-31 17:07:50 peter + * fix [regpara] in intel assembler + + Revision 1.102 2005/01/20 17:05:53 peter * use val() for decoding integers Revision 1.101 2005/01/19 22:19:41 peter diff --git a/compiler/x86/rax86.pas b/compiler/x86/rax86.pas index 0e1a089334..cfe632c381 100644 --- a/compiler/x86/rax86.pas +++ b/compiler/x86/rax86.pas @@ -677,8 +677,9 @@ begin OPR_SYMBOL: ai.loadsymbol(i-1,operands[i].opr.symbol,operands[i].opr.symofs); OPR_LOCAL : - ai.loadlocal(i-1,operands[i].opr.localsym,operands[i].opr.localsymofs,operands[i].opr.localindexreg, - operands[i].opr.localscale,operands[i].opr.localgetoffset); + with operands[i].opr do + ai.loadlocal(i-1,localsym,localsymofs,localindexreg, + localscale,localgetoffset,localforceref); OPR_REFERENCE: begin ai.loadref(i-1,operands[i].opr.ref); @@ -742,7 +743,10 @@ end; end. { $Log$ - Revision 1.20 2004-10-31 21:45:04 peter + Revision 1.21 2005-01-31 17:07:50 peter + * fix [regpara] in intel assembler + + Revision 1.20 2004/10/31 21:45:04 peter * generic tlocation * move tlocation to cgutils