* updates for ag386bin

This commit is contained in:
peter 1999-02-22 02:14:59 +00:00
parent 54adf4622c
commit bf9b5e3a54
39 changed files with 562 additions and 287 deletions

View File

@ -445,7 +445,7 @@ unit ag386int;
AsmWritePChar(pai_direct(hp)^.str); AsmWritePChar(pai_direct(hp)^.str);
AsmLn; AsmLn;
end; end;
ait_labeled_instruction : AsmWriteLn(#9#9+int_op2str[pai_labeled(hp)^._operator]+#9+lab2str(pai_labeled(hp)^.lab)); ait_labeled_instruction : AsmWriteLn(#9#9+int_op2str[pai386_labeled(hp)^._operator]+#9+lab2str(pai386_labeled(hp)^.lab));
ait_symbol : begin ait_symbol : begin
if pai_symbol(hp)^.is_global then if pai_symbol(hp)^.is_global then
AsmWriteLn(#9'PUBLIC'#9+StrPas(pai_symbol(hp)^.name)); AsmWriteLn(#9'PUBLIC'#9+StrPas(pai_symbol(hp)^.name));
@ -624,7 +624,10 @@ ait_stab_function_name : ;
end. end.
{ {
$Log$ $Log$
Revision 1.24 1998-12-20 16:21:22 peter Revision 1.25 1999-02-22 02:14:59 peter
* updates for ag386bin
Revision 1.24 1998/12/20 16:21:22 peter
* smartlinking doesn't crash anymore * smartlinking doesn't crash anymore
Revision 1.23 1998/12/16 00:27:17 peter Revision 1.23 1998/12/16 00:27:17 peter

View File

@ -434,13 +434,13 @@ unit ag386nsm;
end; end;
ait_labeled_instruction : ait_labeled_instruction :
begin begin
op:=pai_labeled(hp)^._operator; op:=pai386_labeled(hp)^._operator;
if not((op=A_JMP) or (op=A_LOOP) or (op=A_LOOPZ) or if not((op=A_JMP) or (op=A_LOOP) or (op=A_LOOPZ) or
(op=A_LOOPE) or (op=A_LOOPNZ) or (op=A_LOOPNE) or (op=A_LOOPE) or (op=A_LOOPNZ) or (op=A_LOOPNE) or
(op=A_JCXZ) or (op=A_JECXZ)) then (op=A_JCXZ) or (op=A_JECXZ)) then
AsmWriteLn(#9#9+int_op2str[pai_labeled(hp)^._operator]+#9+'near '+lab2str(pai_labeled(hp)^.lab)) AsmWriteLn(#9#9+int_op2str[pai386_labeled(hp)^._operator]+#9+'near '+lab2str(pai386_labeled(hp)^.lab))
else else
AsmWriteLn(#9#9+int_op2str[pai_labeled(hp)^._operator]+#9+lab2str(pai_labeled(hp)^.lab)); AsmWriteLn(#9#9+int_op2str[pai386_labeled(hp)^._operator]+#9+lab2str(pai386_labeled(hp)^.lab));
end; end;
ait_symbol : begin ait_symbol : begin
if pai_symbol(hp)^.is_global then if pai_symbol(hp)^.is_global then
@ -607,7 +607,10 @@ ait_stab_function_name : ;
end. end.
{ {
$Log$ $Log$
Revision 1.17 1998-12-20 16:21:23 peter Revision 1.18 1999-02-22 02:15:00 peter
* updates for ag386bin
Revision 1.17 1998/12/20 16:21:23 peter
* smartlinking doesn't crash anymore * smartlinking doesn't crash anymore
Revision 1.16 1998/12/16 00:27:18 peter Revision 1.16 1998/12/16 00:27:18 peter

View File

@ -85,6 +85,9 @@ uses
{$endif} {$endif}
,strings ,strings
{$ifdef i386} {$ifdef i386}
{$ifdef Ag386Bin}
,ag386bin
{$endif}
{$ifndef NoAg386Att} {$ifndef NoAg386Att}
,ag386att ,ag386att
{$endif NoAg386Att} {$endif NoAg386Att}
@ -474,7 +477,7 @@ var
a : PAsmList; a : PAsmList;
{$ifdef i386} {$ifdef i386}
{$ifdef Ag386Bin} {$ifdef Ag386Bin}
b : Pi386binasmlist b : Pi386binasmlist;
{$endif} {$endif}
{$endif} {$endif}
begin begin
@ -495,6 +498,7 @@ begin
end; end;
b^.WriteBin; b^.WriteBin;
dispose(b,done); dispose(b,done);
exit;
end; end;
{$endif Ag386Bin} {$endif Ag386Bin}
{$ifndef NoAg386Att} {$ifndef NoAg386Att}
@ -558,7 +562,10 @@ end;
end. end.
{ {
$Log$ $Log$
Revision 1.35 1999-02-17 10:16:26 peter Revision 1.36 1999-02-22 02:15:01 peter
* updates for ag386bin
Revision 1.35 1999/02/17 10:16:26 peter
* small fixes for the binary writer * small fixes for the binary writer
Revision 1.34 1999/01/10 15:37:52 peter Revision 1.34 1999/01/10 15:37:52 peter

View File

@ -37,7 +37,12 @@ implementation
cobjects,verbose,globals, cobjects,verbose,globals,
symtable,aasm,types, symtable,aasm,types,
hcodegen,temp_gen,pass_2, hcodegen,temp_gen,pass_2,
i386,cgai386,tgeni386; {$ifdef ag386bin}
i386base,i386asm,
{$else}
i386,
{$endif}
cgai386,tgeni386;
{***************************************************************************** {*****************************************************************************
Helpers Helpers
@ -593,7 +598,7 @@ implementation
getlabel(truelabel); getlabel(truelabel);
secondpass(p^.left); secondpass(p^.left);
maketojumpbool(p^.left); maketojumpbool(p^.left);
emitl(A_LABEL,truelabel); emitlab(truelabel);
truelabel:=otl; truelabel:=otl;
end; end;
orn : begin orn : begin
@ -601,7 +606,7 @@ implementation
getlabel(falselabel); getlabel(falselabel);
secondpass(p^.left); secondpass(p^.left);
maketojumpbool(p^.left); maketojumpbool(p^.left);
emitl(A_LABEL,falselabel); emitlab(falselabel);
falselabel:=ofl; falselabel:=ofl;
end; end;
else else
@ -1091,11 +1096,11 @@ implementation
begin begin
getlabel(hl4); getlabel(hl4);
if unsigned then if unsigned then
emitl(A_JNB,hl4) emitjmp(C_NB,hl4)
else else
emitl(A_JNO,hl4); emitjmp(C_NO,hl4);
emitcall('FPC_OVERFLOW',true); emitcall('FPC_OVERFLOW',true);
emitl(A_LABEL,hl4); emitlab(hl4);
end; end;
end; end;
end end
@ -1362,13 +1367,13 @@ implementation
begin begin
emit_reg_reg(A_CMP,S_L,p^.right^.location.registerhigh, emit_reg_reg(A_CMP,S_L,p^.right^.location.registerhigh,
p^.location.registerhigh); p^.location.registerhigh);
emitl(flag_2_jmp[getresflags(p,unsigned)],truelabel); emitjmp(flag_2_cond[getresflags(p,unsigned)],truelabel);
emit_reg_reg(A_CMP,S_L,p^.right^.location.registerlow, emit_reg_reg(A_CMP,S_L,p^.right^.location.registerlow,
p^.location.registerlow); p^.location.registerlow);
emitl(flag_2_jmp[getresflags(p,unsigned)],truelabel); emitjmp(flag_2_cond[getresflags(p,unsigned)],truelabel);
emitl(A_JMP,falselabel); emitjmp(C_None,falselabel);
end end
else else
begin begin
@ -1376,13 +1381,13 @@ implementation
inc(hr^.offset,4); inc(hr^.offset,4);
exprasmlist^.concat(new(pai386,op_ref_reg(A_CMP,S_L, exprasmlist^.concat(new(pai386,op_ref_reg(A_CMP,S_L,
hr,p^.location.registerhigh))); hr,p^.location.registerhigh)));
emitl(flag_2_jmp[getresflags(p,unsigned)],truelabel); emitjmp(flag_2_cond[getresflags(p,unsigned)],truelabel);
exprasmlist^.concat(new(pai386,op_ref_reg(A_CMP,S_L,newreference( exprasmlist^.concat(new(pai386,op_ref_reg(A_CMP,S_L,newreference(
p^.right^.location.reference),p^.location.registerlow))); p^.right^.location.reference),p^.location.registerlow)));
emitl(flag_2_jmp[getresflags(p,unsigned)],truelabel); emitjmp(flag_2_cond[getresflags(p,unsigned)],truelabel);
emitl(A_JMP,falselabel); emitjmp(C_None,falselabel);
ungetiftemp(p^.right^.location.reference); ungetiftemp(p^.right^.location.reference);
del_reference(p^.right^.location.reference); del_reference(p^.right^.location.reference);
@ -1446,12 +1451,12 @@ implementation
exprasmlist^.concat(new(pai386,op_reg_reg(A_CMP,S_L, exprasmlist^.concat(new(pai386,op_reg_reg(A_CMP,S_L,
p^.right^.location.registerhigh, p^.right^.location.registerhigh,
p^.location.registerhigh))); p^.location.registerhigh)));
emitl(flag_2_jmp[getresflags(p,unsigned)],truelabel); emitjmp(flag_2_cond[getresflags(p,unsigned)],truelabel);
exprasmlist^.concat(new(pai386,op_reg_reg(A_CMP,S_L, exprasmlist^.concat(new(pai386,op_reg_reg(A_CMP,S_L,
p^.right^.location.registerlow, p^.right^.location.registerlow,
p^.location.registerlow))); p^.location.registerlow)));
emitl(flag_2_jmp[getresflags(p,unsigned)],truelabel); emitjmp(flag_2_cond[getresflags(p,unsigned)],truelabel);
emitl(A_JMP,falselabel); emitjmp(C_None,falselabel);
end end
else else
begin begin
@ -1482,11 +1487,11 @@ implementation
begin begin
getlabel(hl4); getlabel(hl4);
if unsigned then if unsigned then
emitl(A_JNB,hl4) emitjmp(C_NB,hl4)
else else
emitl(A_JNO,hl4); emitjmp(C_NO,hl4);
emitcall('FPC_OVERFLOW',true); emitcall('FPC_OVERFLOW',true);
emitl(A_LABEL,hl4); emitlab(hl4);
end; end;
end; end;
{ we have LOC_JUMP as result } { we have LOC_JUMP as result }
@ -1810,7 +1815,10 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.43 1999-02-16 00:46:30 peter Revision 1.44 1999-02-22 02:15:02 peter
* updates for ag386bin
Revision 1.43 1999/02/16 00:46:30 peter
* fixed bug 206 * fixed bug 206
Revision 1.42 1999/02/12 10:43:56 florian Revision 1.42 1999/02/12 10:43:56 florian

View File

@ -42,7 +42,12 @@ implementation
gdb, gdb,
{$endif GDB} {$endif GDB}
hcodegen,temp_gen,pass_2, hcodegen,temp_gen,pass_2,
i386,cgai386,tgeni386,cg386ld; {$ifdef ag386bin}
i386base,i386asm,
{$else}
i386,
{$endif}
cgai386,tgeni386,cg386ld;
{***************************************************************************** {*****************************************************************************
SecondCallParaN SecondCallParaN
@ -363,7 +368,7 @@ implementation
(cs_check_io in aktlocalswitches) then (cs_check_io in aktlocalswitches) then
begin begin
getlabel(iolabel); getlabel(iolabel);
emitl(A_LABEL,iolabel); emitlab(iolabel);
end end
else else
iolabel:=nil; iolabel:=nil;
@ -1304,7 +1309,10 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.67 1999-02-11 09:46:21 pierre Revision 1.68 1999-02-22 02:15:04 peter
* updates for ag386bin
Revision 1.67 1999/02/11 09:46:21 pierre
* fix for normal method calls inside static methods : * fix for normal method calls inside static methods :
WARNING there were both parser and codegen errors !! WARNING there were both parser and codegen errors !!
added static_call boolean to calln tree added static_call boolean to calln tree

View File

@ -43,7 +43,12 @@ implementation
cobjects,verbose,globals,systems, cobjects,verbose,globals,systems,
symtable,aasm,types, symtable,aasm,types,
hcodegen,temp_gen,pass_2,pass_1, hcodegen,temp_gen,pass_2,pass_1,
i386,cgai386,tgeni386; {$ifdef ag386bin}
i386base,i386asm,
{$else}
i386,
{$endif}
cgai386,tgeni386;
@ -324,10 +329,10 @@ implementation
hp^.symbol:=stringdup(porddef(p1)^.getrangecheckstring); hp^.symbol:=stringdup(porddef(p1)^.getrangecheckstring);
{ second part here !! } { second part here !! }
hp^.offset:=8; hp^.offset:=8;
emitl(A_JMP,poslabel); emitjmp(C_None,poslabel);
emitl(A_LABEL,neglabel); emitlab(neglabel);
exprasmlist^.concat(new(pai386,op_reg_ref(A_BOUND,S_L,hregister,hp))); exprasmlist^.concat(new(pai386,op_reg_ref(A_BOUND,S_L,hregister,hp)));
emitl(A_LABEL,poslabel); emitlab(poslabel);
end; end;
end; end;
end; end;
@ -1022,7 +1027,7 @@ implementation
emit_reg_reg(A_MOV,S_L,R_EAX,R_EBX); emit_reg_reg(A_MOV,S_L,R_EAX,R_EBX);
emit_reg_reg(A_SUB,S_L,R_EDX,R_EAX); emit_reg_reg(A_SUB,S_L,R_EDX,R_EAX);
getlabel(hl); getlabel(hl);
emitl(A_JZ,hl); emitjmp(C_Z,hl);
exprasmlist^.concat(new(pai386,op_const_reg(A_RCL,S_L,1,R_EBX))); exprasmlist^.concat(new(pai386,op_const_reg(A_RCL,S_L,1,R_EBX)));
emit_reg_reg(A_BSR,S_L,R_EAX,R_EDX); emit_reg_reg(A_BSR,S_L,R_EAX,R_EDX);
exprasmlist^.concat(new(pai386,op_const_reg(A_MOV,S_B,32,R_CL))); exprasmlist^.concat(new(pai386,op_const_reg(A_MOV,S_B,32,R_CL)));
@ -1034,7 +1039,7 @@ implementation
exprasmlist^.concat(new(pai386,op_const_reg_reg(A_SHLD,S_L,20,R_EAX,R_EBX))); exprasmlist^.concat(new(pai386,op_const_reg_reg(A_SHLD,S_L,20,R_EAX,R_EBX)));
exprasmlist^.concat(new(pai386,op_const_reg(A_SHL,S_L,20,R_EAX))); exprasmlist^.concat(new(pai386,op_const_reg(A_SHL,S_L,20,R_EAX)));
emitl(A_LABEL,hl); emitlab(hl);
{ better than an add on all processors } { better than an add on all processors }
exprasmlist^.concat(new(pai386,op_reg(A_PUSH,S_L,R_EBX))); exprasmlist^.concat(new(pai386,op_reg(A_PUSH,S_L,R_EBX)));
exprasmlist^.concat(new(pai386,op_reg(A_PUSH,S_L,R_EAX))); exprasmlist^.concat(new(pai386,op_reg(A_PUSH,S_L,R_EAX)));
@ -1214,7 +1219,7 @@ implementation
end; end;
LOC_FLAGS : begin LOC_FLAGS : begin
hregister:=reg32toreg8(hregister); hregister:=reg32toreg8(hregister);
exprasmlist^.concat(new(pai386,op_reg(flag_2_set[pfrom^.location.resflags],S_B,hregister))); emit_flag2reg(pfrom^.location.resflags,hregister);
case pto^.resulttype^.size of case pto^.resulttype^.size of
2 : exprasmlist^.concat(new(pai386,op_reg_reg(A_MOVZX,S_BW,hregister,pto^.location.register))); 2 : exprasmlist^.concat(new(pai386,op_reg_reg(A_MOVZX,S_BW,hregister,pto^.location.register)));
4 : exprasmlist^.concat(new(pai386,op_reg_reg(A_MOVZX,S_BL,hregister,pto^.location.register))); 4 : exprasmlist^.concat(new(pai386,op_reg_reg(A_MOVZX,S_BL,hregister,pto^.location.register)));
@ -1222,12 +1227,12 @@ implementation
end; end;
LOC_JUMP : begin LOC_JUMP : begin
getlabel(hlabel); getlabel(hlabel);
emitl(A_LABEL,truelabel); emitlab(truelabel);
exprasmlist^.concat(new(pai386,op_const_reg(A_MOV,newsize,1,hregister))); exprasmlist^.concat(new(pai386,op_const_reg(A_MOV,newsize,1,hregister)));
emitl(A_JMP,hlabel); emitjmp(C_None,hlabel);
emitl(A_LABEL,falselabel); emitlab(falselabel);
exprasmlist^.concat(new(pai386,op_reg_reg(A_XOR,newsize,hregister,hregister))); exprasmlist^.concat(new(pai386,op_reg_reg(A_XOR,newsize,hregister,hregister)));
emitl(A_LABEL,hlabel); emitlab(hlabel);
end; end;
else else
internalerror(10061); internalerror(10061);
@ -1273,7 +1278,7 @@ implementation
end; end;
exprasmlist^.concat(new(pai386,op_reg_reg(A_OR,S_L,hregister,hregister))); exprasmlist^.concat(new(pai386,op_reg_reg(A_OR,S_L,hregister,hregister)));
hregister:=reg32toreg8(hregister); hregister:=reg32toreg8(hregister);
exprasmlist^.concat(new(pai386,op_reg(flag_2_set[pfrom^.location.resflags],S_B,hregister))); emit_flag2reg(pfrom^.location.resflags,hregister);
case pto^.resulttype^.size of case pto^.resulttype^.size of
1 : pto^.location.register:=hregister; 1 : pto^.location.register:=hregister;
2 : begin 2 : begin
@ -1330,19 +1335,19 @@ implementation
pto^.location.register:=getregister32; pto^.location.register:=getregister32;
end; end;
end; end;
emitl(A_JZ,l1); emitjmp(C_Z,l1);
if pfrom^.location.loc in [LOC_MEM,LOC_REFERENCE] then if pfrom^.location.loc in [LOC_MEM,LOC_REFERENCE] then
exprasmlist^.concat(new(pai386,op_ref_reg(A_MOV,S_L,newreference( exprasmlist^.concat(new(pai386,op_ref_reg(A_MOV,S_L,newreference(
pfrom^.location.reference), pfrom^.location.reference),
pto^.location.register))); pto^.location.register)));
emitl(A_JMP,l2); emitjmp(C_None,l2);
emitl(A_LABEL,l1); emitlab(l1);
new(hr); new(hr);
reset_reference(hr^); reset_reference(hr^);
hr^.symbol:=stringdup('FPC_EMPTYCHAR'); hr^.symbol:=stringdup('FPC_EMPTYCHAR');
exprasmlist^.concat(new(pai386,op_ref_reg(A_LEA,S_L,hr, exprasmlist^.concat(new(pai386,op_ref_reg(A_LEA,S_L,hr,
pto^.location.register))); pto^.location.register)));
emitl(A_LABEL,l2); emitlab(l2);
end; end;
@ -1618,7 +1623,10 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.56 1999-02-15 11:30:39 pierre Revision 1.57 1999-02-22 02:15:06 peter
* updates for ag386bin
Revision 1.56 1999/02/15 11:30:39 pierre
* memory leaks removed * memory leaks removed
Revision 1.55 1999/02/12 10:43:57 florian Revision 1.55 1999/02/12 10:43:57 florian

View File

@ -44,7 +44,12 @@ implementation
cobjects,verbose,globals, cobjects,verbose,globals,
symtable,aasm,types, symtable,aasm,types,
hcodegen,temp_gen,pass_2, hcodegen,temp_gen,pass_2,
i386,cgai386,tgeni386; {$ifdef ag386bin}
i386base,i386asm,
{$else}
i386,
{$endif}
cgai386,tgeni386;
{***************************************************************************** {*****************************************************************************
SecondRealConst SecondRealConst
@ -379,7 +384,10 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.27 1999-01-19 14:21:59 peter Revision 1.28 1999-02-22 02:15:08 peter
* updates for ag386bin
Revision 1.27 1999/01/19 14:21:59 peter
* shortstring truncated after 255 chars * shortstring truncated after 255 chars
Revision 1.26 1998/12/11 00:02:49 peter Revision 1.26 1998/12/11 00:02:49 peter

View File

@ -47,7 +47,12 @@ implementation
cobjects,verbose,globals,systems, cobjects,verbose,globals,systems,
symtable,aasm,types, symtable,aasm,types,
hcodegen,temp_gen,pass_2, hcodegen,temp_gen,pass_2,
i386,cgai386,tgeni386; {$ifdef ag386bin}
i386base,i386asm,
{$else}
i386,
{$endif}
cgai386,tgeni386;
{***************************************************************************** {*****************************************************************************
Second_While_RepeatN Second_While_RepeatN
@ -70,16 +75,16 @@ implementation
{ handling code at the end as it is much more efficient, and makes { handling code at the end as it is much more efficient, and makes
while equal to repeat loop, only the end true/false is swapped (PFV) } while equal to repeat loop, only the end true/false is swapped (PFV) }
if p^.treetype=whilen then if p^.treetype=whilen then
emitl(A_JMP,lcont); emitjmp(C_None,lcont);
emitl(A_LABEL,lloop); emitlab(lloop);
aktcontinuelabel:=lcont; aktcontinuelabel:=lcont;
aktbreaklabel:=lbreak; aktbreaklabel:=lbreak;
cleartempgen; cleartempgen;
if assigned(p^.right) then if assigned(p^.right) then
secondpass(p^.right); secondpass(p^.right);
emitl(A_LABEL,lcont); emitlab(lcont);
otlabel:=truelabel; otlabel:=truelabel;
oflabel:=falselabel; oflabel:=falselabel;
if p^.treetype=whilen then if p^.treetype=whilen then
@ -96,7 +101,7 @@ implementation
cleartempgen; cleartempgen;
secondpass(p^.left); secondpass(p^.left);
maketojumpbool(p^.left); maketojumpbool(p^.left);
emitl(A_LABEL,lbreak); emitlab(lbreak);
freelabel(lloop); freelabel(lloop);
freelabel(lcont); freelabel(lcont);
freelabel(lbreak); freelabel(lbreak);
@ -127,7 +132,7 @@ implementation
maketojumpbool(p^.left); maketojumpbool(p^.left);
if assigned(p^.right) then if assigned(p^.right) then
begin begin
emitl(A_LABEL,truelabel); emitlab(truelabel);
cleartempgen; cleartempgen;
secondpass(p^.right); secondpass(p^.right);
end; end;
@ -138,21 +143,21 @@ implementation
getlabel(hl); getlabel(hl);
{ do go back to if line !! } { do go back to if line !! }
aktfilepos:=exprasmlist^.getlasttaifilepos^; aktfilepos:=exprasmlist^.getlasttaifilepos^;
emitl(A_JMP,hl); emitjmp(C_None,hl);
end; end;
emitl(A_LABEL,falselabel); emitlab(falselabel);
cleartempgen; cleartempgen;
secondpass(p^.t1); secondpass(p^.t1);
if assigned(p^.right) then if assigned(p^.right) then
emitl(A_LABEL,hl); emitlab(hl);
end end
else else
begin begin
emitl(A_LABEL,falselabel); emitlab(falselabel);
end; end;
if not(assigned(p^.right)) then if not(assigned(p^.right)) then
begin begin
emitl(A_LABEL,truelabel); emitlab(truelabel);
end; end;
freelabel(truelabel); freelabel(truelabel);
freelabel(falselabel); freelabel(falselabel);
@ -172,6 +177,7 @@ implementation
hs : byte; hs : byte;
temp1 : treference; temp1 : treference;
hop : tasmop; hop : tasmop;
hcond : tasmcond;
cmpreg,cmp32 : tregister; cmpreg,cmp32 : tregister;
opsize : topsize; opsize : topsize;
count_var_is_signed : boolean; count_var_is_signed : boolean;
@ -309,24 +315,26 @@ implementation
end; end;
if p^.backward then if p^.backward then
if count_var_is_signed then if count_var_is_signed then
hop:=A_JL hcond:=C_L
else hop:=A_JB else
hcond:=C_B
else else
if count_var_is_signed then if count_var_is_signed then
hop:=A_JG hcond:=C_G
else hop:=A_JA; else
hcond:=C_A;
if not(omitfirstcomp) or temptovalue then if not(omitfirstcomp) or temptovalue then
emitl(hop,aktbreaklabel); emitjmp(hcond,aktbreaklabel);
emitl(A_LABEL,l3); emitlab(l3);
{ help register must not be in instruction block } { help register must not be in instruction block }
cleartempgen; cleartempgen;
if assigned(p^.t1) then if assigned(p^.t1) then
secondpass(p^.t1); secondpass(p^.t1);
emitl(A_LABEL,aktcontinuelabel); emitlab(aktcontinuelabel);
{ makes no problems there } { makes no problems there }
cleartempgen; cleartempgen;
@ -373,29 +381,30 @@ implementation
end; end;
if p^.backward then if p^.backward then
if count_var_is_signed then if count_var_is_signed then
hop:=A_JLE hcond:=C_LE
else else
hop :=A_JBE hcond:=C_BE
else else
if count_var_is_signed then if count_var_is_signed then
hop:=A_JGE hcond:=C_GE
else else
hop:=A_JAE; hcond:=C_AE;
emitl(hop,aktbreaklabel); emitjmp(hcond,aktbreaklabel);
{ according to count direction DEC or INC... } { according to count direction DEC or INC... }
{ must be after the test because of 0to 255 for bytes !! } { must be after the test because of 0to 255 for bytes !! }
if p^.backward then if p^.backward then
hop:=A_DEC hop:=A_DEC
else hop:=A_INC; else
hop:=A_INC;
if p^.t2^.location.loc=LOC_CREGISTER then if p^.t2^.location.loc=LOC_CREGISTER then
exprasmlist^.concat(new(pai386,op_reg(hop,opsize,p^.t2^.location.register))) exprasmlist^.concat(new(pai386,op_reg(hop,opsize,p^.t2^.location.register)))
else else
exprasmlist^.concat(new(pai386,op_ref(hop,opsize,newreference(p^.t2^.location.reference)))); exprasmlist^.concat(new(pai386,op_ref(hop,opsize,newreference(p^.t2^.location.reference))));
emitl(A_JMP,l3); emitjmp(C_None,l3);
{ this is the break label: } { this is the break label: }
emitl(A_LABEL,aktbreaklabel); emitlab(aktbreaklabel);
ungetregister32(cmp32); ungetregister32(cmp32);
if temptovalue then if temptovalue then
@ -436,13 +445,13 @@ implementation
LOC_CREGISTER, LOC_CREGISTER,
LOC_REGISTER : is_mem:=false; LOC_REGISTER : is_mem:=false;
LOC_FLAGS : begin LOC_FLAGS : begin
exprasmlist^.concat(new(pai386,op_reg(flag_2_set[p^.right^.location.resflags],S_B,R_AL))); emit_flag2reg(p^.right^.location.resflags,R_AL);
goto do_jmp; goto do_jmp;
end; end;
LOC_JUMP : begin LOC_JUMP : begin
emitl(A_LABEL,truelabel); emitlab(truelabel);
exprasmlist^.concat(new(pai386,op_const_reg(A_MOV,S_B,1,R_AL))); exprasmlist^.concat(new(pai386,op_const_reg(A_MOV,S_B,1,R_AL)));
emitl(A_JMP,aktexit2label); emitjmp(C_None,aktexit2label);
exprasmlist^.concat(new(pai386,op_reg_reg(A_XOR,S_B,R_AL,R_AL))); exprasmlist^.concat(new(pai386,op_reg_reg(A_XOR,S_B,R_AL,R_AL)));
goto do_jmp; goto do_jmp;
end; end;
@ -498,11 +507,11 @@ do_jmp:
freelabel(falselabel); freelabel(falselabel);
truelabel:=otlabel; truelabel:=otlabel;
falselabel:=oflabel; falselabel:=oflabel;
emitl(A_JMP,aktexit2label); emitjmp(C_None,aktexit2label);
end end
else else
begin begin
emitl(A_JMP,aktexitlabel); emitjmp(C_None,aktexitlabel);
end; end;
end; end;
@ -514,7 +523,7 @@ do_jmp:
procedure secondbreakn(var p : ptree); procedure secondbreakn(var p : ptree);
begin begin
if aktbreaklabel<>nil then if aktbreaklabel<>nil then
emitl(A_JMP,aktbreaklabel) emitjmp(C_None,aktbreaklabel)
else else
CGMessage(cg_e_break_not_allowed); CGMessage(cg_e_break_not_allowed);
end; end;
@ -527,7 +536,7 @@ do_jmp:
procedure secondcontinuen(var p : ptree); procedure secondcontinuen(var p : ptree);
begin begin
if aktcontinuelabel<>nil then if aktcontinuelabel<>nil then
emitl(A_JMP,aktcontinuelabel) emitjmp(C_None,aktcontinuelabel)
else else
CGMessage(cg_e_continue_not_allowed); CGMessage(cg_e_continue_not_allowed);
end; end;
@ -540,7 +549,7 @@ do_jmp:
procedure secondgoto(var p : ptree); procedure secondgoto(var p : ptree);
begin begin
emitl(A_JMP,p^.labelnr); emitjmp(C_None,p^.labelnr);
end; end;
@ -550,7 +559,7 @@ do_jmp:
procedure secondlabel(var p : ptree); procedure secondlabel(var p : ptree);
begin begin
emitl(A_LABEL,p^.labelnr); emitlab(p^.labelnr);
cleartempgen; cleartempgen;
secondpass(p^.left); secondpass(p^.left);
end; end;
@ -578,7 +587,7 @@ do_jmp:
else else
begin begin
getlabel(a); getlabel(a);
emitl(A_LABEL,a); emitlab(a);
exprasmlist^.concat(new(pai386, exprasmlist^.concat(new(pai386,
op_csymbol(A_PUSH,S_L,newcsymbol(lab2str(a),0)))); op_csymbol(A_PUSH,S_L,newcsymbol(lab2str(a),0))));
end; end;
@ -635,27 +644,27 @@ do_jmp:
op_reg(A_PUSH,S_L,R_EAX))); op_reg(A_PUSH,S_L,R_EAX)));
exprasmlist^.concat(new(pai386, exprasmlist^.concat(new(pai386,
op_reg_reg(A_TEST,S_L,R_EAX,R_EAX))); op_reg_reg(A_TEST,S_L,R_EAX,R_EAX)));
emitl(A_JNE,exceptlabel); emitjmp(C_NE,exceptlabel);
{ try code } { try code }
secondpass(p^.left); secondpass(p^.left);
if codegenerror then if codegenerror then
exit; exit;
emitl(A_LABEL,exceptlabel); emitlab(exceptlabel);
exprasmlist^.concat(new(pai386, exprasmlist^.concat(new(pai386,
op_reg(A_POP,S_L,R_EAX))); op_reg(A_POP,S_L,R_EAX)));
exprasmlist^.concat(new(pai386, exprasmlist^.concat(new(pai386,
op_reg_reg(A_TEST,S_L,R_EAX,R_EAX))); op_reg_reg(A_TEST,S_L,R_EAX,R_EAX)));
emitl(A_JNE,doexceptlabel); emitjmp(C_NE,doexceptlabel);
emitcall('FPC_POPADDRSTACK',true); emitcall('FPC_POPADDRSTACK',true);
emitl(A_JMP,endexceptlabel); emitjmp(C_None,endexceptlabel);
emitl(A_LABEL,doexceptlabel); emitlab(doexceptlabel);
if assigned(p^.right) then if assigned(p^.right) then
secondpass(p^.right); secondpass(p^.right);
emitl(A_LABEL,lastonlabel); emitlab(lastonlabel);
{ default handling } { default handling }
if assigned(p^.t1) then if assigned(p^.t1) then
begin begin
@ -668,7 +677,7 @@ do_jmp:
end end
else else
emitcall('FPC_RERAISE',true); emitcall('FPC_RERAISE',true);
emitl(A_LABEL,endexceptlabel); emitlab(endexceptlabel);
freelabel(exceptlabel); freelabel(exceptlabel);
freelabel(doexceptlabel); freelabel(doexceptlabel);
freelabel(endexceptlabel); freelabel(endexceptlabel);
@ -694,7 +703,7 @@ do_jmp:
emitcall('FPC_CATCHES',true); emitcall('FPC_CATCHES',true);
exprasmlist^.concat(new(pai386, exprasmlist^.concat(new(pai386,
op_reg_reg(A_TEST,S_L,R_EAX,R_EAX))); op_reg_reg(A_TEST,S_L,R_EAX,R_EAX)));
emitl(A_JE,nextonlabel); emitjmp(C_E,nextonlabel);
ref.symbol:=nil; ref.symbol:=nil;
gettempofsizereference(4,ref); gettempofsizereference(4,ref);
@ -709,8 +718,8 @@ do_jmp:
secondpass(p^.right); secondpass(p^.right);
{ clear some stuff } { clear some stuff }
ungetiftemp(ref); ungetiftemp(ref);
emitl(A_JMP,endexceptlabel); emitjmp(C_None,endexceptlabel);
emitl(A_LABEL,nextonlabel); emitlab(nextonlabel);
{ next on node } { next on node }
if assigned(p^.left) then if assigned(p^.left) then
secondpass(p^.left); secondpass(p^.left);
@ -741,14 +750,14 @@ do_jmp:
op_reg(A_PUSH,S_L,R_EAX))); op_reg(A_PUSH,S_L,R_EAX)));
exprasmlist^.concat(new(pai386, exprasmlist^.concat(new(pai386,
op_reg_reg(A_TEST,S_L,R_EAX,R_EAX))); op_reg_reg(A_TEST,S_L,R_EAX,R_EAX)));
emitl(A_JNE,finallylabel); emitjmp(C_NE,finallylabel);
{ try code } { try code }
secondpass(p^.left); secondpass(p^.left);
if codegenerror then if codegenerror then
exit; exit;
emitl(A_LABEL,finallylabel); emitlab(finallylabel);
{ finally code } { finally code }
secondpass(p^.right); secondpass(p^.right);
@ -758,11 +767,11 @@ do_jmp:
op_reg(A_POP,S_L,R_EAX))); op_reg(A_POP,S_L,R_EAX)));
exprasmlist^.concat(new(pai386, exprasmlist^.concat(new(pai386,
op_reg_reg(A_TEST,S_L,R_EAX,R_EAX))); op_reg_reg(A_TEST,S_L,R_EAX,R_EAX)));
emitl(A_JE,noreraiselabel); emitjmp(C_E,noreraiselabel);
emitcall('FPC_RERAISE',true); emitcall('FPC_RERAISE',true);
emitl(A_LABEL,noreraiselabel); emitlab(noreraiselabel);
emitcall('FPC_POPADDRSTACK',true); emitcall('FPC_POPADDRSTACK',true);
emitl(A_LABEL,endfinallylabel); emitlab(endfinallylabel);
end; end;
@ -781,14 +790,17 @@ do_jmp:
hp^.offset:=procinfo.ESI_offset; hp^.offset:=procinfo.ESI_offset;
hp^.base:=procinfo.framepointer; hp^.base:=procinfo.framepointer;
exprasmlist^.concat(new(pai386,op_reg_ref(A_MOV,S_L,R_ESI,hp))); exprasmlist^.concat(new(pai386,op_reg_ref(A_MOV,S_L,R_ESI,hp)));
exprasmlist^.concat(new(pai_labeled,init(A_JMP,quickexitlabel))); exprasmlist^.concat(new(pai386_labeled,op_lab(A_JMP,quickexitlabel)));
end; end;
end. end.
{ {
$Log$ $Log$
Revision 1.27 1999-01-26 11:26:21 pierre Revision 1.28 1999-02-22 02:15:09 peter
* updates for ag386bin
Revision 1.27 1999/01/26 11:26:21 pierre
* bug0152 for i:=1 to i-5 do (i-5) evaluated first * bug0152 for i:=1 to i-5 do (i-5) evaluated first
Revision 1.26 1998/12/19 00:23:44 florian Revision 1.26 1998/12/19 00:23:44 florian

View File

@ -36,7 +36,12 @@ implementation
cobjects,verbose,globals,files, cobjects,verbose,globals,files,
symtable,aasm,types, symtable,aasm,types,
hcodegen,temp_gen,pass_2, hcodegen,temp_gen,pass_2,
i386,cgai386,tgeni386,cg386ld,cg386cal; {$ifdef ag386bin}
i386base,i386asm,
{$else}
i386,
{$endif}
cgai386,tgeni386,cg386ld,cg386cal;
{***************************************************************************** {*****************************************************************************
@ -121,7 +126,7 @@ implementation
((aktprocsym^.definition^.options and poiocheck)=0) then ((aktprocsym^.definition^.options and poiocheck)=0) then
begin begin
getlabel(iolabel); getlabel(iolabel);
emitl(A_LABEL,iolabel); emitlab(iolabel);
end end
else else
iolabel:=nil; iolabel:=nil;
@ -572,7 +577,7 @@ implementation
if cs_do_assertion in aktlocalswitches then if cs_do_assertion in aktlocalswitches then
begin begin
maketojumpbool(p^.left^.left); maketojumpbool(p^.left^.left);
emitl(A_LABEL,falselabel); emitlab(falselabel);
{ erroraddr } { erroraddr }
exprasmlist^.concat(new(pai386,op_reg(A_PUSH,S_L,R_EBP))); exprasmlist^.concat(new(pai386,op_reg(A_PUSH,S_L,R_EBP)));
{ lineno } { lineno }
@ -589,7 +594,7 @@ implementation
emitpushreferenceaddr(exprasmlist,p^.left^.right^.left^.location.reference); emitpushreferenceaddr(exprasmlist,p^.left^.right^.left^.location.reference);
{ call } { call }
emitcall('FPC_ASSERT',true); emitcall('FPC_ASSERT',true);
emitl(A_LABEL,truelabel); emitlab(truelabel);
end; end;
freelabel(truelabel); freelabel(truelabel);
freelabel(falselabel); freelabel(falselabel);
@ -771,8 +776,7 @@ implementation
p^.location.register) p^.location.register)
else else
if p^.left^.location.loc=LOC_FLAGS then if p^.left^.location.loc=LOC_FLAGS then
exprasmlist^.concat(new(pai386,op_reg(flag_2_set[p^.left^.location.resflags],S_B, emit_flag2reg(p^.left^.location.resflags,p^.location.register)
p^.location.register)))
else else
begin begin
del_reference(p^.left^.location.reference); del_reference(p^.left^.location.reference);
@ -1023,7 +1027,10 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.27 1999-02-17 14:21:40 pierre Revision 1.28 1999-02-22 02:15:11 peter
* updates for ag386bin
Revision 1.27 1999/02/17 14:21:40 pierre
* unused local removed * unused local removed
Revision 1.26 1999/02/15 11:40:21 pierre Revision 1.26 1999/02/15 11:40:21 pierre

View File

@ -24,7 +24,7 @@ unit cg386ld;
interface interface
uses uses
tree,i386; tree;
procedure secondload(var p : ptree); procedure secondload(var p : ptree);
procedure secondassignment(var p : ptree); procedure secondassignment(var p : ptree);
@ -39,6 +39,11 @@ implementation
cobjects,verbose,globals, cobjects,verbose,globals,
symtable,aasm,types, symtable,aasm,types,
hcodegen,temp_gen,pass_2, hcodegen,temp_gen,pass_2,
{$ifdef ag386bin}
i386base,i386asm,
{$else}
i386,
{$endif}
cgai386,tgeni386,cg386cnv; cgai386,tgeni386,cg386cnv;
{***************************************************************************** {*****************************************************************************
@ -336,7 +341,9 @@ implementation
loc : tloc; loc : tloc;
r : preference; r : preference;
oldrl : plinkedlist; oldrl : plinkedlist;
{$ifdef Ag386Bin}
ai : pai386;
{$endif}
begin begin
oldrl:=temptoremove; oldrl:=temptoremove;
temptoremove:=new(plinkedlist,init); temptoremove:=new(plinkedlist,init);
@ -583,7 +590,7 @@ implementation
end; end;
LOC_JUMP : begin LOC_JUMP : begin
getlabel(hlabel); getlabel(hlabel);
emitl(A_LABEL,truelabel); emitlab(truelabel);
if loc=LOC_CREGISTER then if loc=LOC_CREGISTER then
exprasmlist^.concat(new(pai386,op_const_reg(A_MOV,S_B, exprasmlist^.concat(new(pai386,op_const_reg(A_MOV,S_B,
1,p^.left^.location.register))) 1,p^.left^.location.register)))
@ -592,8 +599,8 @@ implementation
1,newreference(p^.left^.location.reference)))); 1,newreference(p^.left^.location.reference))));
{exprasmlist^.concat(new(pai386,op_const_loc(A_MOV,S_B, {exprasmlist^.concat(new(pai386,op_const_loc(A_MOV,S_B,
1,p^.left^.location)));} 1,p^.left^.location)));}
emitl(A_JMP,hlabel); emitjmp(C_None,hlabel);
emitl(A_LABEL,falselabel); emitlab(falselabel);
if loc=LOC_CREGISTER then if loc=LOC_CREGISTER then
exprasmlist^.concat(new(pai386,op_reg_reg(A_XOR,S_B, exprasmlist^.concat(new(pai386,op_reg_reg(A_XOR,S_B,
p^.left^.location.register, p^.left^.location.register,
@ -601,15 +608,22 @@ implementation
else else
exprasmlist^.concat(new(pai386,op_const_ref(A_MOV,S_B, exprasmlist^.concat(new(pai386,op_const_ref(A_MOV,S_B,
0,newreference(p^.left^.location.reference)))); 0,newreference(p^.left^.location.reference))));
emitl(A_LABEL,hlabel); emitlab(hlabel);
end; end;
LOC_FLAGS : begin LOC_FLAGS : begin
if loc=LOC_CREGISTER then if loc=LOC_CREGISTER then
exprasmlist^.concat(new(pai386,op_reg(flag_2_set[p^.right^.location.resflags],S_B, emit_flag2reg(p^.right^.location.resflags,p^.left^.location.register)
p^.left^.location.register)))
else else
{$ifdef Ag386Bin}
begin
ai:=new(pai386,op_ref(A_Setcc,S_B,newreference(p^.left^.location.reference)));
ai^.SetCondition(flag_2_cond[p^.right^.location.resflags]);
exprasmlist^.concat(ai);
end;
{$else}
exprasmlist^.concat(new(pai386,op_ref(flag_2_set[p^.right^.location.resflags],S_B, exprasmlist^.concat(new(pai386,op_ref(flag_2_set[p^.right^.location.resflags],S_B,
newreference(p^.left^.location.reference)))); newreference(p^.left^.location.reference))));
{$endif}
end; end;
end; end;
removetemps(exprasmlist,temptoremove); removetemps(exprasmlist,temptoremove);
@ -791,7 +805,10 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.43 1999-01-27 00:13:54 florian Revision 1.44 1999-02-22 02:15:12 peter
* updates for ag386bin
Revision 1.43 1999/01/27 00:13:54 florian
* "procedure of object"-stuff fixed * "procedure of object"-stuff fixed
Revision 1.42 1999/01/21 22:10:40 peter Revision 1.42 1999/01/21 22:10:40 peter

View File

@ -39,7 +39,12 @@ implementation
cobjects,verbose,globals, cobjects,verbose,globals,
symtable,aasm,types, symtable,aasm,types,
hcodegen,temp_gen,pass_2, hcodegen,temp_gen,pass_2,
i386,cgai386,tgeni386; {$ifdef ag386bin}
i386base,i386asm,
{$else}
i386,
{$endif}
cgai386,tgeni386;
{***************************************************************************** {*****************************************************************************
SecondModDiv SecondModDiv
@ -85,12 +90,12 @@ implementation
begin begin
exprasmlist^.concat(new(pai386,op_reg_reg(A_OR,S_L,hreg1,hreg1))); exprasmlist^.concat(new(pai386,op_reg_reg(A_OR,S_L,hreg1,hreg1)));
getlabel(hl); getlabel(hl);
emitl(A_JNS,hl); emitjmp(C_NS,hl);
if power=1 then if power=1 then
exprasmlist^.concat(new(pai386,op_reg(A_INC,S_L,hreg1))) exprasmlist^.concat(new(pai386,op_reg(A_INC,S_L,hreg1)))
else exprasmlist^.concat(new(pai386,op_const_reg(A_ADD,S_L,p^.right^.value-1,hreg1))); else
exprasmlist^.concat(new(pai386,op_const_reg(A_ADD,S_L,p^.right^.value-1,hreg1)));
emitl(A_LABEL,hl); emitlab(hl);
exprasmlist^.concat(new(pai386,op_const_reg(A_SAR,S_L,power,hreg1))); exprasmlist^.concat(new(pai386,op_const_reg(A_SAR,S_L,power,hreg1)));
end end
else else
@ -763,7 +768,10 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.19 1999-02-04 10:49:40 florian Revision 1.20 1999-02-22 02:15:13 peter
* updates for ag386bin
Revision 1.19 1999/02/04 10:49:40 florian
+ range checking for ansi- and widestrings + range checking for ansi- and widestrings
* made it compilable with TP * made it compilable with TP

View File

@ -47,7 +47,12 @@ implementation
cobjects,verbose,globals, cobjects,verbose,globals,
symtable,aasm,types, symtable,aasm,types,
hcodegen,temp_gen,pass_2, hcodegen,temp_gen,pass_2,
i386,cgai386,tgeni386; {$ifdef ag386bin}
i386base,i386asm,
{$else}
i386,
{$endif}
cgai386,tgeni386;
{***************************************************************************** {*****************************************************************************
SecondLoadVMT SecondLoadVMT
@ -637,7 +642,7 @@ implementation
LOC_FLAGS: LOC_FLAGS:
begin begin
ind:=getregister32; ind:=getregister32;
exprasmlist^.concat(new(pai386,op_reg(flag_2_set[p^.right^.location.resflags],S_B,reg32toreg8(ind)))); emit_flag2reg(p^.right^.location.resflags,reg32toreg8(ind));
emit_reg_reg(A_MOVZX,S_BL,reg32toreg8(ind),ind); emit_reg_reg(A_MOVZX,S_BL,reg32toreg8(ind),ind);
end end
else else
@ -855,7 +860,10 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.29 1999-02-07 22:53:07 florian Revision 1.30 1999-02-22 02:15:14 peter
* updates for ag386bin
Revision 1.29 1999/02/07 22:53:07 florian
* potential bug in secondvecn fixed * potential bug in secondvecn fixed
Revision 1.28 1999/02/04 17:16:51 peter Revision 1.28 1999/02/04 17:16:51 peter

View File

@ -38,7 +38,12 @@ implementation
cobjects,verbose,globals, cobjects,verbose,globals,
symtable,aasm,types, symtable,aasm,types,
hcodegen,temp_gen,pass_2, hcodegen,temp_gen,pass_2,
i386,cgai386,tgeni386; {$ifdef ag386bin}
i386base,i386asm,
{$else}
i386,
{$endif}
cgai386,tgeni386;
const const
bytes2Sxx:array[1..4] of Topsize=(S_B,S_W,S_NO,S_L); bytes2Sxx:array[1..4] of Topsize=(S_B,S_W,S_NO,S_L);
@ -245,7 +250,7 @@ implementation
if ranges then if ranges then
exprasmlist^.concat(new(pai386,op_none(A_STC,S_NO))); exprasmlist^.concat(new(pai386,op_none(A_STC,S_NO)));
{ If found, jump to end } { If found, jump to end }
emitl(A_JE,l); emitjmp(C_E,l);
case p^.left^.location.loc of case p^.left^.location.loc of
LOC_REGISTER, LOC_REGISTER,
LOC_CREGISTER : exprasmlist^.concat(new(pai386,op_const_reg(A_CMP,opsize, LOC_CREGISTER : exprasmlist^.concat(new(pai386,op_const_reg(A_CMP,opsize,
@ -258,7 +263,7 @@ implementation
if ranges then if ranges then
exprasmlist^.concat(new(pai386,op_none(A_STC,S_NO))); exprasmlist^.concat(new(pai386,op_none(A_STC,S_NO)));
{ If found, jump to end } { If found, jump to end }
emitl(A_JE,l); emitjmp(C_E,l);
end end
else else
begin begin
@ -275,7 +280,7 @@ implementation
setparts[i].start,newreference(p^.left^.location.reference)))); setparts[i].start,newreference(p^.left^.location.reference))));
end; end;
{ If lower, jump to next check } { If lower, jump to next check }
emitl(A_JB,l2); emitjmp(C_B,l2);
end; end;
{ We only check for the high bound if it is < 255, because { We only check for the high bound if it is < 255, because
set elements higher than 255 do nt exist, the its always true, set elements higher than 255 do nt exist, the its always true,
@ -291,12 +296,12 @@ implementation
setparts[i].stop+1,newreference(p^.left^.location.reference)))); setparts[i].stop+1,newreference(p^.left^.location.reference))));
end; end;
{ If higher, element is in set } { If higher, element is in set }
emitl(A_JB,l); emitjmp(C_B,l);
end end
else else
begin begin
exprasmlist^.concat(new(pai386,op_none(A_STC,S_NO))); exprasmlist^.concat(new(pai386,op_none(A_STC,S_NO)));
emitl(A_JMP,l); emitjmp(C_None,l);
end; end;
end; end;
{ Emit the jump over label } { Emit the jump over label }
@ -317,7 +322,7 @@ implementation
if ranges then if ranges then
exprasmlist^.concat(new(pai386,op_none(A_STC,S_NO))); exprasmlist^.concat(new(pai386,op_none(A_STC,S_NO)));
{ If found, jump to end } { If found, jump to end }
emitl(A_JE,l); emitjmp(C_E,l);
end; end;
if ranges then if ranges then
exprasmlist^.concat(new(pai386,op_none(A_CLC,S_NO))); exprasmlist^.concat(new(pai386,op_none(A_CLC,S_NO)));
@ -444,7 +449,7 @@ implementation
var var
with_sign : boolean; with_sign : boolean;
opsize : topsize; opsize : topsize;
jmp_gt,jmp_le,jmp_lee : tasmop; jmp_gt,jmp_le,jmp_lee : tasmcond;
hp : ptree; hp : ptree;
{ register with case expression } { register with case expression }
hregister : tregister; hregister : tregister;
@ -461,7 +466,7 @@ implementation
lesslabel,greaterlabel : plabel; lesslabel,greaterlabel : plabel;
begin begin
emitl(A_LABEL,p^._at); emitlab(p^._at);
{ calculate labels for left and right } { calculate labels for left and right }
if (p^.less=nil) then if (p^.less=nil) then
lesslabel:=elselabel lesslabel:=elselabel
@ -477,23 +482,21 @@ implementation
begin begin
exprasmlist^.concat(new(pai386,op_const_reg(A_CMP,opsize,p^._low,hregister))); exprasmlist^.concat(new(pai386,op_const_reg(A_CMP,opsize,p^._low,hregister)));
if greaterlabel=lesslabel then if greaterlabel=lesslabel then
begin emitjmp(C_NE,lesslabel)
emitl(A_JNE,lesslabel);
end
else else
begin begin
emitl(jmp_le,lesslabel); emitjmp(jmp_le,lesslabel);
emitl(jmp_gt,greaterlabel); emitjmp(jmp_gt,greaterlabel);
end; end;
emitl(A_JMP,p^.statement); emitjmp(C_None,p^.statement);
end end
else else
begin begin
exprasmlist^.concat(new(pai386,op_const_reg(A_CMP,opsize,p^._low,hregister))); exprasmlist^.concat(new(pai386,op_const_reg(A_CMP,opsize,p^._low,hregister)));
emitl(jmp_le,lesslabel); emitjmp(jmp_le,lesslabel);
exprasmlist^.concat(new(pai386,op_const_reg(A_CMP,opsize,p^._high,hregister))); exprasmlist^.concat(new(pai386,op_const_reg(A_CMP,opsize,p^._high,hregister)));
emitl(jmp_gt,greaterlabel); emitjmp(jmp_gt,greaterlabel);
emitl(A_JMP,p^.statement); emitjmp(C_None,p^.statement);
end; end;
if assigned(p^.less) then if assigned(p^.less) then
gentreejmp(p^.less); gentreejmp(p^.less);
@ -517,7 +520,7 @@ implementation
if first and (t^._low>get_min_value(p^.left^.resulttype)) then if first and (t^._low>get_min_value(p^.left^.resulttype)) then
begin begin
exprasmlist^.concat(new(pai386,op_const_reg(A_CMP,opsize,t^._low,hregister))); exprasmlist^.concat(new(pai386,op_const_reg(A_CMP,opsize,t^._low,hregister)));
emitl(jmp_le,elselabel); emitjmp(jmp_le,elselabel);
end; end;
if t^._low=t^._high then if t^._low=t^._high then
begin begin
@ -528,8 +531,7 @@ implementation
else else
exprasmlist^.concat(new(pai386,op_const_reg(A_SUB,opsize,t^._low-last,hregister))); exprasmlist^.concat(new(pai386,op_const_reg(A_SUB,opsize,t^._low-last,hregister)));
last:=t^._low; last:=t^._low;
emitjmp(C_Z,t^.statement);
emitl(A_JZ,t^.statement);
end end
else else
begin begin
@ -565,12 +567,12 @@ implementation
if (t^._low-last>1) then if (t^._low-last>1) then
begin begin
exprasmlist^.concat(new(pai386,op_const_reg(A_SUB,opsize,t^._low-last,hregister))); exprasmlist^.concat(new(pai386,op_const_reg(A_SUB,opsize,t^._low-last,hregister)));
emitl(jmp_le,elselabel); emitjmp(jmp_le,elselabel);
end end
else else
exprasmlist^.concat(new(pai386,op_reg(A_DEC,opsize,hregister))); exprasmlist^.concat(new(pai386,op_reg(A_DEC,opsize,hregister)));
exprasmlist^.concat(new(pai386,op_const_reg(A_SUB,opsize,t^._high-t^._low,hregister))); exprasmlist^.concat(new(pai386,op_const_reg(A_SUB,opsize,t^._high-t^._low,hregister)));
emitl(jmp_lee,t^.statement); emitjmp(jmp_lee,t^.statement);
last:=t^._high; last:=t^._high;
end; end;
@ -583,7 +585,7 @@ implementation
last:=0; last:=0;
first:=true; first:=true;
genitem(hp); genitem(hp);
emitl(A_JMP,elselabel); emitjmp(C_None,elselabel);
end; end;
procedure genjumptable(hp : pcaserecord;min_,max_ : longint); procedure genjumptable(hp : pcaserecord;min_,max_ : longint);
@ -618,9 +620,9 @@ implementation
begin begin
exprasmlist^.concat(new(pai386,op_const_reg(A_CMP,opsize,min_,hregister))); exprasmlist^.concat(new(pai386,op_const_reg(A_CMP,opsize,min_,hregister)));
{ case expr less than min_ => goto elselabel } { case expr less than min_ => goto elselabel }
emitl(jmp_le,elselabel); emitjmp(jmp_le,elselabel);
exprasmlist^.concat(new(pai386,op_const_reg(A_CMP,opsize,max_,hregister))); exprasmlist^.concat(new(pai386,op_const_reg(A_CMP,opsize,max_,hregister)));
emitl(jmp_gt,elselabel); emitjmp(jmp_gt,elselabel);
end; end;
getlabel(table); getlabel(table);
{ extend with sign } { extend with sign }
@ -670,15 +672,15 @@ implementation
with_sign:=is_signed(p^.left^.resulttype); with_sign:=is_signed(p^.left^.resulttype);
if with_sign then if with_sign then
begin begin
jmp_gt:=A_JG; jmp_gt:=C_G;
jmp_le:=A_JL; jmp_le:=C_L;
jmp_lee:=A_JLE; jmp_lee:=C_LE;
end end
else else
begin begin
jmp_gt:=A_JA; jmp_gt:=C_A;
jmp_le:=A_JB; jmp_le:=C_B;
jmp_lee:=A_JBE; jmp_lee:=C_BE;
end; end;
cleartempgen; cleartempgen;
secondpass(p^.left); secondpass(p^.left);
@ -779,24 +781,27 @@ implementation
secondpass(hp^.right); secondpass(hp^.right);
{ don't come back to case line } { don't come back to case line }
aktfilepos:=exprasmlist^.getlasttaifilepos^; aktfilepos:=exprasmlist^.getlasttaifilepos^;
emitl(A_JMP,endlabel); emitjmp(C_None,endlabel);
hp:=hp^.left; hp:=hp^.left;
end; end;
emitl(A_LABEL,elselabel); emitlab(elselabel);
{ ...and the else block } { ...and the else block }
if assigned(p^.elseblock) then if assigned(p^.elseblock) then
begin begin
cleartempgen; cleartempgen;
secondpass(p^.elseblock); secondpass(p^.elseblock);
end; end;
emitl(A_LABEL,endlabel); emitlab(endlabel);
end; end;
end. end.
{ {
$Log$ $Log$
Revision 1.21 1999-02-17 10:12:59 peter Revision 1.22 1999-02-22 02:15:16 peter
* updates for ag386bin
Revision 1.21 1999/02/17 10:12:59 peter
* removed memory leak when jumps are generated * removed memory leak when jumps are generated
Revision 1.20 1998/12/11 00:02:56 peter Revision 1.20 1998/12/11 00:02:56 peter

View File

@ -1791,7 +1791,7 @@ Begin
If (GetLastInstruction(p, hp) And If (GetLastInstruction(p, hp) And
Not(((hp^.typ = ait_labeled_instruction) or Not(((hp^.typ = ait_labeled_instruction) or
(hp^.typ = ait_instruction)) And (hp^.typ = ait_instruction)) And
(Pai_Labeled(hp)^._operator = A_JMP)) (pai386_labeled(hp)^._operator = A_JMP))
Then Then
{previous instruction not a JMP -> the contents of the registers after the {previous instruction not a JMP -> the contents of the registers after the
previous intruction has been executed have to be taken into account as well} previous intruction has been executed have to be taken into account as well}
@ -1808,7 +1808,7 @@ Begin
already been processed} already been processed}
If GetLastInstruction(p, hp) And If GetLastInstruction(p, hp) And
Not(hp^.typ = ait_labeled_instruction) And Not(hp^.typ = ait_labeled_instruction) And
(Pai_Labeled(hp)^._operator = A_JMP)) (pai386_labeled(hp)^._operator = A_JMP))
Then Then
{previous instruction not a jmp, so keep all the registers' contents from the {previous instruction not a jmp, so keep all the registers' contents from the
previous instruction} previous instruction}
@ -1825,7 +1825,7 @@ Begin
been processed} been processed}
While GetNextInstruction(hp, hp) And While GetNextInstruction(hp, hp) And
Not((hp^.typ = ait_labeled_instruction) And Not((hp^.typ = ait_labeled_instruction) And
(Pai_Labeled(hp)^.lab^.nb = Pai_Label(p)^.l^.nb)) And (pai386_labeled(hp)^.lab^.nb = Pai_Label(p)^.l^.nb)) And
Not((hp^.typ = ait_label) And Not((hp^.typ = ait_label) And
(LTable^[Pai_Label(hp)^.l^.nb-LoLab].RefsFound (LTable^[Pai_Label(hp)^.l^.nb-LoLab].RefsFound
= Pai_Label(hp)^.l^.RefCount) And = Pai_Label(hp)^.l^.RefCount) And
@ -1863,8 +1863,8 @@ Begin
{$IfNDef JumpAnal} {$IfNDef JumpAnal}
; ;
{$Else JumpAnal} {$Else JumpAnal}
With LTable^[Pai_Labeled(p)^.lab^.nb-LoLab] Do With LTable^[pai386_labeled(p)^.lab^.nb-LoLab] Do
If (RefsFound = Pai_Labeled(p)^.lab^.RefCount) Then If (RefsFound = pai386_labeled(p)^.lab^.RefCount) Then
Begin Begin
If (InstrCnt < InstrNr) If (InstrCnt < InstrNr)
Then Then
@ -1890,7 +1890,7 @@ Begin
{ If (JmpsProcessed > 0) Or { If (JmpsProcessed > 0) Or
Not(GetLastInstruction(PaiObj, hp) And Not(GetLastInstruction(PaiObj, hp) And
(hp^.typ = ait_labeled_instruction) And (hp^.typ = ait_labeled_instruction) And
(Pai_Labeled(hp)^._operator = A_JMP)) (pai386_labeled(hp)^._operator = A_JMP))
Then} Then}
{instruction prior to label is not a jmp, or at least one jump to the label {instruction prior to label is not a jmp, or at least one jump to the label
has yet been processed} has yet been processed}
@ -2154,9 +2154,9 @@ Begin
Case P^.Typ Of Case P^.Typ Of
ait_labeled_instruction: ait_labeled_instruction:
begin begin
If (Pai_Labeled(P)^.lab^.nb >= LoLab) And If (pai386_labeled(P)^.lab^.nb >= LoLab) And
(Pai_Labeled(P)^.lab^.nb <= HiLab) Then (pai386_labeled(P)^.lab^.nb <= HiLab) Then
Inc(LTable^[Pai_Labeled(P)^.lab^.nb-LoLab].RefsFound); Inc(LTable^[pai386_labeled(P)^.lab^.nb-LoLab].RefsFound);
end; end;
ait_label: ait_label:
Begin Begin
@ -2227,7 +2227,10 @@ End.
{ {
$Log$ $Log$
Revision 1.36 1999-01-20 17:41:26 jonas Revision 1.37 1999-02-22 02:15:20 peter
* updates for ag386bin
Revision 1.36 1999/01/20 17:41:26 jonas
* small bugfix (memory corruption could occur when certain fpu instructions * small bugfix (memory corruption could occur when certain fpu instructions
were encountered) were encountered)

View File

@ -27,8 +27,12 @@ unit hcodegen;
uses uses
verbose,aasm,tree,symtable,cobjects verbose,aasm,tree,symtable,cobjects
{$ifdef i386} {$ifdef i386}
{$ifdef ag386bin}
,i386base
{$else}
,i386 ,i386
{$endif} {$endif}
{$endif}
{$ifdef m68k} {$ifdef m68k}
,m68k ,m68k
{$endif} {$endif}
@ -360,7 +364,10 @@ end.
{ {
$Log$ $Log$
Revision 1.25 1999-01-21 22:10:45 peter Revision 1.26 1999-02-22 02:15:21 peter
* updates for ag386bin
Revision 1.25 1999/01/21 22:10:45 peter
* fixed array of const * fixed array of const
* generic platform independent high() support * generic platform independent high() support

View File

@ -194,7 +194,6 @@ unit i386;
firstop = low(tasmop); firstop = low(tasmop);
lastop = high(tasmop); lastop = high(tasmop);
type type
{ enumeration for registers, don't change the order } { enumeration for registers, don't change the order }
{ it's used by the register size conversions } { it's used by the register size conversions }
@ -297,13 +296,23 @@ unit i386;
offset : longint; offset : longint;
end; end;
type
{ Only here for easier adaption of the internal assembler }
TAsmCond=(C_None,
C_A,C_AE,C_B,C_BE,C_C,C_E,C_G,C_GE,C_L,C_LE,C_NA,C_NAE,
C_NB,C_NBE,C_NC,C_NE,C_NG,C_NGE,C_NL,C_NLE,C_NO,C_NP,
C_NS,C_NZ,C_O,C_P,C_PE,C_PO,C_S,C_Z
);
const const
{ arrays for boolean location conversions } flag_2_cond : array[TResFlags] of TAsmCond =
flag_2_jmp : array[F_E..F_BE] of tasmop = (C_E,C_NE,C_G,C_L,C_GE,C_LE,C_C,C_NC,C_A,C_AE,C_B,C_BE);
(A_JE,A_JNE,A_JG,A_JL,A_JGE,A_JLE,A_JC,A_JNC,
A_JA,A_JAE,A_JB,A_JBE);
flag_2_set : array[F_E..F_BE] of tasmop = { arrays for boolean location conversions }
{flag_2_jmp : array[F_E..F_BE] of tasmop =
(A_JE,A_JNE,A_JG,A_JL,A_JGE,A_JLE,A_JC,A_JNC,
A_JA,A_JAE,A_JB,A_JBE);}
flag_2_set : array[TResFlags] of tasmop =
(A_SETE,A_SETNE,A_SETG,A_SETL,A_SETGE,A_SETLE,A_SETB,A_SETAE, (A_SETE,A_SETNE,A_SETG,A_SETL,A_SETGE,A_SETLE,A_SETB,A_SETAE,
A_SETA,A_SETAE,A_SETB,A_SETBE); A_SETA,A_SETAE,A_SETB,A_SETBE);
@ -369,12 +378,12 @@ unit i386;
sizepostfix_pointer = S_L; sizepostfix_pointer = S_L;
type type
pai_labeled = ^tai_labeled; pai386_labeled = ^tai386_labeled;
tai_labeled = object(tai) tai386_labeled = object(tai)
_operator : tasmop; _operator : tasmop;
lab : plabel; lab : plabel;
constructor init(op : tasmop; l : plabel); constructor op_lab(op : tasmop; l : plabel);
destructor done;virtual; destructor done;virtual;
end; end;
@ -1929,7 +1938,7 @@ unit i386;
TAI_LABELED TAI_LABELED
****************************************************************************} ****************************************************************************}
constructor tai_labeled.init(op : tasmop; l : plabel); constructor tai386_labeled.op_lab(op : tasmop; l : plabel);
begin begin
inherited init; inherited init;
@ -1940,7 +1949,7 @@ unit i386;
inc(lab^.refcount); inc(lab^.refcount);
end; end;
destructor tai_labeled.done; destructor tai386_labeled.done;
begin begin
dec(lab^.refcount); dec(lab^.refcount);
@ -1983,7 +1992,10 @@ Begin
end. end.
{ {
$Log$ $Log$
Revision 1.34 1999-01-26 11:32:14 pierre Revision 1.35 1999-02-22 02:15:23 peter
* updates for ag386bin
Revision 1.34 1999/01/26 11:32:14 pierre
* ppheap init code can be called before any getmem * ppheap init code can be called before any getmem
Revision 1.33 1999/01/25 09:29:38 florian Revision 1.33 1999/01/25 09:29:38 florian

View File

@ -49,7 +49,12 @@ implementation
,gdb ,gdb
{$endif} {$endif}
{$ifdef i386} {$ifdef i386}
,i386,tgeni386,cgai386 {$ifdef Ag386Bin}
,i386base,i386asm
{$else}
,i386
{$endif}
,tgeni386,cgai386
,cg386con,cg386mat,cg386cnv,cg386set,cg386add ,cg386con,cg386mat,cg386cnv,cg386set,cg386add
,cg386mem,cg386cal,cg386ld,cg386flw,cg386inl ,cg386mem,cg386cal,cg386ld,cg386flw,cg386inl
{$endif} {$endif}
@ -495,7 +500,10 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.14 1999-01-23 23:29:37 florian Revision 1.15 1999-02-22 02:15:25 peter
* updates for ag386bin
Revision 1.14 1999/01/23 23:29:37 florian
* first running version of the new code generator * first running version of the new code generator
* when compiling exceptions under Linux fixed * when compiling exceptions under Linux fixed

View File

@ -53,8 +53,12 @@ unit pexpr;
,pbase,pdecl ,pbase,pdecl
{ processor specific stuff } { processor specific stuff }
{$ifdef i386} {$ifdef i386}
{$ifdef ag386bin}
,i386base
{$else}
,i386 ,i386
{$endif} {$endif}
{$endif}
{$ifdef m68k} {$ifdef m68k}
,m68k ,m68k
{$endif} {$endif}
@ -1940,7 +1944,10 @@ unit pexpr;
end. end.
{ {
$Log$ $Log$
Revision 1.83 1999-02-11 09:46:25 pierre Revision 1.84 1999-02-22 02:15:26 peter
* updates for ag386bin
Revision 1.83 1999/02/11 09:46:25 pierre
* fix for normal method calls inside static methods : * fix for normal method calls inside static methods :
WARNING there were both parser and codegen errors !! WARNING there were both parser and codegen errors !!
added static_call boolean to calln tree added static_call boolean to calln tree

View File

@ -41,8 +41,12 @@ unit pmodules;
symtable,aasm,hcodegen, symtable,aasm,hcodegen,
link,assemble,import,export,gendef,ppu,comprsrc link,assemble,import,export,gendef,ppu,comprsrc
{$ifdef i386} {$ifdef i386}
{$ifdef Ag386Bin}
,i386base,i386asm
{$else}
,i386 ,i386
{$endif} {$endif}
{$endif}
{$ifdef m68k} {$ifdef m68k}
,m68k ,m68k
{$endif} {$endif}
@ -1241,7 +1245,10 @@ unit pmodules;
end. end.
{ {
$Log$ $Log$
Revision 1.97 1999-02-16 00:45:31 peter Revision 1.98 1999-02-22 02:15:29 peter
* updates for ag386bin
Revision 1.97 1999/02/16 00:45:31 peter
* fixed crashes by forgotten strpnew() for init_symbol * fixed crashes by forgotten strpnew() for init_symbol
Revision 1.96 1999/02/05 08:54:27 pierre Revision 1.96 1999/02/05 08:54:27 pierre

View File

@ -53,7 +53,7 @@ Var
UsedRegs, TmpUsedRegs: TRegSet; UsedRegs, TmpUsedRegs: TRegSet;
Procedure GetFinalDestination(hp: pai_labeled); Procedure GetFinalDestination(hp: pai386_labeled);
{traces sucessive jumps to their final destination and sets it, e.g. {traces sucessive jumps to their final destination and sets it, e.g.
je l1 je l3 je l1 je l3
<code> <code> <code> <code>
@ -85,15 +85,15 @@ Var
p1 := LTable^[hp^.lab^.nb-LoLab].PaiObj; {the jump's destination} p1 := LTable^[hp^.lab^.nb-LoLab].PaiObj; {the jump's destination}
p1 := SkipLabels(p1); p1 := SkipLabels(p1);
If (pai(p1)^.typ = ait_labeled_instruction) and If (pai(p1)^.typ = ait_labeled_instruction) and
((pai_labeled(p1)^._operator = A_JMP) or ((pai386_labeled(p1)^._operator = A_JMP) or
(pai_labeled(p1)^._operator = hp^._operator)) (pai386_labeled(p1)^._operator = hp^._operator))
Then Then
Begin Begin
GetFinalDestination(pai_labeled(p1)); GetFinalDestination(pai386_labeled(p1));
Dec(hp^.lab^.refcount); Dec(hp^.lab^.refcount);
If (hp^.lab^.refcount = 0) Then If (hp^.lab^.refcount = 0) Then
hp^.lab^.is_used := False; hp^.lab^.is_used := False;
hp^.lab := pai_labeled(p1)^.lab; hp^.lab := pai386_labeled(p1)^.lab;
Inc(hp^.lab^.refcount); Inc(hp^.lab^.refcount);
End End
End End
@ -110,7 +110,7 @@ Begin
Begin Begin
{the following if-block removes all code between a jmp and the next label, {the following if-block removes all code between a jmp and the next label,
because it can never be executed} because it can never be executed}
If (pai_labeled(p)^._operator = A_JMP) Then If (pai386_labeled(p)^._operator = A_JMP) Then
Begin Begin
hp1 := pai(p^.next); hp1 := pai(p^.next);
While GetNextInstruction(p, hp1) and While GetNextInstruction(p, hp1) and
@ -126,33 +126,33 @@ Begin
If GetNextInstruction(p, hp1) then If GetNextInstruction(p, hp1) then
Begin Begin
If (pai(hp1)^.typ=ait_labeled_instruction) and If (pai(hp1)^.typ=ait_labeled_instruction) and
(pai_labeled(hp1)^._operator=A_JMP) and (pai386_labeled(hp1)^._operator=A_JMP) and
GetNextInstruction(hp1, hp2) And GetNextInstruction(hp1, hp2) And
FindLabel(pai_labeled(p)^.lab, hp2) FindLabel(pai386_labeled(p)^.lab, hp2)
Then Then
Begin Begin
Case pai_labeled(p)^._operator Of Case pai386_labeled(p)^._operator Of
A_JE : pai_labeled(p)^._operator:=A_JNE; A_JE : pai386_labeled(p)^._operator:=A_JNE;
A_JNE : pai_labeled(p)^._operator:=A_JE; A_JNE : pai386_labeled(p)^._operator:=A_JE;
A_JL : pai_labeled(p)^._operator:=A_JGE; A_JL : pai386_labeled(p)^._operator:=A_JGE;
A_JG : pai_labeled(p)^._operator:=A_JLE; A_JG : pai386_labeled(p)^._operator:=A_JLE;
A_JLE : pai_labeled(p)^._operator:=A_JG; A_JLE : pai386_labeled(p)^._operator:=A_JG;
A_JGE : pai_labeled(p)^._operator:=A_JL; A_JGE : pai386_labeled(p)^._operator:=A_JL;
A_JNZ : pai_labeled(p)^._operator:=A_JZ; A_JNZ : pai386_labeled(p)^._operator:=A_JZ;
A_JNO : pai_labeled(p)^._operator:=A_JO; A_JNO : pai386_labeled(p)^._operator:=A_JO;
A_JZ : pai_labeled(p)^._operator:=A_JNZ; A_JZ : pai386_labeled(p)^._operator:=A_JNZ;
A_JS : pai_labeled(p)^._operator:=A_JNS; A_JS : pai386_labeled(p)^._operator:=A_JNS;
A_JNS : pai_labeled(p)^._operator:=A_JS; A_JNS : pai386_labeled(p)^._operator:=A_JS;
A_JO : pai_labeled(p)^._operator:=A_JNO; A_JO : pai386_labeled(p)^._operator:=A_JNO;
A_JC : pai_labeled(p)^._operator:=A_JNC; A_JC : pai386_labeled(p)^._operator:=A_JNC;
A_JNC : pai_labeled(p)^._operator:=A_JC; A_JNC : pai386_labeled(p)^._operator:=A_JC;
A_JA : pai_labeled(p)^._operator:=A_JBE; A_JA : pai386_labeled(p)^._operator:=A_JBE;
A_JAE : pai_labeled(p)^._operator:=A_JB; A_JAE : pai386_labeled(p)^._operator:=A_JB;
A_JB : pai_labeled(p)^._operator:=A_JAE; A_JB : pai386_labeled(p)^._operator:=A_JAE;
A_JBE : pai_labeled(p)^._operator:=A_JA; A_JBE : pai386_labeled(p)^._operator:=A_JA;
Else Else
begin begin
If (LabDif <> 0) Then GetFinalDestination(pai_labeled(p)); If (LabDif <> 0) Then GetFinalDestination(pai386_labeled(p));
p:=pai(p^.next); p:=pai(p^.next);
continue; continue;
end; end;
@ -160,14 +160,14 @@ Begin
Dec(pai_label(hp2)^.l^.refcount); Dec(pai_label(hp2)^.l^.refcount);
If (pai_label(hp2)^.l^.refcount = 0) Then If (pai_label(hp2)^.l^.refcount = 0) Then
pai_label(hp2)^.l^.is_used := False; pai_label(hp2)^.l^.is_used := False;
pai_labeled(p)^.lab:=pai_labeled(hp1)^.lab; pai386_labeled(p)^.lab:=pai386_labeled(hp1)^.lab;
Inc(pai_labeled(p)^.lab^.refcount); Inc(pai386_labeled(p)^.lab^.refcount);
asml^.remove(hp1); asml^.remove(hp1);
dispose(hp1,done); dispose(hp1,done);
If (LabDif <> 0) Then GetFinalDestination(pai_labeled(p)); If (LabDif <> 0) Then GetFinalDestination(pai386_labeled(p));
end end
else else
if FindLabel(pai_labeled(p)^.lab, hp1) then if FindLabel(pai386_labeled(p)^.lab, hp1) then
Begin Begin
hp2:=pai(hp1^.next); hp2:=pai(hp1^.next);
asml^.remove(p); asml^.remove(p);
@ -175,7 +175,7 @@ Begin
p:=hp2; p:=hp2;
continue; continue;
end end
Else If (LabDif <> 0) Then GetFinalDestination(pai_labeled(p)); Else If (LabDif <> 0) Then GetFinalDestination(pai386_labeled(p));
end end
end; end;
ait_instruction: ait_instruction:
@ -389,8 +389,8 @@ Begin
(Not(GetNextInstruction(p, hp1)) Or (Not(GetNextInstruction(p, hp1)) Or
{GetNextInstruction(p, hp1) And} {GetNextInstruction(p, hp1) And}
Not((Pai(hp1)^.typ = ait_labeled_instruction) And Not((Pai(hp1)^.typ = ait_labeled_instruction) And
((pai_labeled(hp1)^._operator = A_JO) or ((pai386_labeled(hp1)^._operator = A_JO) or
(pai_labeled(hp1)^._operator = A_JNO)))) (pai386_labeled(hp1)^._operator = A_JNO))))
Then Then
Begin Begin
New(TmpRef); New(TmpRef);
@ -1521,9 +1521,9 @@ Begin
If (AktOptProcessor < ClassP6) And If (AktOptProcessor < ClassP6) And
GetNextInstruction(p, hp1) And GetNextInstruction(p, hp1) And
(hp1^.typ = ait_labeled_instruction) And (hp1^.typ = ait_labeled_instruction) And
(Pai_Labeled(hp1)^._operator = A_JMP) Then (pai386_labeled(hp1)^._operator = A_JMP) Then
Begin Begin
hp2 := New(Pai386,op_csymbol(A_PUSH,S_L,NewCSymbol(Lab2Str(Pai_Labeled(hp1)^.lab),0))); hp2 := New(Pai386,op_csymbol(A_PUSH,S_L,NewCSymbol(Lab2Str(pai386_labeled(hp1)^.lab),0)));
hp2^.fileinfo := p^.fileinfo; hp2^.fileinfo := p^.fileinfo;
InsertLLItem(AsmL, p^.previous, p, hp2); InsertLLItem(AsmL, p^.previous, p, hp2);
Pai386(p)^._operator := A_JMP; Pai386(p)^._operator := A_JMP;
@ -1619,7 +1619,10 @@ End.
{ {
$Log$ $Log$
Revision 1.36 1999-01-04 22:04:15 jonas Revision 1.37 1999-02-22 02:15:30 peter
* updates for ag386bin
Revision 1.36 1999/01/04 22:04:15 jonas
+ mov reg, mem1 to mov reg, mem1 + mov reg, mem1 to mov reg, mem1
mov mem2, reg cmp reg, mem2 mov mem2, reg cmp reg, mem2
cmp mem1, reg cmp mem1, reg

View File

@ -44,7 +44,12 @@ unit pstatmnt;
symtable,aasm,pass_1,types,scanner,hcodegen,ppu symtable,aasm,pass_1,types,scanner,hcodegen,ppu
,pbase,pexpr,pdecl ,pbase,pexpr,pdecl
{$ifdef i386} {$ifdef i386}
,i386,tgeni386 {$ifdef Ag386Bin}
,i386base,i386asm
{$else}
,i386
{$endif}
,tgeni386
{$ifndef NoRa386Int} {$ifndef NoRa386Int}
,ra386int ,ra386int
{$endif NoRa386Int} {$endif NoRa386Int}
@ -1277,7 +1282,10 @@ unit pstatmnt;
end. end.
{ {
$Log$ $Log$
Revision 1.65 1999-02-15 13:13:15 pierre Revision 1.66 1999-02-22 02:15:31 peter
* updates for ag386bin
Revision 1.65 1999/02/15 13:13:15 pierre
* fix for bug0216 * fix for bug0216
Revision 1.64 1999/02/11 09:46:26 pierre Revision 1.64 1999/02/11 09:46:26 pierre

View File

@ -2186,7 +2186,7 @@ var
else if instr.operands[1].operandtype <> OPR_LABINSTR then else if instr.operands[1].operandtype <> OPR_LABINSTR then
Message(assem_e_invalid_labeled_opcode) Message(assem_e_invalid_labeled_opcode)
else if assigned(instr.operands[1].hl) then else if assigned(instr.operands[1].hl) then
ConcatLabel(p,instruct, instr.operands[1].hl) p^.concat(new(pai386_labeled,op_lab(instruct, instr.operands[1].hl)))
else else
Begin Begin
Message(assem_f_internal_error_in_concatlabeledinstr); Message(assem_f_internal_error_in_concatlabeledinstr);
@ -3424,7 +3424,7 @@ Begin
Begin Begin
getlabel(hl); getlabel(hl);
labellist.insert(actasmpattern,hl,TRUE); labellist.insert(actasmpattern,hl,TRUE);
ConcatLabel(p,A_LABEL,hl); ConcatLabel(p,hl);
end end
else else
Begin Begin
@ -3438,7 +3438,7 @@ Begin
else else
Begin Begin
if assigned(labelptr^.lab) then if assigned(labelptr^.lab) then
ConcatLabel(p,A_LABEL,labelptr^.lab); ConcatLabel(p,labelptr^.lab);
labelptr^.emitted := TRUE; labelptr^.emitted := TRUE;
end; end;
end; end;
@ -3449,7 +3449,7 @@ Begin
{ when looking for Pascal labels, these must } { when looking for Pascal labels, these must }
{ be in uppercase. } { be in uppercase. }
if SearchLabel(upper(actasmpattern),hl) then if SearchLabel(upper(actasmpattern),hl) then
ConcatLabel(p,A_LABEL, hl) ConcatLabel(p,hl)
else else
Begin Begin
if (cs_compilesystem in aktmoduleswitches) then if (cs_compilesystem in aktmoduleswitches) then
@ -3707,7 +3707,10 @@ end.
{ {
$Log$ $Log$
Revision 1.31 1999-01-29 11:24:02 pierre Revision 1.32 1999-02-22 02:15:34 peter
* updates for ag386bin
Revision 1.31 1999/01/29 11:24:02 pierre
* incompatible size warning or error suppressed for sizes > 4 * incompatible size warning or error suppressed for sizes > 4
Revision 1.30 1999/01/28 14:12:59 pierre Revision 1.30 1999/01/28 14:12:59 pierre

View File

@ -32,8 +32,13 @@ unit Ra386dir;
implementation implementation
uses uses
comphook,files,i386,hcodegen,globals,scanner,aasm, comphook,files,hcodegen,globals,scanner,aasm
cobjects,symtable,types,verbose,rautils; {$ifdef Ag386Bin}
,i386base,i386asm
{$else}
,i386
{$endif}
,cobjects,symtable,types,verbose,rautils;
function assemble : ptree; function assemble : ptree;
@ -289,7 +294,10 @@ unit Ra386dir;
end. end.
{ {
$Log$ $Log$
Revision 1.13 1999-01-27 13:04:12 pierre Revision 1.14 1999-02-22 02:15:36 peter
* updates for ag386bin
Revision 1.13 1999/01/27 13:04:12 pierre
* bug with static vars in assembler readers * bug with static vars in assembler readers
Revision 1.12 1999/01/10 15:37:57 peter Revision 1.12 1999/01/10 15:37:57 peter

View File

@ -771,7 +771,7 @@ var
else if (instr.operands[1].operandtype = OPR_LABINSTR) and else if (instr.operands[1].operandtype = OPR_LABINSTR) and
(instr.numops = 1) then (instr.numops = 1) then
if assigned(instr.operands[1].hl) then if assigned(instr.operands[1].hl) then
ConcatLabel(p,instr.getinstruction, instr.operands[1].hl) p^.concat(new(pai386_labeled,op_lab(instruc, instr.operands[1].hl)))
else else
Message(assem_f_internal_error_in_findtype); Message(assem_f_internal_error_in_findtype);
end; end;
@ -3354,7 +3354,7 @@ Begin
Begin Begin
getlabel(hl); getlabel(hl);
labellist.insert(actasmpattern,hl,TRUE); labellist.insert(actasmpattern,hl,TRUE);
ConcatLabel(p,A_LABEL,hl); ConcatLabel(p,hl);
end end
else else
{ the label has already been inserted into the } { the label has already been inserted into the }
@ -3368,7 +3368,7 @@ Begin
else else
Begin Begin
if assigned(labelptr^.lab) then if assigned(labelptr^.lab) then
ConcatLabel(p,A_LABEL,labelptr^.lab); ConcatLabel(p,labelptr^.lab);
labelptr^.emitted := TRUE; labelptr^.emitted := TRUE;
end; end;
end; end;
@ -3378,7 +3378,7 @@ Begin
AS_LABEL : AS_LABEL :
Begin Begin
if SearchLabel(actasmpattern,hl) then if SearchLabel(actasmpattern,hl) then
ConcatLabel(p,A_LABEL, hl) ConcatLabel(p,hl)
else else
Message1(assem_e_unknown_label_identifer,actasmpattern); Message1(assem_e_unknown_label_identifer,actasmpattern);
Consume(AS_LABEL); Consume(AS_LABEL);
@ -3473,7 +3473,10 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.20 1999-01-10 15:37:58 peter Revision 1.21 1999-02-22 02:15:37 peter
* updates for ag386bin
Revision 1.20 1999/01/10 15:37:58 peter
* moved some tables from ra386*.pas -> i386.pas * moved some tables from ra386*.pas -> i386.pas
+ start of coff writer + start of coff writer
* renamed asmutils unit to rautils * renamed asmutils unit to rautils

View File

@ -58,8 +58,12 @@ Uses
symtable,aasm,hcodegen,verbose,globals,files,strings, symtable,aasm,hcodegen,verbose,globals,files,strings,
cobjects, cobjects,
{$ifdef i386} {$ifdef i386}
{$ifdef Ag386Bin}
i386base;
{$else}
i386; i386;
{$endif} {$endif}
{$endif}
{$ifdef m68k} {$ifdef m68k}
m68k; m68k;
{$endif} {$endif}
@ -303,7 +307,7 @@ Type
{ swaps in the case of a 2/3 operand opcode the destination and the } { swaps in the case of a 2/3 operand opcode the destination and the }
{ source as to put it in AT&T style instruction format. } { source as to put it in AT&T style instruction format. }
Procedure SwapOperands(Var instr: TInstruction); Procedure SwapOperands(Var instr: TInstruction);
Procedure ConcatLabel(p : paasmoutput;op : tasmop;var l : plabel); Procedure ConcatLabel(p: paasmoutput;var l : plabel);
Procedure ConcatConstant(p : paasmoutput;value: longint; maxvalue: longint); Procedure ConcatConstant(p : paasmoutput;value: longint; maxvalue: longint);
Procedure ConcatRealConstant(p : paasmoutput;value: bestreal; real_typ : tfloattype); Procedure ConcatRealConstant(p : paasmoutput;value: bestreal; real_typ : tfloattype);
Procedure ConcatString(p : paasmoutput;s:string); Procedure ConcatString(p : paasmoutput;s:string);
@ -1723,17 +1727,14 @@ end;
end; end;
end; end;
Procedure ConcatLabel(p: paasmoutput;op : tasmop;var l : plabel); Procedure ConcatLabel(p: paasmoutput;var l : plabel);
{*********************************************************************} {*********************************************************************}
{ PROCEDURE ConcatLabel } { PROCEDURE ConcatLabel }
{ Description: This routine either emits a label or a labeled } { Description: This routine either emits a label or a labeled }
{ instruction to the linked list of instructions. } { instruction to the linked list of instructions. }
{*********************************************************************} {*********************************************************************}
begin begin
if op=A_LABEL then p^.concat(new(pai_label,init(l)))
p^.concat(new(pai_label,init(l)))
else
p^.concat(new(pai_labeled,init(op,l)))
end; end;
procedure ConcatPublic(p:paasmoutput;const s : string); procedure ConcatPublic(p:paasmoutput;const s : string);
@ -1809,7 +1810,10 @@ end;
end. end.
{ {
$Log$ $Log$
Revision 1.3 1999-02-16 00:47:28 peter Revision 1.4 1999-02-22 02:15:39 peter
* updates for ag386bin
Revision 1.3 1999/02/16 00:47:28 peter
* fixed local copies of value para's * fixed local copies of value para's
Revision 1.2 1999/01/27 13:04:11 pierre Revision 1.2 1999/01/27 13:04:11 pierre

View File

@ -68,11 +68,11 @@ unit systems;
,as_i386_o,as_i386_o_aout,as_i386_asw, ,as_i386_o,as_i386_o_aout,as_i386_asw,
as_i386_nasmcoff,as_i386_nasmelf,as_i386_nasmobj, as_i386_nasmcoff,as_i386_nasmelf,as_i386_nasmobj,
as_i386_tasm,as_i386_masm, as_i386_tasm,as_i386_masm,
as_i386_coff as_i386_dbg,as_i386_coff,as_i386_pecoff
,as_m68k_o,as_m68k_gas,as_m68k_mit,as_m68k_mot,as_m68k_mpw ,as_m68k_o,as_m68k_gas,as_m68k_mit,as_m68k_mot,as_m68k_mpw
); );
const const
{$ifdef i386} i386asmcnt=9; {$else} i386asmcnt=0; {$endif} {$ifdef i386} i386asmcnt=11; {$else} i386asmcnt=0; {$endif}
{$ifdef m68k} m68kasmcnt=5; {$else} m68kasmcnt=0; {$endif} {$ifdef m68k} m68kasmcnt=5; {$else} m68kasmcnt=0; {$endif}
asmcnt=i386asmcnt+m68kasmcnt+1; asmcnt=i386asmcnt+m68kasmcnt+1;
@ -523,14 +523,17 @@ implementation
labelprefix : '.L'; labelprefix : '.L';
comment : '; ' comment : '; '
) )
,(
id : as_i386_dbg;
idtxt : 'DBG'
)
,( ,(
id : as_i386_coff; id : as_i386_coff;
idtxt : 'COFF'; idtxt : 'COFF'
asmbin : 'as'; )
asmcmd : '-o $OBJ $ASM'; ,(
externals : false; id : as_i386_pecoff;
labelprefix : '.L'; idtxt : 'PECOFF'
comment : '# '
) )
{$endif i386} {$endif i386}
{$ifdef m68k} {$ifdef m68k}
@ -1324,7 +1327,10 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.56 1999-01-10 15:38:01 peter Revision 1.57 1999-02-22 02:15:42 peter
* updates for ag386bin
Revision 1.56 1999/01/10 15:38:01 peter
* moved some tables from ra386*.pas -> i386.pas * moved some tables from ra386*.pas -> i386.pas
+ start of coff writer + start of coff writer
* renamed asmutils unit to rautils * renamed asmutils unit to rautils

View File

@ -37,8 +37,12 @@ implementation
symtable,aasm,types, symtable,aasm,types,
hcodegen,htypechk,pass_1 hcodegen,htypechk,pass_1
{$ifdef i386} {$ifdef i386}
{$ifdef ag386bin}
,i386base
{$else}
,i386 ,i386
{$endif} {$endif}
{$endif}
{$ifdef m68k} {$ifdef m68k}
,m68k ,m68k
{$endif} {$endif}
@ -1013,7 +1017,10 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.21 1999-01-20 21:05:09 peter Revision 1.22 1999-02-22 02:15:43 peter
* updates for ag386bin
Revision 1.21 1999/01/20 21:05:09 peter
* fixed set operations which still had array constructor as type * fixed set operations which still had array constructor as type
Revision 1.20 1999/01/20 17:39:26 jonas Revision 1.20 1999/01/20 17:39:26 jonas

View File

@ -44,7 +44,12 @@ implementation
aasm,types, aasm,types,
hcodegen,htypechk,pass_1 hcodegen,htypechk,pass_1
{$ifdef i386} {$ifdef i386}
,i386,tgeni386 {$ifdef ag386bin}
,i386base
{$else}
,i386
{$endif}
,tgeni386
{$endif} {$endif}
{$ifdef m68k} {$ifdef m68k}
,m68k,tgen68k ,m68k,tgen68k
@ -1071,7 +1076,10 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.23 1999-02-09 17:15:52 florian Revision 1.24 1999-02-22 02:15:45 peter
* updates for ag386bin
Revision 1.23 1999/02/09 17:15:52 florian
* some false warnings "function result doesn't seems to be set" are * some false warnings "function result doesn't seems to be set" are
avoided avoided

View File

@ -44,8 +44,12 @@ implementation
symtable,aasm,types, symtable,aasm,types,
hcodegen,htypechk,pass_1 hcodegen,htypechk,pass_1
{$ifdef i386} {$ifdef i386}
{$ifdef ag386bin}
,i386base
{$else}
,i386 ,i386
{$endif} {$endif}
{$endif}
{$ifdef m68k} {$ifdef m68k}
,m68k ,m68k
{$endif} {$endif}
@ -975,7 +979,10 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.18 1999-01-27 14:56:57 pierre Revision 1.19 1999-02-22 02:15:46 peter
* updates for ag386bin
Revision 1.18 1999/01/27 14:56:57 pierre
* typo error corrected solves bug0190 and bug0204 * typo error corrected solves bug0190 and bug0204
Revision 1.17 1999/01/27 14:15:25 pierre Revision 1.17 1999/01/27 14:15:25 pierre

View File

@ -41,8 +41,12 @@ implementation
symtable,aasm,types, symtable,aasm,types,
hcodegen,pass_1 hcodegen,pass_1
{$ifdef i386} {$ifdef i386}
{$ifdef ag386bin}
,i386base
{$else}
,i386 ,i386
{$endif} {$endif}
{$endif}
{$ifdef m68k} {$ifdef m68k}
,m68k ,m68k
{$endif} {$endif}
@ -126,7 +130,10 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.3 1998-11-17 00:36:48 peter Revision 1.4 1999-02-22 02:15:47 peter
* updates for ag386bin
Revision 1.3 1998/11/17 00:36:48 peter
* more ansistring fixes * more ansistring fixes
Revision 1.2 1998/11/05 12:03:04 peter Revision 1.2 1998/11/05 12:03:04 peter

View File

@ -47,7 +47,12 @@ implementation
symtable,aasm,types, symtable,aasm,types,
hcodegen,htypechk,temp_gen,pass_1 hcodegen,htypechk,temp_gen,pass_1
{$ifdef i386} {$ifdef i386}
,i386,tgeni386 {$ifdef ag386bin}
,i386base
{$else}
,i386
{$endif}
,tgeni386
{$endif} {$endif}
{$ifdef m68k} {$ifdef m68k}
,m68k,tgen68k ,m68k,tgen68k
@ -483,7 +488,10 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.5 1999-01-13 12:01:43 peter Revision 1.6 1999-02-22 02:15:48 peter
* updates for ag386bin
Revision 1.5 1999/01/13 12:01:43 peter
* fixed crash with counter var * fixed crash with counter var
Revision 1.4 1998/12/11 00:03:55 peter Revision 1.4 1998/12/11 00:03:55 peter

View File

@ -37,7 +37,12 @@ implementation
hcodegen,htypechk,pass_1, hcodegen,htypechk,pass_1,
tccal,tcld tccal,tcld
{$ifdef i386} {$ifdef i386}
,i386,tgeni386 {$ifdef ag386bin}
,i386base
{$else}
,i386
{$endif}
,tgeni386
{$endif} {$endif}
{$ifdef m68k} {$ifdef m68k}
,m68k,tgen68k ,m68k,tgen68k
@ -967,7 +972,10 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.17 1999-02-01 00:00:50 florian Revision 1.18 1999-02-22 02:15:49 peter
* updates for ag386bin
Revision 1.17 1999/02/01 00:00:50 florian
* compiler crash fixed when constant arguments passed to round/trunc * compiler crash fixed when constant arguments passed to round/trunc
exceeds the longint range exceeds the longint range

View File

@ -42,7 +42,12 @@ implementation
hcodegen,htypechk,pass_1, hcodegen,htypechk,pass_1,
tccnv tccnv
{$ifdef i386} {$ifdef i386}
,i386,tgeni386 {$ifdef ag386bin}
,i386base
{$else}
,i386
{$endif}
,tgeni386
{$endif} {$endif}
{$ifdef m68k} {$ifdef m68k}
,m68k,tgen68k ,m68k,tgen68k
@ -447,7 +452,10 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.15 1999-02-15 13:13:19 pierre Revision 1.16 1999-02-22 02:15:52 peter
* updates for ag386bin
Revision 1.15 1999/02/15 13:13:19 pierre
* fix for bug0216 * fix for bug0216
Revision 1.14 1999/01/27 00:13:58 florian Revision 1.14 1999/01/27 00:13:58 florian

View File

@ -40,8 +40,12 @@ implementation
symtable,aasm,types, symtable,aasm,types,
hcodegen,htypechk,pass_1 hcodegen,htypechk,pass_1
{$ifdef i386} {$ifdef i386}
{$ifdef ag386bin}
,i386base
{$else}
,i386 ,i386
{$endif} {$endif}
{$endif}
{$ifdef m68k} {$ifdef m68k}
,m68k ,m68k
{$endif} {$endif}
@ -373,7 +377,10 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.11 1999-02-03 10:11:11 pierre Revision 1.12 1999-02-22 02:15:53 peter
* updates for ag386bin
Revision 1.11 1999/02/03 10:11:11 pierre
* fix for bug0211 for i386 * fix for bug0211 for i386
Revision 1.10 1998/12/11 16:50:24 florian Revision 1.10 1998/12/11 16:50:24 florian

View File

@ -48,8 +48,12 @@ implementation
symtable,aasm,types, symtable,aasm,types,
hcodegen,htypechk,pass_1 hcodegen,htypechk,pass_1
{$ifdef i386} {$ifdef i386}
{$ifdef ag386bin}
,i386base
{$else}
,i386 ,i386
{$endif} {$endif}
{$endif}
{$ifdef m68k} {$ifdef m68k}
,m68k ,m68k
{$endif} {$endif}
@ -553,7 +557,10 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.10 1999-02-04 11:44:47 florian Revision 1.11 1999-02-22 02:15:54 peter
* updates for ag386bin
Revision 1.10 1999/02/04 11:44:47 florian
* fixed indexed access of ansistrings to temp. ansistring, i.e. * fixed indexed access of ansistrings to temp. ansistring, i.e.
c:=(s1+s2)[i], the temp is now correctly remove and the generated c:=(s1+s2)[i], the temp is now correctly remove and the generated
code is also fixed code is also fixed

View File

@ -40,7 +40,12 @@ implementation
symtable,aasm,types, symtable,aasm,types,
hcodegen,htypechk,pass_1 hcodegen,htypechk,pass_1
{$ifdef i386} {$ifdef i386}
,i386,tgeni386 {$ifdef ag386bin}
,i386base
{$else}
,i386
{$endif}
,tgeni386
{$endif} {$endif}
{$ifdef m68k} {$ifdef m68k}
,m68k,tgen68k ,m68k,tgen68k
@ -244,7 +249,10 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.5 1998-12-18 17:15:40 peter Revision 1.6 1999-02-22 02:15:55 peter
* updates for ag386bin
Revision 1.5 1998/12/18 17:15:40 peter
* added 'in []' support * added 'in []' support
Revision 1.4 1998/12/11 00:03:58 peter Revision 1.4 1998/12/11 00:03:58 peter

View File

@ -26,7 +26,11 @@ unit temp_gen;
uses uses
{$ifdef i386} {$ifdef i386}
{$ifdef ag386bin}
i386base,
{$else}
i386, i386,
{$endif}
{$endif i386} {$endif i386}
{$ifdef m68k} {$ifdef m68k}
m68k, m68k,
@ -504,7 +508,10 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.8 1999-02-11 09:35:19 pierre Revision 1.9 1999-02-22 02:15:56 peter
* updates for ag386bin
Revision 1.8 1999/02/11 09:35:19 pierre
* ExtDebug conditionnal infinite loop on temp problem removed * ExtDebug conditionnal infinite loop on temp problem removed
Revision 1.7 1999/02/02 23:52:33 florian Revision 1.7 1999/02/02 23:52:33 florian

View File

@ -27,7 +27,11 @@ unit tgeni386;
uses uses
cobjects,globals,tree,hcodegen,verbose,files,aasm cobjects,globals,tree,hcodegen,verbose,files,aasm
{$ifdef i386} {$ifdef i386}
{$ifdef ag386bin}
,i386base,i386asm
{$else}
,i386 ,i386
{$endif}
{$endif} {$endif}
; ;
@ -370,7 +374,10 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.18 1999-01-18 16:02:20 pierre Revision 1.19 1999-02-22 02:15:58 peter
* updates for ag386bin
Revision 1.18 1999/01/18 16:02:20 pierre
* better error info with -Co * better error info with -Co
Revision 1.17 1998/12/11 23:36:09 florian Revision 1.17 1998/12/11 23:36:09 florian

View File

@ -30,7 +30,9 @@ unit tree;
uses uses
globtype,cobjects,symtable,aasm globtype,cobjects,symtable,aasm
{$ifdef i386} {$ifdef ag386bin}
,i386base
{$else}
,i386 ,i386
{$endif} {$endif}
{$ifdef m68k} {$ifdef m68k}
@ -1686,7 +1688,10 @@ unit tree;
end. end.
{ {
$Log$ $Log$
Revision 1.65 1999-02-11 09:46:31 pierre Revision 1.66 1999-02-22 02:15:59 peter
* updates for ag386bin
Revision 1.65 1999/02/11 09:46:31 pierre
* fix for normal method calls inside static methods : * fix for normal method calls inside static methods :
WARNING there were both parser and codegen errors !! WARNING there were both parser and codegen errors !!
added static_call boolean to calln tree added static_call boolean to calln tree