Browse Source

+ added some code for ansistring (not complete nor working yet)
* corrected operator overloading
* corrected nasm output
+ started inline procedures
+ added starstarn : use ** for exponentiation (^ gave problems)
+ started UseTokenInfo cond to get accurate positions

pierre 27 years ago
parent
commit
5cdd60cac8

+ 71 - 9
compiler/aasm.pas

@@ -29,6 +29,11 @@ unit aasm;
 
 
 {$I version.inc}
 {$I version.inc}
     type
     type
+{$ifdef klaempfl}
+{$ifdef ver0_9_2}
+       extended = double;
+{$endif ver0_9_2}
+{$endif klaempfl}
        tait = (
        tait = (
           ait_string,
           ait_string,
           ait_label,
           ait_label,
@@ -84,6 +89,7 @@ unit aasm;
           len : longint;
           len : longint;
           constructor init(const _str : string);
           constructor init(const _str : string);
           constructor init_pchar(_str : pchar);
           constructor init_pchar(_str : pchar);
+          constructor init_length_pchar(_str : pchar;length : longint);
           destructor done;virtual;
           destructor done;virtual;
        end;
        end;
 
 
@@ -141,6 +147,15 @@ unit aasm;
           destructor done; virtual;
           destructor done; virtual;
        end;
        end;
 
 
+       { to insert a comment into the generated assembler file }
+
+       pai_asm_comment = ^tai_asm_comment;
+       tai_asm_comment = object(tai)
+          str : pchar;
+          constructor init(_str : pchar);
+          destructor done; virtual;
+       end;
+
 
 
        { alignment for operator }
        { alignment for operator }
        pai_align = ^tai_align;
        pai_align = ^tai_align;
@@ -193,6 +208,16 @@ unit aasm;
           constructor init(_value : double);
           constructor init(_value : double);
        end;
        end;
 
 
+       pai_comp = ^tai_comp;
+
+       { generates an comp (integer over 64 bits) }
+       tai_comp = object(tai)
+          value : bestreal;
+          constructor init(_value : bestreal);
+          { usefull for 64 bits apps, maybe later  }
+          constructor init_comp(_value : comp);
+       end;
+
        pai_single = ^tai_single;
        pai_single = ^tai_single;
 
 
        { generates a single (32 bit real) }
        { generates a single (32 bit real) }
@@ -241,14 +266,6 @@ type
        tai_bestreal = tai_single;
        tai_bestreal = tai_single;
 {$endif m68k}
 {$endif m68k}
 
 
-       pai_comp = ^tai_comp;
-
-       { generates an comp (integer over 64 bits) }
-       tai_comp = object(tai)
-          value : bestreal;
-          constructor init(_value : bestreal);
-       end;
-
        paasmoutput = ^taasmoutput;
        paasmoutput = ^taasmoutput;
        taasmoutput = tlinkedlist;
        taasmoutput = tlinkedlist;
 
 
@@ -542,6 +559,14 @@ type
          value:=_value;
          value:=_value;
       end;
       end;
 
 
+    constructor tai_comp.init_comp(_value : comp);
+
+      begin
+         inherited init;
+         typ:=ait_comp;
+         value:=_value;
+      end;
+
 {****************************************************************************
 {****************************************************************************
                                TAI_STRING
                                TAI_STRING
  ****************************************************************************}
  ****************************************************************************}
@@ -565,6 +590,15 @@ type
           len:=strlen(_str);
           len:=strlen(_str);
        end;
        end;
 
 
+    constructor tai_string.init_length_pchar(_str : pchar;length : longint);
+
+       begin
+          inherited init;
+          typ:=ait_string;
+          str:=_str;
+          len:=length;
+       end;
+
     destructor tai_string.done;
     destructor tai_string.done;
 
 
       begin
       begin
@@ -619,6 +653,26 @@ type
          inherited done;
          inherited done;
       end;
       end;
 
 
+{****************************************************************************
+                              TAI_ASM_COMMENT
+  comment to be inserted in the assembler file
+ ****************************************************************************}
+
+     constructor tai_asm_comment.init(_str : pchar);
+
+       begin
+          inherited init;
+          typ:=ait_comment;
+          str:=_str;
+       end;
+
+    destructor tai_asm_comment.done;
+
+      begin
+         strdispose(str);
+         inherited done;
+      end;
+
 {****************************************************************************
 {****************************************************************************
                               TAI_ALIGN
                               TAI_ALIGN
  ****************************************************************************}
  ****************************************************************************}
@@ -667,7 +721,15 @@ type
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.3  1998-04-27 23:10:27  peter
+  Revision 1.4  1998-04-29 10:33:40  pierre
+    + added some code for ansistring (not complete nor working yet)
+    * corrected operator overloading
+    * corrected nasm output
+    + started inline procedures
+    + added starstarn : use ** for exponentiation (^ gave problems)
+    + started UseTokenInfo cond to get accurate positions
+
+  Revision 1.3  1998/04/27 23:10:27  peter
     + new scanner
     + new scanner
     * $makelib -> if smartlink
     * $makelib -> if smartlink
     * small filename fixes pmodule.setfilename
     * small filename fixes pmodule.setfilename

+ 40 - 15
compiler/ag386int.pas

@@ -179,12 +179,12 @@ unit ag386int;
                          S_B : hs:='byte '+hs;
                          S_B : hs:='byte '+hs;
                          S_W : hs:='word '+hs;
                          S_W : hs:='word '+hs;
                          S_L : hs:='dword '+hs;
                          S_L : hs:='dword '+hs;
-                         S_S : hs:='dword '+hs;
-                         S_Q : hs:='qword '+hs;
-                         S_X : if current_module^.output_format in [of_nasm,of_obj] then
-                                 hs:='tword '+hs
-                               else
-                                 hs:='tbyte '+hs;
+                         S_IS : hs:='word '+hs;
+                         S_IL : hs:='dword '+hs;
+                         S_IQ : hs:='qword '+hs;
+                         S_FS : hs:='dword '+hs;
+                         S_FL : hs:='qword '+hs;
+                         S_FX : hs:='tword '+hs;
                          S_BW : if dest then
                          S_BW : if dest then
                              hs:='word '+hs
                              hs:='word '+hs
                            else
                            else
@@ -210,6 +210,12 @@ unit ag386int;
                S_B : hs:='byte ptr '+hs;
                S_B : hs:='byte ptr '+hs;
                S_W : hs:='word ptr '+hs;
                S_W : hs:='word ptr '+hs;
                S_L : hs:='dword ptr '+hs;
                S_L : hs:='dword ptr '+hs;
+               S_IS : hs:='word ptr '+hs;
+               S_IL : hs:='dword ptr '+hs;
+               S_IQ : hs:='qword ptr '+hs;
+               S_FS : hs:='dword ptr '+hs;
+               S_FL : hs:='qword ptr '+hs;
+               S_FX : hs:='tbyte ptr '+hs;
                S_BW : if dest then
                S_BW : if dest then
                    hs:='word ptr '+hs
                    hs:='word ptr '+hs
                  else
                  else
@@ -316,7 +322,12 @@ unit ag386int;
       while assigned(hp) do
       while assigned(hp) do
        begin
        begin
          case hp^.typ of
          case hp^.typ of
-       ait_comment : ;
+           ait_comment :
+             Begin
+                AsmWrite(As_comment);
+                AsmWritePChar(pai_asm_comment(hp)^.str);
+                AsmLn;
+             End;
          ait_align : begin
          ait_align : begin
                      { align not supported at all with nasm v095  }
                      { align not supported at all with nasm v095  }
                      { align with specific value not supported by }
                      { align with specific value not supported by }
@@ -324,8 +335,8 @@ unit ag386int;
                      { CAUSES PROBLEMS WITH THE SEGMENT DEFINITION   }
                      { CAUSES PROBLEMS WITH THE SEGMENT DEFINITION   }
                      { SEGMENT DEFINITION SHOULD MATCH TYPE OF ALIGN }
                      { SEGMENT DEFINITION SHOULD MATCH TYPE OF ALIGN }
                      { HERE UNDER TASM!                              }
                      { HERE UNDER TASM!                              }
-{                      if current_module^.output_format<>of_nasm then
-                        AsmWriteLn(#9'ALIGN '+tostr(pai_align(hp)^.aligntype));}
+                     { if current_module^.output_format<>of_nasm then }
+                        AsmWriteLn(#9'ALIGN '+tostr(pai_align(hp)^.aligntype));
                      end;
                      end;
       ait_external : begin
       ait_external : begin
                        if current_module^.output_format in [of_nasm,of_obj] then
                        if current_module^.output_format in [of_nasm,of_obj] then
@@ -541,8 +552,12 @@ ait_labeled_instruction :
                            begin
                            begin
                              if output_format=of_nasm then
                              if output_format=of_nasm then
                               s:=getopstr_jmp(pai386(hp)^.op1t,pai386(hp)^.op1)
                               s:=getopstr_jmp(pai386(hp)^.op1t,pai386(hp)^.op1)
+                              { with tasm call near ptr [edi+12] does not
+                                work but call near [edi+12] works ?? (PM)}
+                             else if pai386(hp)^.op1t=top_ref then
+                                s:='near '+getopstr_jmp(pai386(hp)^.op1t,pai386(hp)^.op1)
                              else
                              else
-                              s:='near ptr '+getopstr_jmp(pai386(hp)^.op1t,pai386(hp)^.op1);
+                                s:='near ptr '+getopstr_jmp(pai386(hp)^.op1t,pai386(hp)^.op1);
                            end
                            end
                           else
                           else
                            begin
                            begin
@@ -602,6 +617,7 @@ ait_stab_function_name : ;
 
 
 
 
     procedure ti386intasmlist.WriteAsmList;
     procedure ti386intasmlist.WriteAsmList;
+
     begin
     begin
 {$ifdef EXTDEBUG}
 {$ifdef EXTDEBUG}
       if assigned(current_module^.mainsource) then
       if assigned(current_module^.mainsource) then
@@ -635,21 +651,22 @@ ait_stab_function_name : ;
        end
        end
       else
       else
        begin
        begin
-         AsmWriteLn('.386p');
+         AsmWriteLn(#9'.386p');
+         AsmWriteLn(#9'LOCALS '+target_info.labelprefix);
 
 
          WriteTree(externals);
          WriteTree(externals);
          { INTEL ASM doesn't support stabs
          { INTEL ASM doesn't support stabs
          WriteTree(debuglist);}
          WriteTree(debuglist);}
 
 
          AsmWriteLn('DGROUP'#9#9'GROUP'#9'_BSS,_DATA');
          AsmWriteLn('DGROUP'#9#9'GROUP'#9'_BSS,_DATA');
-         AsmWriteLn('_TEXT'#9#9'SEGMENT'#9'BYTE PUBLIC USE32 ''CODE''');
+         AsmWriteLn('_TEXT'#9#9'SEGMENT'#9'PARA PUBLIC USE32 ''CODE''');
          AsmWriteLn(#9#9'ASSUME'#9'CS:_TEXT,ES:DGROUP,DS:DGROUP,SS:DGROUP');
          AsmWriteLn(#9#9'ASSUME'#9'CS:_TEXT,ES:DGROUP,DS:DGROUP,SS:DGROUP');
          AsmLn;
          AsmLn;
          WriteTree(codesegment);
          WriteTree(codesegment);
          AsmWriteLn('_TEXT'#9#9'ENDS');
          AsmWriteLn('_TEXT'#9#9'ENDS');
 
 
          AsmLn;
          AsmLn;
-         AsmWriteLn('_DATA'#9#9'SEGMENT'#9'DWORD PUBLIC USE32 ''DATA''');
+         AsmWriteLn('_DATA'#9#9'SEGMENT'#9'PARA PUBLIC USE32 ''DATA''');
 {$ifdef EXTDEBUG}
 {$ifdef EXTDEBUG}
          AsmWriteLn(#9#9'DB'#9'"compiled by FPC '+version_string+'\0"');
          AsmWriteLn(#9#9'DB'#9'"compiled by FPC '+version_string+'\0"');
          AsmWriteLn(#9#9'DB'#9'"target: '+target_info.target_name+'\0"');
          AsmWriteLn(#9#9'DB'#9'"target: '+target_info.target_name+'\0"');
@@ -659,7 +676,7 @@ ait_stab_function_name : ;
          AsmWriteLn('_DATA'#9#9'ENDS');
          AsmWriteLn('_DATA'#9#9'ENDS');
 
 
          AsmLn;
          AsmLn;
-         AsmWriteLn('_BSS'#9#9'SEGMENT'#9'DWORD PUBLIC USE32 ''BSS''');
+         AsmWriteLn('_BSS'#9#9'SEGMENT'#9'PARA PUBLIC USE32 ''BSS''');
          WriteTree(bsssegment);
          WriteTree(bsssegment);
          AsmWriteLn('_BSS'#9#9'ENDS');
          AsmWriteLn('_BSS'#9#9'ENDS');
 
 
@@ -675,7 +692,15 @@ ait_stab_function_name : ;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.3  1998-04-08 16:58:01  pierre
+  Revision 1.4  1998-04-29 10:33:41  pierre
+    + added some code for ansistring (not complete nor working yet)
+    * corrected operator overloading
+    * corrected nasm output
+    + started inline procedures
+    + added starstarn : use ** for exponentiation (^ gave problems)
+    + started UseTokenInfo cond to get accurate positions
+
+  Revision 1.3  1998/04/08 16:58:01  pierre
     * several bugfixes
     * several bugfixes
       ADD ADC and AND are also sign extended
       ADD ADC and AND are also sign extended
       nasm output OK (program still crashes at end
       nasm output OK (program still crashes at end

+ 16 - 3
compiler/ag68kgas.pas

@@ -243,7 +243,12 @@ unit ag68kgas;
 {$endif GDB}
 {$endif GDB}
 
 
          case hp^.typ of
          case hp^.typ of
-       ait_comment,
+           ait_comment :
+             Begin
+                AsmWrite(As_comment);
+                AsmWritePChar(pai_asm_comment(hp)^.str);
+                AsmLn;
+             End;
       ait_external : ; { external is ignored }
       ait_external : ; { external is ignored }
          ait_align : AsmWriteLn(#9'.align '+tostr(pai_align(hp)^.aligntype));
          ait_align : AsmWriteLn(#9'.align '+tostr(pai_align(hp)^.aligntype));
      ait_datablock : begin
      ait_datablock : begin
@@ -548,8 +553,16 @@ ait_stab_function_name : funcname:=pai_stab_function_name(hp)^.str;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.1  1998-03-25 11:18:16  root
-  Initial revision
+  Revision 1.2  1998-04-29 10:33:41  pierre
+    + added some code for ansistring (not complete nor working yet)
+    * corrected operator overloading
+    * corrected nasm output
+    + started inline procedures
+    + added starstarn : use ** for exponentiation (^ gave problems)
+    + started UseTokenInfo cond to get accurate positions
+
+  Revision 1.1.1.1  1998/03/25 11:18:16  root
+  * Restored version
 
 
   Revision 1.3  1998/03/22 12:45:37  florian
   Revision 1.3  1998/03/22 12:45:37  florian
     * changes of Carl-Eric to m68k target commit:
     * changes of Carl-Eric to m68k target commit:

+ 16 - 3
compiler/ag68kmit.pas

@@ -279,7 +279,12 @@ unit ag68kmit;
           end;
           end;
 {$endif GDB}
 {$endif GDB}
          case hp^.typ of
          case hp^.typ of
-       ait_comment,
+           ait_comment :
+             Begin
+                AsmWrite(As_comment);
+                AsmWritePChar(pai_asm_comment(hp)^.str);
+                AsmLn;
+             End;
       ait_external : ; { external is ignored }
       ait_external : ; { external is ignored }
          ait_align : AsmWriteLn(#9'.align '+tostr(pai_align(hp)^.aligntype));
          ait_align : AsmWriteLn(#9'.align '+tostr(pai_align(hp)^.aligntype));
      ait_datablock : begin
      ait_datablock : begin
@@ -588,8 +593,16 @@ ait_stab_function_name : funcname:=pai_stab_function_name(hp)^.str;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.1  1998-03-25 11:18:16  root
-  Initial revision
+  Revision 1.2  1998-04-29 10:33:42  pierre
+    + added some code for ansistring (not complete nor working yet)
+    * corrected operator overloading
+    * corrected nasm output
+    + started inline procedures
+    + added starstarn : use ** for exponentiation (^ gave problems)
+    + started UseTokenInfo cond to get accurate positions
+
+  Revision 1.1.1.1  1998/03/25 11:18:16  root
+  * Restored version
 
 
   Revision 1.3  1998/03/22 12:45:37  florian
   Revision 1.3  1998/03/22 12:45:37  florian
     * changes of Carl-Eric to m68k target commit:
     * changes of Carl-Eric to m68k target commit:

+ 16 - 3
compiler/ag68kmot.pas

@@ -226,7 +226,12 @@ unit ag68kmot;
       while assigned(hp) do
       while assigned(hp) do
        begin
        begin
          case hp^.typ of
          case hp^.typ of
-       ait_comment : ;
+           ait_comment :
+             Begin
+                AsmWrite(As_comment);
+                AsmWritePChar(pai_asm_comment(hp)^.str);
+                AsmLn;
+             End;
          ait_align : AsmWriteLn(#9'CNOP 0,'+tostr(pai_align(hp)^.aligntype));
          ait_align : AsmWriteLn(#9'CNOP 0,'+tostr(pai_align(hp)^.aligntype));
       ait_external : AsmWriteLn(#9'XREF'#9+StrPas(pai_external(hp)^.name));
       ait_external : AsmWriteLn(#9'XREF'#9+StrPas(pai_external(hp)^.name));
  ait_real_extended : Message(assem_e_extended_not_supported);
  ait_real_extended : Message(assem_e_extended_not_supported);
@@ -493,8 +498,16 @@ ait_labeled_instruction :
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.1  1998-03-25 11:18:16  root
-  Initial revision
+  Revision 1.2  1998-04-29 10:33:42  pierre
+    + added some code for ansistring (not complete nor working yet)
+    * corrected operator overloading
+    * corrected nasm output
+    + started inline procedures
+    + added starstarn : use ** for exponentiation (^ gave problems)
+    + started UseTokenInfo cond to get accurate positions
+
+  Revision 1.1.1.1  1998/03/25 11:18:16  root
+  * Restored version
 
 
   Revision 1.3  1998/03/22 12:45:37  florian
   Revision 1.3  1998/03/22 12:45:37  florian
     * changes of Carl-Eric to m68k target commit:
     * changes of Carl-Eric to m68k target commit:

+ 40 - 32
compiler/aopt386.inc

@@ -637,13 +637,13 @@ Begin
         If (Reg32(TRegister(Pai386(oldp)^.op1)) in RegsNotYetChecked) Then
         If (Reg32(TRegister(Pai386(oldp)^.op1)) in RegsNotYetChecked) Then
           Begin
           Begin
             RegsNotYetChecked := RegsNotYetChecked - [Reg32(TRegister(Pai386(oldp)^.op1))];
             RegsNotYetChecked := RegsNotYetChecked - [Reg32(TRegister(Pai386(oldp)^.op1))];
-            If Assigned(newp^.Last)
+            If Assigned(newp^.previous)
               Then
               Then
                 Begin
                 Begin
-                  TmpP := Pai(newp^.last);
-                  While Assigned (TmpP^.Last) And
+                  TmpP := Pai(newp^.previous);
+                  While Assigned (TmpP^.previous) And
                         PPaiProp(TmpP^.Line)^.CanBeRemoved Do
                         PPaiProp(TmpP^.Line)^.CanBeRemoved Do
-                    TmpP := Pai(TmpP^.Last);
+                    TmpP := Pai(TmpP^.previous);
                   TmpResult := Assigned(TmpP) And
                   TmpResult := Assigned(TmpP) And
                                RegsSameContent(oldp, TmpP, Reg32(TRegister(Pai386(oldp)^.op1)))
                                RegsSameContent(oldp, TmpP, Reg32(TRegister(Pai386(oldp)^.op1)))
                 End
                 End
@@ -656,13 +656,13 @@ Begin
                (Base <> R_NO) Then
                (Base <> R_NO) Then
               Begin
               Begin
                 RegsNotYetChecked := RegsNotYetChecked - [Base];
                 RegsNotYetChecked := RegsNotYetChecked - [Base];
-                If Assigned(newp^.Last)
+                If Assigned(newp^.previous)
                   Then
                   Then
                     Begin
                     Begin
-                      TmpP := Pai(newp^.last);
-                      While Assigned (TmpP^.Last) And
+                      TmpP := Pai(newp^.previous);
+                      While Assigned (TmpP^.previous) And
                             PPaiProp(TmpP^.Line)^.CanBeRemoved Do
                             PPaiProp(TmpP^.Line)^.CanBeRemoved Do
-                        TmpP := Pai(TmpP^.Last);
+                        TmpP := Pai(TmpP^.previous);
                       TmpResult := Assigned(TmpP) And
                       TmpResult := Assigned(TmpP) And
                                    RegsSameContent(oldp, TmpP, Base)
                                    RegsSameContent(oldp, TmpP, Base)
                     End
                     End
@@ -673,13 +673,13 @@ Begin
                (Index in RegsNotYetChecked) Then
                (Index in RegsNotYetChecked) Then
               Begin
               Begin
                 RegsNotYetChecked := RegsNotYetChecked - [Index];
                 RegsNotYetChecked := RegsNotYetChecked - [Index];
-                If Assigned(newp^.Last)
+                If Assigned(newp^.previous)
                   Then
                   Then
                     Begin
                     Begin
-                      TmpP := Pai(newp^.last);
-                      While Assigned (TmpP^.Last) And
+                      TmpP := Pai(newp^.previous);
+                      While Assigned (TmpP^.previous) And
                             PPaiProp(TmpP^.Line)^.CanBeRemoved Do
                             PPaiProp(TmpP^.Line)^.CanBeRemoved Do
-                        TmpP := Pai(TmpP^.Last);
+                        TmpP := Pai(TmpP^.previous);
                       TmpResult := Assigned(TmpP) And
                       TmpResult := Assigned(TmpP) And
                                    RegsSameContent(oldp, TmpP, Index)
                                    RegsSameContent(oldp, TmpP, Index)
                     End
                     End
@@ -693,13 +693,13 @@ End;
 Begin {CheckSequence}
 Begin {CheckSequence}
   Reg := Reg32(Reg);
   Reg := Reg32(Reg);
   Found := 0;
   Found := 0;
-  hp2 := PPaiProp(Pai(p^.last)^.line)^.Regs[Reg].StartMod;
+  hp2 := PPaiProp(Pai(p^.previous)^.line)^.Regs[Reg].StartMod;
   hp3 := p;
   hp3 := p;
-  EndMod := PPaiProp(Pai(p^.last)^.line)^.Regs[Reg].StartMod;
+  EndMod := PPaiProp(Pai(p^.previous)^.line)^.Regs[Reg].StartMod;
   RegsNotYetChecked := [R_EAX..R_EDI];
   RegsNotYetChecked := [R_EAX..R_EDI];
-  For Counter := 2 to PPaiProp(Pai(p^.last)^.line)^.Regs[Reg].NrOfMods Do
+  For Counter := 2 to PPaiProp(Pai(p^.previous)^.line)^.Regs[Reg].NrOfMods Do
     EndMod := Pai(EndMod^.Next);
     EndMod := Pai(EndMod^.Next);
-  While (Found <> PPaiProp(Pai(p^.last)^.line)^.Regs[Reg].NrOfMods) And
+  While (Found <> PPaiProp(Pai(p^.previous)^.line)^.Regs[Reg].NrOfMods) And
          InstructionsEqual(hp2, hp3) And
          InstructionsEqual(hp2, hp3) And
          NoChangedRegInRef(EndMod, hp3) Do
          NoChangedRegInRef(EndMod, hp3) Do
     Begin
     Begin
@@ -707,10 +707,10 @@ Begin {CheckSequence}
       hp3 := Pai(hp3^.next);
       hp3 := Pai(hp3^.next);
       Inc(Found)
       Inc(Found)
     End;
     End;
-  If (Found <> PPaiProp(Pai(p^.last)^.line)^.Regs[Reg].NrOfMods)
+  If (Found <> PPaiProp(Pai(p^.previous)^.line)^.Regs[Reg].NrOfMods)
      Then
      Then
        Begin
        Begin
-         If ((Found+1) = PPaiProp(Pai(p^.last)^.line)^.Regs[Reg].NrOfMods) And
+         If ((Found+1) = PPaiProp(Pai(p^.previous)^.line)^.Regs[Reg].NrOfMods) And
            Assigned(hp2) And
            Assigned(hp2) And
            (Pai(hp2)^.typ = ait_instruction) And
            (Pai(hp2)^.typ = ait_instruction) And
            (Pai386(hp2)^._operator In [A_MOV, A_MOVZX]) And
            (Pai386(hp2)^._operator In [A_MOV, A_MOVZX]) And
@@ -821,7 +821,7 @@ Begin
         Then TmpProp := @PaiPropBlock^[InstrCnt]
         Then TmpProp := @PaiPropBlock^[InstrCnt]
         Else New(TmpProp);
         Else New(TmpProp);
       If (p <> First)
       If (p <> First)
-        Then TmpProp^ := PPaiProp(Pai(p^.last)^.line)^
+        Then TmpProp^ := PPaiProp(Pai(p^.previous)^.line)^
         Else FillChar(TmpProp^, SizeOf(TmpProp^), 0);
         Else FillChar(TmpProp^, SizeOf(TmpProp^), 0);
       TmpProp^.LineSave := p^.line;
       TmpProp^.LineSave := p^.line;
       PPaiProp(p^.line) := TmpProp;
       PPaiProp(p^.line) := TmpProp;
@@ -993,8 +993,8 @@ Begin
         ait_instruction:
         ait_instruction:
           Begin
           Begin
             Case Pai386(p)^._operator Of
             Case Pai386(p)^._operator Of
-              A_CLD: If Assigned(p^.last) And
-                        (PPaiProp(Pai(p^.last)^.line)^.DirFlag = F_NotSet) Then
+              A_CLD: If Assigned(p^.previous) And
+                        (PPaiProp(Pai(p^.previous)^.line)^.DirFlag = F_NotSet) Then
                           PPaiProp(Pai(p)^.line)^.CanBeRemoved := True;
                           PPaiProp(Pai(p)^.line)^.CanBeRemoved := True;
 {$IfDef OptimizeMovs}
 {$IfDef OptimizeMovs}
               A_MOV, A_MOVZX, A_MOVSX:
               A_MOV, A_MOVZX, A_MOVSX:
@@ -1009,8 +1009,8 @@ Begin
                       Begin {destination is always a register in this case}
                       Begin {destination is always a register in this case}
                         With PPaiProp(p^.line)^.Regs[Reg32(Tregister(Pai386(p)^.op2))] Do
                         With PPaiProp(p^.line)^.Regs[Reg32(Tregister(Pai386(p)^.op2))] Do
                           Begin
                           Begin
-                            If Assigned(p^.last) And
-                               (PPaiProp(Pai(p^.last)^.line)^.Regs[Reg32(TRegister(Pai386(p)^.op2))].typ = con_ref) Then
+                            If Assigned(p^.previous) And
+                               (PPaiProp(Pai(p^.previous)^.line)^.Regs[Reg32(TRegister(Pai386(p)^.op2))].typ = con_ref) Then
    {so we don't try to check a sequence when the register only contains a constant}
    {so we don't try to check a sequence when the register only contains a constant}
                                If CheckSequence(p, TRegister(Pai386(p)^.op2), Cnt) And
                                If CheckSequence(p, TRegister(Pai386(p)^.op2), Cnt) And
                                   (Cnt > 0)
                                   (Cnt > 0)
@@ -1067,8 +1067,8 @@ Begin
                         Case Pai386(p)^.op2t Of
                         Case Pai386(p)^.op2t Of
                           Top_Reg:
                           Top_Reg:
                             Begin
                             Begin
-                              If Assigned(p^.last) Then
-                                With PPaiProp(Pai(p^.last)^.line)^.Regs[Reg32(TRegister(Pai386(p)^.op2))] Do
+                              If Assigned(p^.previous) Then
+                                With PPaiProp(Pai(p^.previous)^.line)^.Regs[Reg32(TRegister(Pai386(p)^.op2))] Do
                                   If (Typ = Con_Const) And
                                   If (Typ = Con_Const) And
                                      (StartMod = Pai386(p)^.op1) Then
                                      (StartMod = Pai386(p)^.op1) Then
                                     PPaiProp(p^.line)^.CanBeRemoved := True;
                                     PPaiProp(p^.line)^.CanBeRemoved := True;
@@ -1079,17 +1079,17 @@ Begin
                   End;
                   End;
                 End;
                 End;
 {$EndIf OptimizeMovs}
 {$EndIf OptimizeMovs}
-              A_STD: If Assigned(p^.last) And
-                        (PPaiProp(Pai(p^.last)^.line)^.DirFlag = F_Set) Then
+              A_STD: If Assigned(p^.previous) And
+                        (PPaiProp(Pai(p^.previous)^.line)^.DirFlag = F_Set) Then
                         PPaiProp(Pai(p)^.line)^.CanBeRemoved := True;
                         PPaiProp(Pai(p)^.line)^.CanBeRemoved := True;
               A_XOR:
               A_XOR:
                 Begin
                 Begin
                   If (Pai386(p)^.op1t = top_reg) And
                   If (Pai386(p)^.op1t = top_reg) And
                      (Pai386(p)^.op2t = top_reg) And
                      (Pai386(p)^.op2t = top_reg) And
                      (Pai386(p)^.op1 = Pai386(p)^.op2) And
                      (Pai386(p)^.op1 = Pai386(p)^.op2) And
-                     Assigned(p^.last) And
-                     (PPaiProp(Pai(p^.last)^.line)^.Regs[Reg32(Tregister(Pai386(p)^.op1))].typ = con_const) And
-                     (PPaiProp(Pai(p^.last)^.line)^.Regs[Reg32(Tregister(Pai386(p)^.op1))].StartMod = Pointer(0))
+                     Assigned(p^.previous) And
+                     (PPaiProp(Pai(p^.previous)^.line)^.Regs[Reg32(Tregister(Pai386(p)^.op1))].typ = con_const) And
+                     (PPaiProp(Pai(p^.previous)^.line)^.Regs[Reg32(Tregister(Pai386(p)^.op1))].StartMod = Pointer(0))
                     Then PPaiProp(p^.line)^.CanBeRemoved := True
                     Then PPaiProp(p^.line)^.CanBeRemoved := True
                 End
                 End
             End
             End
@@ -1148,7 +1148,7 @@ Var p: Pai;
 Begin
 Begin
   P := Pai(AsmL^.First);
   P := Pai(AsmL^.First);
   NrOfPaiObjs := 1;
   NrOfPaiObjs := 1;
-  While (P <> Pai(AsmL^.Last)) Do
+  While (P <> Pai(AsmL^.last)) Do
     Begin
     Begin
       Inc(NrOfPaiObjs);
       Inc(NrOfPaiObjs);
       P := Pai(P^.next)
       P := Pai(P^.next)
@@ -1191,7 +1191,15 @@ End;
 
 
 {
 {
  $Log$
  $Log$
- Revision 1.4  1998-04-21 11:30:14  peter
+ Revision 1.5  1998-04-29 10:33:42  pierre
+   + added some code for ansistring (not complete nor working yet)
+   * corrected operator overloading
+   * corrected nasm output
+   + started inline procedures
+   + added starstarn : use ** for exponentiation (^ gave problems)
+   + started UseTokenInfo cond to get accurate positions
+
+ Revision 1.4  1998/04/21 11:30:14  peter
    * fixed $ifdef regalloc
    * fixed $ifdef regalloc
 
 
  Revision 1.3  1998/04/16 16:53:56  jonas
  Revision 1.3  1998/04/16 16:53:56  jonas

+ 28 - 20
compiler/aopt386.pas

@@ -154,10 +154,10 @@ End;
    last pai object in Last. Returns false if there isn't any}
    last pai object in Last. Returns false if there isn't any}
   Begin
   Begin
     GetLastInstruction := False;
     GetLastInstruction := False;
-    Current := Pai(Current^.Last);
+    Current := Pai(Current^.previous);
     While Assigned(Current) And
     While Assigned(Current) And
           (Pai(Current)^.typ In SkipInstr) Do
           (Pai(Current)^.typ In SkipInstr) Do
-      Current := Pai(Current^.Last);
+      Current := Pai(Current^.previous);
     If Assigned(Current)
     If Assigned(Current)
       Then
       Then
         Begin
         Begin
@@ -222,10 +222,10 @@ End;
               Begin
               Begin
                 If Assigned(new_one) Then
                 If Assigned(new_one) Then
                   Begin
                   Begin
-                    new_one^.last := prev;
+                    new_one^.previous := prev;
                     new_one^.next := foll;
                     new_one^.next := foll;
                     prev^.next := new_one;
                     prev^.next := new_one;
-                    foll^.last := new_one;
+                    foll^.previous := new_one;
                   End;
                   End;
               End
               End
             Else AsmL^.Concat(new_one)
             Else AsmL^.Concat(new_one)
@@ -517,7 +517,7 @@ End;
                                    Else hp1 := New(Pai386, op_ref_reg(A_LEA, S_L, TmpRef,
                                    Else hp1 := New(Pai386, op_ref_reg(A_LEA, S_L, TmpRef,
                                     TRegister(twowords(Pai386(p)^.op2).word2)));
                                     TRegister(twowords(Pai386(p)^.op2).word2)));
                                  hp1^.line := p^.line;
                                  hp1^.line := p^.line;
-                                 InsertLLItem(p^.last, p^.next, hp1);
+                                 InsertLLItem(p^.previous, p^.next, hp1);
                                  Dispose(p, Done);
                                  Dispose(p, Done);
                                  p := hp1;
                                  p := hp1;
                               End;
                               End;
@@ -534,7 +534,7 @@ End;
                                   Else hp1 := New(Pai386, op_ref_reg(A_LEA, S_L, TmpRef,
                                   Else hp1 := New(Pai386, op_ref_reg(A_LEA, S_L, TmpRef,
                                    TRegister(twowords(Pai386(p)^.op2).word2)));
                                    TRegister(twowords(Pai386(p)^.op2).word2)));
                                 hp1^.line:= p^.line;
                                 hp1^.line:= p^.line;
-                                InsertLLItem(p^.last, p^.next, hp1);
+                                InsertLLItem(p^.previous, p^.next, hp1);
                                 Dispose(p, Done);
                                 Dispose(p, Done);
                                 p := hp1;
                                 p := hp1;
                               End;
                               End;
@@ -585,7 +585,7 @@ End;
                                             hp1 :=  New(Pai386, op_ref_reg(A_LEA, S_L, TmpRef, TRegister(Pai386(p)^.op2)));
                                             hp1 :=  New(Pai386, op_ref_reg(A_LEA, S_L, TmpRef, TRegister(Pai386(p)^.op2)));
                                           End;
                                           End;
                                       hp1^.line := p^.line;
                                       hp1^.line := p^.line;
-                                      InsertLLItem(p^.last, p^.next, hp1);
+                                      InsertLLItem(p^.previous, p^.next, hp1);
                                       Dispose(p, Done);
                                       Dispose(p, Done);
                                       p := Pai(hp1^.next);
                                       p := Pai(hp1^.next);
                                     End
                                     End
@@ -604,7 +604,7 @@ End;
                                      Else hp1 := New(Pai386, op_ref_reg(A_LEA, S_L, TmpRef,
                                      Else hp1 := New(Pai386, op_ref_reg(A_LEA, S_L, TmpRef,
                                       TRegister(twowords(Pai386(p)^.op2).word2)));
                                       TRegister(twowords(Pai386(p)^.op2).word2)));
                                    hp1^.line := p^.line;
                                    hp1^.line := p^.line;
-                                   InsertLLItem(p^.last, p^.next, hp1);
+                                   InsertLLItem(p^.previous, p^.next, hp1);
                                    Dispose(p, Done);
                                    Dispose(p, Done);
                                    p := hp1;
                                    p := hp1;
                                  End;
                                  End;
@@ -637,7 +637,7 @@ End;
                                            hp1 :=  New(Pai386, op_ref_reg(A_LEA, S_L, TmpRef,
                                            hp1 :=  New(Pai386, op_ref_reg(A_LEA, S_L, TmpRef,
                                              TRegister(Pai386(p)^.op2)));
                                              TRegister(Pai386(p)^.op2)));
                                      hp1^.line := p^.line;
                                      hp1^.line := p^.line;
-                                     InsertLLItem(p^.last, p^.next, hp1);
+                                     InsertLLItem(p^.previous, p^.next, hp1);
                                      Dispose(p, Done);
                                      Dispose(p, Done);
                                      p := Pai(hp1^.next);
                                      p := Pai(hp1^.next);
                                    End
                                    End
@@ -693,7 +693,7 @@ End;
                                                TRegister(Pai386(p)^.op2)));
                                                TRegister(Pai386(p)^.op2)));
                                            End;
                                            End;
                                        hp1^.line := p^.line;
                                        hp1^.line := p^.line;
-                                       InsertLLItem(p^.last, p^.next, hp1);
+                                       InsertLLItem(p^.previous, p^.next, hp1);
                                        Dispose(p, Done);
                                        Dispose(p, Done);
                                        p := Pai(hp1^.next);
                                        p := Pai(hp1^.next);
                                      End
                                      End
@@ -715,7 +715,7 @@ End;
                          hp1 := New(Pai386, op_reg_reg(A_MOV, S_L,PReference(Pai386(p)^.op1)^.Base,
                          hp1 := New(Pai386, op_reg_reg(A_MOV, S_L,PReference(Pai386(p)^.op1)^.Base,
                            TRegister(Pai386(p)^.op2)));
                            TRegister(Pai386(p)^.op2)));
                          hp1^.line := p^.line;
                          hp1^.line := p^.line;
-                         InsertLLItem(p^.last,p^.next, hp1);
+                         InsertLLItem(p^.previous,p^.next, hp1);
                          Dispose(p, Done);
                          Dispose(p, Done);
                          p := hp1;
                          p := hp1;
                          Continue;
                          Continue;
@@ -1113,7 +1113,7 @@ End;
                                                              TRegister(Pai386(p)^.op2),
                                                              TRegister(Pai386(p)^.op2),
                                                              TRegister(Pai386(p)^.op2)));
                                                              TRegister(Pai386(p)^.op2)));
                                                   hp1^.line := p^.line;
                                                   hp1^.line := p^.line;
-                                                  InsertLLItem(p^.last, p, hp1);
+                                                  InsertLLItem(p^.previous, p, hp1);
                                                   Pai386(p)^._operator := A_MOV;
                                                   Pai386(p)^._operator := A_MOV;
                                                   Pai386(p)^.size := S_B;
                                                   Pai386(p)^.size := S_B;
                                                   Pai386(p)^.op2 :=
                                                   Pai386(p)^.op2 :=
@@ -1172,7 +1172,7 @@ End;
                                       Pai386(p)^._operator := A_MOV;
                                       Pai386(p)^._operator := A_MOV;
                                       Pai386(p)^.size := S_B;
                                       Pai386(p)^.size := S_B;
                                       Pai386(p)^.op2 := Pointer(Reg32ToReg8(TRegister(Pai386(p)^.op2)));
                                       Pai386(p)^.op2 := Pointer(Reg32ToReg8(TRegister(Pai386(p)^.op2)));
-                                      InsertLLItem(p^.last, p, hp1);
+                                      InsertLLItem(p^.previous, p, hp1);
                                     End
                                     End
                                   Else
                                   Else
                                     If {Assigned(p^.next) And}
                                     If {Assigned(p^.next) And}
@@ -1331,7 +1331,7 @@ End;
                                          Else hp1 := New(Pai386, op_ref_reg(A_LEA, S_L, TmpRef,
                                          Else hp1 := New(Pai386, op_ref_reg(A_LEA, S_L, TmpRef,
                                                          TRegister(Pai386(p)^.op2)));
                                                          TRegister(Pai386(p)^.op2)));
                                        hp1^.line := p^.line;
                                        hp1^.line := p^.line;
-                                       InsertLLItem(p^.last, p^.next, hp1);
+                                       InsertLLItem(p^.previous, p^.next, hp1);
                                        Dispose(p, Done);
                                        Dispose(p, Done);
                                        p := hp1;
                                        p := hp1;
                                      End;
                                      End;
@@ -1349,7 +1349,7 @@ End;
                                      hp1 := new(Pai386,op_reg_reg(A_ADD,Pai386(p)^.Size,
                                      hp1 := new(Pai386,op_reg_reg(A_ADD,Pai386(p)^.Size,
                                                 TRegister(Pai386(p)^.op2), TRegister(Pai386(p)^.op2)));
                                                 TRegister(Pai386(p)^.op2), TRegister(Pai386(p)^.op2)));
                                      hp1^.line := p^.line;
                                      hp1^.line := p^.line;
-                                     InsertLLItem(p^.last, p^.next, hp1);
+                                     InsertLLItem(p^.previous, p^.next, hp1);
                                      Dispose(p, done);
                                      Dispose(p, done);
                                      p := hp1;
                                      p := hp1;
                                    End
                                    End
@@ -1368,7 +1368,7 @@ End;
                                             TmpRef^.offset := 0;
                                             TmpRef^.offset := 0;
                                             hp1 := new(Pai386,op_ref_reg(A_LEA,S_L,TmpRef, TRegister(Pai386(p)^.op2)));
                                             hp1 := new(Pai386,op_ref_reg(A_LEA,S_L,TmpRef, TRegister(Pai386(p)^.op2)));
                                             hp1^.line := p^.line;
                                             hp1^.line := p^.line;
-                                            InsertLLItem(p^.last, p^.next, hp1);
+                                            InsertLLItem(p^.previous, p^.next, hp1);
                                             Dispose(p, done);
                                             Dispose(p, done);
                                             p := hp1;
                                             p := hp1;
                                           End
                                           End
@@ -1460,7 +1460,7 @@ End;
                                  Continue
                                  Continue
                                End
                                End
                              Else
                              Else
-                               If {Assigned(p^.last) And}
+                               If {Assigned(p^.previous) And}
                                   GetLastInstruction(p, hp1) And
                                   GetLastInstruction(p, hp1) And
                                   (Pai(hp1)^.typ = ait_instruction) And
                                   (Pai(hp1)^.typ = ait_instruction) And
                                   (Pai386(hp1)^._operator = A_SUB) And
                                   (Pai386(hp1)^._operator = A_SUB) And
@@ -1469,7 +1469,7 @@ End;
                                   (TRegister(Pai386(hp1)^.Op2) = R_ESP)
                                   (TRegister(Pai386(hp1)^.Op2) = R_ESP)
                                  Then
                                  Then
                                    Begin
                                    Begin
-{                                   hp1 := Pai(p^.last);}
+{                                   hp1 := Pai(p^.previous);}
                                     Inc(Longint(Pai386(p)^.op1), Longint(Pai386(hp1)^.op1));
                                     Inc(Longint(Pai386(p)^.op1), Longint(Pai386(hp1)^.op1));
                                     AsmL^.Remove(hp1);
                                     AsmL^.Remove(hp1);
                                     Dispose(hp1, Done);
                                     Dispose(hp1, Done);
@@ -1485,7 +1485,7 @@ End;
                     as the first instruction already adjusts the ZF}
                     as the first instruction already adjusts the ZF}
                     Begin
                     Begin
                       If (Pai386(p)^.op1 = Pai386(p)^.op2) And
                       If (Pai386(p)^.op1 = Pai386(p)^.op2) And
-{                        (assigned(p^.last)) And}
+{                        (assigned(p^.previous)) And}
                          GetLastInstruction(p, hp1) And
                          GetLastInstruction(p, hp1) And
                          (pai(hp1)^.typ = ait_instruction) Then
                          (pai(hp1)^.typ = ait_instruction) Then
                          Case Pai386(hp1)^._operator Of
                          Case Pai386(hp1)^._operator Of
@@ -1615,7 +1615,15 @@ end;
 End.
 End.
 {
 {
   $Log$
   $Log$
-  Revision 1.7  1998-04-23 21:52:08  florian
+  Revision 1.8  1998-04-29 10:33:43  pierre
+    + added some code for ansistring (not complete nor working yet)
+    * corrected operator overloading
+    * corrected nasm output
+    + started inline procedures
+    + added starstarn : use ** for exponentiation (^ gave problems)
+    + started UseTokenInfo cond to get accurate positions
+
+  Revision 1.7  1998/04/23 21:52:08  florian
     * fixes of Jonas applied
     * fixes of Jonas applied
 
 
   Revision 1.6  1998/04/21 11:30:14  peter
   Revision 1.6  1998/04/21 11:30:14  peter

+ 21 - 13
compiler/asmutils.pas

@@ -1236,10 +1236,10 @@ end;
            Begin
            Begin
              case pvarsym(sym)^.getsize of
              case pvarsym(sym)^.getsize of
               1: instr.operands[operandnum].size := S_B;
               1: instr.operands[operandnum].size := S_B;
-              2: instr.operands[operandnum].size := S_W;
-              4: instr.operands[operandnum].size := S_L;
-              8: instr.operands[operandnum].size := S_Q;
-              extended_size: instr.operands[operandnum].size := S_X;
+              2: instr.operands[operandnum].size := S_W{ could be S_IS};
+              4: instr.operands[operandnum].size := S_L{ could be S_IL or S_FS};
+              8: instr.operands[operandnum].size := S_IQ{ could be S_D or S_FL};
+              extended_size: instr.operands[operandnum].size := S_FX;
              else
              else
                { this is in the case where the instruction is LEA }
                { this is in the case where the instruction is LEA }
                { or something like that, in that case size is not }
                { or something like that, in that case size is not }
@@ -1277,8 +1277,8 @@ end;
               1: instr.operands[operandnum].size := S_B;
               1: instr.operands[operandnum].size := S_B;
               2: instr.operands[operandnum].size := S_W;
               2: instr.operands[operandnum].size := S_W;
               4: instr.operands[operandnum].size := S_L;
               4: instr.operands[operandnum].size := S_L;
-              8: instr.operands[operandnum].size := S_Q;
-              extended_size: instr.operands[operandnum].size := S_X;
+              8: instr.operands[operandnum].size := S_IQ;
+              extended_size: instr.operands[operandnum].size := S_FX;
              else}
              else}
                {* this is in the case where the instruction is LEA *}
                {* this is in the case where the instruction is LEA *}
                {* or something like that, in that case size is not *}
                {* or something like that, in that case size is not *}
@@ -1317,8 +1317,8 @@ end;
                  1: instr.operands[operandnum].size := S_B;
                  1: instr.operands[operandnum].size := S_B;
                  2: instr.operands[operandnum].size := S_W;
                  2: instr.operands[operandnum].size := S_W;
                  4: instr.operands[operandnum].size := S_L;
                  4: instr.operands[operandnum].size := S_L;
-                 8: instr.operands[operandnum].size := S_Q;
-                 extended_size: instr.operands[operandnum].size := S_X;
+                 8: instr.operands[operandnum].size := S_IQ;
+                 extended_size: instr.operands[operandnum].size := S_FX;
                else
                else
                { this is in the case where the instruction is LEA }
                { this is in the case where the instruction is LEA }
                { or something like that, in that case size is not }
                { or something like that, in that case size is not }
@@ -1354,7 +1354,7 @@ end;
              1: instr.operands[operandnum].size := S_B;
              1: instr.operands[operandnum].size := S_B;
              2: instr.operands[operandnum].size := S_W;
              2: instr.operands[operandnum].size := S_W;
              4: instr.operands[operandnum].size := S_L;
              4: instr.operands[operandnum].size := S_L;
-             8: instr.operands[operandnum].size := S_Q;
+             8: instr.operands[operandnum].size := S_IQ;
            else
            else
            { this is in the case where the instruction is LEA }
            { this is in the case where the instruction is LEA }
            { or something like that, in that case size is not }
            { or something like that, in that case size is not }
@@ -1371,7 +1371,7 @@ end;
               1: instr.operands[operandnum].size := S_B;
               1: instr.operands[operandnum].size := S_B;
               2: instr.operands[operandnum].size := S_W;
               2: instr.operands[operandnum].size := S_W;
               4: instr.operands[operandnum].size := S_L;
               4: instr.operands[operandnum].size := S_L;
-              8: instr.operands[operandnum].size := S_Q;
+              8: instr.operands[operandnum].size := S_IQ;
             else
             else
             { this is in the case where the instruction is LEA }
             { this is in the case where the instruction is LEA }
             { or something like that, in that case size is not }
             { or something like that, in that case size is not }
@@ -1459,7 +1459,7 @@ end;
    pc: PChar;
    pc: PChar;
   Begin
   Begin
      getmem(pc,length(s)+1);
      getmem(pc,length(s)+1);
-     p^.concat(new(pai_string,init_pchar(strpcopy(pc,s))));
+     p^.concat(new(pai_string,init_length_pchar(strpcopy(pc,s),length(s))));
   end;
   end;
 
 
   Procedure ConcatPasString(p : paasmoutput;s:string);
   Procedure ConcatPasString(p : paasmoutput;s:string);
@@ -1626,8 +1626,16 @@ end;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.1  1998-03-25 11:18:12  root
-  Initial revision
+  Revision 1.2  1998-04-29 10:33:43  pierre
+    + added some code for ansistring (not complete nor working yet)
+    * corrected operator overloading
+    * corrected nasm output
+    + started inline procedures
+    + added starstarn : use ** for exponentiation (^ gave problems)
+    + started UseTokenInfo cond to get accurate positions
+
+  Revision 1.1.1.1  1998/03/25 11:18:12  root
+  * Restored version
 
 
   Revision 1.15  1998/03/10 01:17:14  peter
   Revision 1.15  1998/03/10 01:17:14  peter
     * all files have the same header
     * all files have the same header

+ 24 - 7
compiler/assemble.pas

@@ -37,11 +37,17 @@ const
 
 
 {$ifdef i386}
 {$ifdef i386}
 { tof = (of_none,of_o,of_obj,of_masm,of_att,of_nasm,of_win32) }
 { tof = (of_none,of_o,of_obj,of_masm,of_att,of_nasm,of_win32) }
-  AsBin : array[tof] of string[8]=('','as','nasm','masm','as','nasm','asw');
+  AsBin : array[tof] of string[8]=('','as','nasm','tasm','as','nasm','asw');
+  { I hope that all I386 assembler recongnize this as
+    a comment begin (PM) }
+  As_comment : string[2] = '# ';
 {$endif}
 {$endif}
 {$ifdef m68k}
 {$ifdef m68k}
-{ tof = (of_none,of_o,of_gas,of_mot,of_mit) }
-  AsBin : array[tof] of string[8]=('','','','','');
+{ tof = (of_none,of_o,of_gas,of_mot,of_mit)  }
+  AsBin : array[tof] of string[8]=('','','as68k','','');
+  { I hope that all M68K assembler recongnize this as
+    a comment begin (PM) }
+  As_comment : string[2] = '| ';
 {$endif}
 {$endif}
 
 
 
 
@@ -218,12 +224,15 @@ begin
             end;
             end;
 {$endif}
 {$endif}
 {$ifdef m68k}
 {$ifdef m68k}
-     of_o,
    of_mot,
    of_mot,
-   of_mit,
-   of_gas : begin
+   of_mit : begin
             { !! Nothing yet !! }
             { !! Nothing yet !! }
             end;
             end;
+   of_o,of_gas : begin
+              if CallAssembler(FindAssembler(of_gas),'  --register-prefix-optional'+
+              ' -o '+objfile+' '+asmfile) then
+               RemoveAsm;
+            end;
 {$endif}
 {$endif}
   else
   else
    internalerror(30000);
    internalerror(30000);
@@ -464,7 +473,15 @@ end;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.4  1998-04-27 23:10:27  peter
+  Revision 1.5  1998-04-29 10:33:44  pierre
+    + added some code for ansistring (not complete nor working yet)
+    * corrected operator overloading
+    * corrected nasm output
+    + started inline procedures
+    + added starstarn : use ** for exponentiation (^ gave problems)
+    + started UseTokenInfo cond to get accurate positions
+
+  Revision 1.4  1998/04/27 23:10:27  peter
     + new scanner
     + new scanner
     * $makelib -> if smartlink
     * $makelib -> if smartlink
     * small filename fixes pmodule.setfilename
     * small filename fixes pmodule.setfilename

+ 14 - 5
compiler/cg68k.pas

@@ -594,6 +594,7 @@ implementation
 
 
       begin
       begin
          { an fix comma const. behaves as a memory reference }
          { an fix comma const. behaves as a memory reference }
+
          p^.location.loc:=LOC_MEM;
          p^.location.loc:=LOC_MEM;
          p^.location.reference.isintvalue:=true;
          p^.location.reference.isintvalue:=true;
          p^.location.reference.offset:=p^.valuef;
          p^.location.reference.offset:=p^.valuef;
@@ -717,7 +718,7 @@ implementation
                                        exprasmlist^.concat(new(pai68k,op_const_reg(A_BCHG,S_L,31,
                                        exprasmlist^.concat(new(pai68k,op_const_reg(A_BCHG,S_L,31,
                                           p^.location.fpureg)))
                                           p^.location.fpureg)))
                                    else
                                    else
-                                       exprasmlist^.concat(new(pai68k,op_reg(A_FNEG,S_X,
+                                       exprasmlist^.concat(new(pai68k,op_reg(A_FNEG,S_FX,
                                           p^.location.fpureg)));
                                           p^.location.fpureg)));
                                 end
                                 end
                               else
                               else
@@ -735,7 +736,7 @@ implementation
                               if (cs_fp_emulation) in aktswitches then
                               if (cs_fp_emulation) in aktswitches then
                                   exprasmlist^.concat(new(pai68k,op_const_reg(A_BCHG,S_L,31,p^.location.fpureg)))
                                   exprasmlist^.concat(new(pai68k,op_const_reg(A_BCHG,S_L,31,p^.location.fpureg)))
                               else
                               else
-                                 exprasmlist^.concat(new(pai68k,op_reg(A_FNEG,S_X,p^.location.fpureg)));
+                                 exprasmlist^.concat(new(pai68k,op_reg(A_FNEG,S_FX,p^.location.fpureg)));
                            end;
                            end;
          end;
          end;
 {         emitoverflowcheck;}
 {         emitoverflowcheck;}
@@ -1934,7 +1935,7 @@ implementation
 {           for u32bit a solution would be to push $0 and to load a
 {           for u32bit a solution would be to push $0 and to load a
 +          comp
 +          comp
 +           if porddef(p^.left^.resulttype)^.typ=u32bit then
 +           if porddef(p^.left^.resulttype)^.typ=u32bit then
-+             exprasmlist^.concat(new(pai386,op_ref(A_FILD,S_Q,r)))
++             exprasmlist^.concat(new(pai386,op_ref(A_FILD,S_IQ,r)))
 +           else}
 +           else}
           p^.location.loc := LOC_FPU;
           p^.location.loc := LOC_FPU;
           { get floating point register. }
           { get floating point register. }
@@ -4286,7 +4287,7 @@ implementation
                           emit_reg_reg(A_MOVE,S_L,p^.left^.location.fpureg,R_D0)
                           emit_reg_reg(A_MOVE,S_L,p^.left^.location.fpureg,R_D0)
                         else
                         else
                           exprasmlist^.concat(
                           exprasmlist^.concat(
-                             new(pai68k,op_reg_reg(A_FMOVE,S_S,p^.left^.location.fpureg,R_D0)));
+                             new(pai68k,op_reg_reg(A_FMOVE,S_FS,p^.left^.location.fpureg,R_D0)));
                       end;
                       end;
                     end;
                     end;
                   end
                   end
@@ -5098,7 +5099,15 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.3  1998-04-07 22:45:03  florian
+  Revision 1.4  1998-04-29 10:33:44  pierre
+    + added some code for ansistring (not complete nor working yet)
+    * corrected operator overloading
+    * corrected nasm output
+    + started inline procedures
+    + added starstarn : use ** for exponentiation (^ gave problems)
+    + started UseTokenInfo cond to get accurate positions
+
+  Revision 1.3  1998/04/07 22:45:03  florian
     * bug0092, bug0115 and bug0121 fixed
     * bug0092, bug0115 and bug0121 fixed
     + packed object/class/array
     + packed object/class/array
 
 

+ 13 - 5
compiler/cg68k2.pas

@@ -771,15 +771,15 @@ Implementation
                                       R_FP1)))
                                       R_FP1)))
                                   else
                                   else
                                     { FPm --> FPn must use extended precision }
                                     { FPm --> FPn must use extended precision }
-                                    emit_reg_reg(A_FMOVE,S_X,p^.right^.location.fpureg,R_FP1);
+                                    emit_reg_reg(A_FMOVE,S_FX,p^.right^.location.fpureg,R_FP1);
 
 
                                   { arithmetic expression performed in extended mode }
                                   { arithmetic expression performed in extended mode }
-                                  exprasmlist^.concat(new(pai68k,op_reg_reg(op,S_X,
+                                  exprasmlist^.concat(new(pai68k,op_reg_reg(op,S_FX,
                                       p^.left^.location.fpureg,R_FP1)));
                                       p^.left^.location.fpureg,R_FP1)));
 
 
                                   { cmpop does not change any floating point register!! }
                                   { cmpop does not change any floating point register!! }
                                   if not cmpop then
                                   if not cmpop then
-                                       emit_reg_reg(A_FMOVE,S_X,R_FP1,p^.left^.location.fpureg)
+                                       emit_reg_reg(A_FMOVE,S_FX,R_FP1,p^.left^.location.fpureg)
 {                                       exprasmlist^.concat(new(pai68k,op_reg_reg(A_FMOVE,
 {                                       exprasmlist^.concat(new(pai68k,op_reg_reg(A_FMOVE,
                                        getfloatsize(pfloatdef(p^.left^.resulttype)^.typ),
                                        getfloatsize(pfloatdef(p^.left^.resulttype)^.typ),
                                        R_FP1,p^.left^.location.fpureg)))}
                                        R_FP1,p^.left^.location.fpureg)))}
@@ -835,7 +835,7 @@ Implementation
                                emit_reg_reg(A_FMOVE,getfloatsize(pfloatdef(p^.left^.resulttype)^.typ),
                                emit_reg_reg(A_FMOVE,getfloatsize(pfloatdef(p^.left^.resulttype)^.typ),
                                  p^.right^.location.fpureg,R_FP1);
                                  p^.right^.location.fpureg,R_FP1);
 
 
-                               emit_reg_reg(op,S_X,R_FP1,p^.left^.location.fpureg);
+                               emit_reg_reg(op,S_FX,R_FP1,p^.left^.location.fpureg);
 
 
                                if cmpop then
                                if cmpop then
                                  processcc(p);
                                  processcc(p);
@@ -1921,7 +1921,15 @@ Implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.2  1998-03-28 23:09:54  florian
+  Revision 1.3  1998-04-29 10:33:45  pierre
+    + added some code for ansistring (not complete nor working yet)
+    * corrected operator overloading
+    * corrected nasm output
+    + started inline procedures
+    + added starstarn : use ** for exponentiation (^ gave problems)
+    + started UseTokenInfo cond to get accurate positions
+
+  Revision 1.2  1998/03/28 23:09:54  florian
     * secondin bugfix (m68k and i386)
     * secondin bugfix (m68k and i386)
     * overflow checking bugfix (m68k and i386) -- pretty useless in
     * overflow checking bugfix (m68k and i386) -- pretty useless in
       secondadd, since everything is done using 32-bit
       secondadd, since everything is done using 32-bit

+ 22 - 17
compiler/cga68k.pas

@@ -269,9 +269,9 @@ unit cga68k;
     function getfloatsize(t: tfloattype): topsize;
     function getfloatsize(t: tfloattype): topsize;
     begin
     begin
       case t of
       case t of
-      s32real: getfloatsize := S_S;
-      s64real: getfloatsize := S_Q;
-      s80real: getfloatsize := S_X;
+      s32real: getfloatsize := S_FS;
+      s64real: getfloatsize := S_FL;
+      s80real: getfloatsize := S_FX;
 {$ifdef extdebug}
 {$ifdef extdebug}
     else {else case }
     else {else case }
       begin
       begin
@@ -624,9 +624,6 @@ begin
 {$endif GDB}
 {$endif GDB}
     { Alignment required for Motorola }
     { Alignment required for Motorola }
     procinfo.aktentrycode^.insert(new(pai_align,init(2)));
     procinfo.aktentrycode^.insert(new(pai_align,init(2)));
-{$ifdef extdebug}
-    procinfo.aktentrycode^.insert(new(pai_direct,init(strpnew(target_info.newline))));
-{$endif extdebug}
 end;
 end;
 
 
 {Generate the exit code for a procedure.}
 {Generate the exit code for a procedure.}
@@ -1072,9 +1069,9 @@ end;
       begin
       begin
         { no emulation }
         { no emulation }
         case t of
         case t of
-            s32real : s := S_S;
-            s64real : s := S_Q;
-            s80real : s := S_X;
+            s32real : s := S_FS;
+            s64real : s := S_FL;
+            s80real : s := S_FX;
          else
          else
            begin
            begin
              Message(cg_f_unknown_float_type);
              Message(cg_f_unknown_float_type);
@@ -1106,19 +1103,19 @@ end;
          case t of
          case t of
             s32real : begin
             s32real : begin
                          op:=A_FSTP;
                          op:=A_FSTP;
-                         s:=S_S;
+                         s:=S_FS;
                       end;
                       end;
             s64real : begin
             s64real : begin
                          op:=A_FSTP;
                          op:=A_FSTP;
-                         s:=S_L;
+                         s:=S_FL;
                       end;
                       end;
             s80real : begin
             s80real : begin
                          op:=A_FSTP;
                          op:=A_FSTP;
-                         s:=S_Q;
+                         s:=S_FX;
                       end;
                       end;
             s64bit : begin
             s64bit : begin
                          op:=A_FISTP;
                          op:=A_FISTP;
-                         s:=S_Q;
+                         s:=S_IQ;
                       end;
                       end;
             else internalerror(17);
             else internalerror(17);
          end;
          end;
@@ -1139,9 +1136,9 @@ end;
          InternalError(34);
          InternalError(34);
         { no emulation }
         { no emulation }
         case t of
         case t of
-            s32real : s := S_S;
-            s64real : s := S_Q;
-            s80real : s := S_X;
+            s32real : s := S_FS;
+            s64real : s := S_FL;
+            s80real : s := S_FX;
          else
          else
            begin
            begin
              Message(cg_f_unknown_float_type);
              Message(cg_f_unknown_float_type);
@@ -1257,7 +1254,15 @@ end;
   end.
   end.
 {
 {
   $Log$
   $Log$
-  Revision 1.2  1998-03-28 23:09:54  florian
+  Revision 1.3  1998-04-29 10:33:46  pierre
+    + added some code for ansistring (not complete nor working yet)
+    * corrected operator overloading
+    * corrected nasm output
+    + started inline procedures
+    + added starstarn : use ** for exponentiation (^ gave problems)
+    + started UseTokenInfo cond to get accurate positions
+
+  Revision 1.2  1998/03/28 23:09:54  florian
     * secondin bugfix (m68k and i386)
     * secondin bugfix (m68k and i386)
     * overflow checking bugfix (m68k and i386) -- pretty useless in
     * overflow checking bugfix (m68k and i386) -- pretty useless in
       secondadd, since everything is done using 32-bit
       secondadd, since everything is done using 32-bit

+ 209 - 53
compiler/cgi386.pas

@@ -222,7 +222,12 @@ implementation
                     else
                     else
                       begin
                       begin
                          { first handle local and temporary variables }
                          { first handle local and temporary variables }
-                         if (symtabletype=parasymtable) or (symtabletype=localsymtable) then
+                         if (symtabletype=parasymtable) or
+{$ifdef TestInline}
+                            (symtabletype=inlinelocalsymtable) then
+                            (symtabletype=inlineparasymtable) then
+{$endif TestInline}
+                            (symtabletype=localsymtable) then
                            begin
                            begin
                               p^.location.reference.base:=procinfo.framepointer;
                               p^.location.reference.base:=procinfo.framepointer;
                               p^.location.reference.offset:=pvarsym(p^.symtableentry)^.address;
                               p^.location.reference.offset:=pvarsym(p^.symtableentry)^.address;
@@ -230,6 +235,14 @@ implementation
                                 p^.location.reference.offset:=-p^.location.reference.offset;
                                 p^.location.reference.offset:=-p^.location.reference.offset;
                               if (symtabletype=parasymtable) then
                               if (symtabletype=parasymtable) then
                                 inc(p^.location.reference.offset,p^.symtable^.call_offset);
                                 inc(p^.location.reference.offset,p^.symtable^.call_offset);
+{$ifdef TestInline}
+                              if (symtabletype=inlinelocalsymtable) then
+                                p^.location.reference.offset:=-p^.location.reference.offset
+                                  +p^.symtable^.call_offset;
+                              if (symtabletype=inlineparasymtable) then
+                                inc(p^.location.reference.offset,p^.symtable^.call_offset);
+                                { comment(v_fatal,'inline proc arg not replaced'); }
+{$endif TestInline}
                               if (lexlevel>(p^.symtable^.symtablelevel)) then
                               if (lexlevel>(p^.symtable^.symtablelevel)) then
                                 begin
                                 begin
                                    hregister:=getregister32;
                                    hregister:=getregister32;
@@ -637,7 +650,7 @@ implementation
                    hp1:=pai(hp1^.next);
                    hp1:=pai(hp1^.next);
                 end;
                 end;
               { :-(, we must generate a new entry }
               { :-(, we must generate a new entry }
-                 if p^.labnumber=-1 then
+              if p^.labnumber=-1 then
                 begin
                 begin
                    getlabel(lastlabel);
                    getlabel(lastlabel);
                    p^.labnumber:=lastlabel^.nb;
                    p^.labnumber:=lastlabel^.nb;
@@ -654,9 +667,11 @@ implementation
                         +'$real_const'+tostr(p^.labnumber))));
                         +'$real_const'+tostr(p^.labnumber))));
                       consts^.insert(new(pai_cut,init));
                       consts^.insert(new(pai_cut,init));
                     end
                     end
+                   else if current_module^.output_format in [of_nasm,of_obj] then
+                     consts^.insert(new(pai_symbol,init('$real_const'+tostr(p^.labnumber))))
                    else
                    else
-                    consts^.insert(new(pai_label,init(lastlabel)));
-               end;
+                     consts^.insert(new(pai_label,init(lastlabel)));
+                end;
            end;
            end;
          stringdispose(p^.location.reference.symbol);
          stringdispose(p^.location.reference.symbol);
          if smartlink then
          if smartlink then
@@ -664,8 +679,10 @@ implementation
             p^.location.reference.symbol:=stringdup('_$'+current_module^.unitname^
             p^.location.reference.symbol:=stringdup('_$'+current_module^.unitname^
                 +'$real_const'+tostr(p^.labnumber));
                 +'$real_const'+tostr(p^.labnumber));
           end
           end
+         else if current_module^.output_format in [of_nasm,of_obj] then
+           p^.location.reference.symbol:=stringdup('$real_const'+tostr(p^.labnumber))
          else
          else
-          p^.location.reference.symbol:=stringdup(lab2str(lastlabel));
+           p^.location.reference.symbol:=stringdup(lab2str(lastlabel));
       end;
       end;
 
 
     procedure secondfixconst(var p : ptree);
     procedure secondfixconst(var p : ptree);
@@ -721,8 +738,13 @@ implementation
                           (pai_string(hp1)^.len=length(p^.values^)+2) then
                           (pai_string(hp1)^.len=length(p^.values^)+2) then
                           begin
                           begin
                              same_string:=true;
                              same_string:=true;
+{$ifndef UseAnsiString}
                              for i:=1 to length(p^.values^) do
                              for i:=1 to length(p^.values^) do
                                if pai_string(hp1)^.str[i]<>p^.values^[i] then
                                if pai_string(hp1)^.str[i]<>p^.values^[i] then
+{$else}
+                             for i:=0 to p^.length do
+                               if pai_string(hp1)^.str[i]<>p^.values[i] then
+{$endif}
                                  begin
                                  begin
                                     same_string:=false;
                                     same_string:=false;
                                     break;
                                     break;
@@ -743,14 +765,22 @@ implementation
                 begin
                 begin
                    getlabel(lastlabel);
                    getlabel(lastlabel);
                    p^.labstrnumber:=lastlabel^.nb;
                    p^.labstrnumber:=lastlabel^.nb;
+{$ifndef UseAnsiString}
                    getmem(pc,length(p^.values^)+3);
                    getmem(pc,length(p^.values^)+3);
                    move(p^.values^,pc^,length(p^.values^)+1);
                    move(p^.values^,pc^,length(p^.values^)+1);
                    pc[length(p^.values^)+1]:=#0;
                    pc[length(p^.values^)+1]:=#0;
+{$else UseAnsiString}
+                   pc:=getpcharcopy(p);
+{$endif UseAnsiString}
+
                    { we still will have a problem if there is a #0 inside the pchar }
                    { we still will have a problem if there is a #0 inside the pchar }
-                   consts^.insert(new(pai_string,init_pchar(pc)));
+{$ifndef UseAnsiString}
+                   consts^.insert(new(pai_string,init_length_pchar(pc,length(p^.values^)+2)));
                    { to overcome this problem we set the length explicitly }
                    { to overcome this problem we set the length explicitly }
                    { with the ending null char }
                    { with the ending null char }
-                   pai_string(consts^.first)^.len:=length(p^.values^)+2;
+{$else UseAnsiString}
+                   consts^.insert(new(pai_string,init_length_pchar(pc,p^.length+1)));
+{$endif UseAnsiString}
                    if smartlink then
                    if smartlink then
                     begin
                     begin
                       consts^.insert(new(pai_symbol,init_global('_$'+current_module^.unitname^
                       consts^.insert(new(pai_symbol,init_global('_$'+current_module^.unitname^
@@ -758,13 +788,27 @@ implementation
                       consts^.insert(new(pai_cut,init));
                       consts^.insert(new(pai_cut,init));
                     end
                     end
                    else
                    else
-                    consts^.insert(new(pai_label,init(lastlabel)));
-               end;
+                    begin
+                       consts^.insert(new(pai_label,init(lastlabel)));
+                       if current_module^.output_format in [of_nasm,of_obj] then
+                         consts^.insert(new(pai_symbol,init('$string_const'+tostr(p^.labstrnumber))));
+                    end;
+{$ifdef UseAnsiString}
+                   consts^.insert(new(pai_const,init_32bit(-1)));
+                   consts^.insert(new(pai_const,init_32bit(p^.length)));
+                   consts^.insert(new(pai_const,init_32bit(p^.length)));
+{$ifdef debug}
+                   consts^.insert(new(pai_asm_comment,init('Header of ansistring')));
+{$endif debug}
+{$endif UseAnsiString}
+                end;
            end;
            end;
          stringdispose(p^.location.reference.symbol);
          stringdispose(p^.location.reference.symbol);
          if smartlink then
          if smartlink then
            p^.location.reference.symbol:=stringdup('_$'+current_module^.unitname^
            p^.location.reference.symbol:=stringdup('_$'+current_module^.unitname^
                      +'$string_const'+tostr(p^.labstrnumber))
                      +'$string_const'+tostr(p^.labstrnumber))
+         else if current_module^.output_format in [of_nasm,of_obj] then
+           p^.location.reference.symbol:=stringdup('$string_const'+tostr(p^.labstrnumber))
          else
          else
            p^.location.reference.symbol:=stringdup(lab2str(lastlabel));
            p^.location.reference.symbol:=stringdup(lab2str(lastlabel));
          p^.location.loc := LOC_MEM;
          p^.location.loc := LOC_MEM;
@@ -1141,6 +1185,9 @@ implementation
          secondpass(p^.left);
          secondpass(p^.left);
          set_location(p^.location,p^.left^.location);
          set_location(p^.location,p^.left^.location);
 
 
+         { in ansistrings S[1] is pchar(S)[0] !! }
+         if is_ansistring(p^.left^.resulttype) then
+           dec(p^.location.reference.offset);
          { offset can only differ from 0 if arraydef }
          { offset can only differ from 0 if arraydef }
          if p^.left^.resulttype^.deftype=arraydef then
          if p^.left^.resulttype^.deftype=arraydef then
            dec(p^.location.reference.offset,
            dec(p^.location.reference.offset,
@@ -1571,11 +1618,35 @@ implementation
          pushedregs : tpushed;
          pushedregs : tpushed;
 
 
       begin
       begin
-         stringdispose(p^.location.reference.symbol);
-         gettempofsizereference(p^.resulttype^.size,p^.location.reference);
-         del_reference(p^.left^.location.reference);
-         copystring(p^.location.reference,p^.left^.location.reference,pstringdef(p^.resulttype)^.len);
-         ungetiftemp(p^.left^.location.reference);
+{$ifdef UseAnsiString}
+         if is_ansistring(p^.resulttype) and not is_ansistring(p^.left^.resulttype) then
+           begin
+              { call shortstring to ansistring conversion }
+              { result is in register }
+              del_reference(p^.left^.location.reference);
+              copyshortstringtoansistring(p^.location,p^.left^.location.reference,pstringdef(p^.resulttype)^.len);
+              ungetiftemp(p^.left^.location.reference);
+           end
+         else if not is_ansistring(p^.resulttype) and is_ansistring(p^.left.resulttype) then
+           begin
+              { call ansistring to shortstring conversion }
+              { result is in mem }
+              stringdispose(p^.location.reference.symbol);
+              gettempofsizereference(p^.resulttype^.size,p^.location.reference);
+              if p^.left^.location.locin [LOC_MEM,LOC_REFERENCE] then
+                del_reference(p^.left^.location.reference);
+              copyansistringtoshortstring(p^.location.reference,p^.left^.location.reference,pstringdef(p^.resulttype)^.len);
+              ungetiftemp(p^.left^.location.reference);
+           end
+         else
+{$endif UseAnsiString}
+           begin
+              stringdispose(p^.location.reference.symbol);
+              gettempofsizereference(p^.resulttype^.size,p^.location.reference);
+              del_reference(p^.left^.location.reference);
+              copystring(p^.location.reference,p^.left^.location.reference,pstringdef(p^.resulttype)^.len);
+              ungetiftemp(p^.left^.location.reference);
+           end;
       end;
       end;
 
 
     procedure second_cstring_charpointer(p,hp : ptree;convtyp : tconverttype);
     procedure second_cstring_charpointer(p,hp : ptree;convtyp : tconverttype);
@@ -1721,9 +1792,9 @@ implementation
          { for u32bit a solution would be to push $0 and to load a
          { for u32bit a solution would be to push $0 and to load a
          comp }
          comp }
           if porddef(p^.left^.resulttype)^.typ=u32bit then
           if porddef(p^.left^.resulttype)^.typ=u32bit then
-            exprasmlist^.concat(new(pai386,op_ref(A_FILD,S_Q,r)))
+            exprasmlist^.concat(new(pai386,op_ref(A_FILD,S_IQ,r)))
           else
           else
-            exprasmlist^.concat(new(pai386,op_ref(A_FILD,S_L,r)));
+            exprasmlist^.concat(new(pai386,op_ref(A_FILD,S_IL,r)));
 
 
          { better than an add on all processors }
          { better than an add on all processors }
          if porddef(p^.left^.resulttype)^.typ=u32bit then
          if porddef(p^.left^.resulttype)^.typ=u32bit then
@@ -1744,13 +1815,13 @@ implementation
       begin
       begin
          { real must be on fpu stack }
          { real must be on fpu stack }
          if (p^.left^.location.loc<>LOC_FPU) then
          if (p^.left^.location.loc<>LOC_FPU) then
-           exprasmlist^.concat(new(pai386,op_ref(A_FLD,S_L,newreference(p^.left^.location.reference))));
+           exprasmlist^.concat(new(pai386,op_ref(A_FLD,S_FL,newreference(p^.left^.location.reference))));
          push_int($1f3f);
          push_int($1f3f);
          push_int(65536);
          push_int(65536);
          reset_reference(ref);
          reset_reference(ref);
          ref.base:=R_ESP;
          ref.base:=R_ESP;
 
 
-         exprasmlist^.concat(new(pai386,op_ref(A_FIMUL,S_L,newreference(ref))));
+         exprasmlist^.concat(new(pai386,op_ref(A_FIMUL,S_IL,newreference(ref))));
 
 
          ref.offset:=4;
          ref.offset:=4;
          exprasmlist^.concat(new(pai386,op_ref(A_FSTCW,S_L,newreference(ref))));
          exprasmlist^.concat(new(pai386,op_ref(A_FSTCW,S_L,newreference(ref))));
@@ -1759,7 +1830,7 @@ implementation
          exprasmlist^.concat(new(pai386,op_ref(A_FLDCW,S_L,newreference(ref))));
          exprasmlist^.concat(new(pai386,op_ref(A_FLDCW,S_L,newreference(ref))));
 
 
          ref.offset:=0;
          ref.offset:=0;
-         exprasmlist^.concat(new(pai386,op_ref(A_FISTP,S_L,newreference(ref))));
+         exprasmlist^.concat(new(pai386,op_ref(A_FISTP,S_IL,newreference(ref))));
 
 
          ref.offset:=4;
          ref.offset:=4;
          exprasmlist^.concat(new(pai386,op_ref(A_FLDCW,S_L,newreference(ref))));
          exprasmlist^.concat(new(pai386,op_ref(A_FLDCW,S_L,newreference(ref))));
@@ -1853,7 +1924,7 @@ implementation
 
 
          reset_reference(r);
          reset_reference(r);
          r.base:=R_ESP;
          r.base:=R_ESP;
-         exprasmlist^.concat(new(pai386,op_ref(A_FLD,S_L,newreference(r))));
+         exprasmlist^.concat(new(pai386,op_ref(A_FLD,S_FL,newreference(r))));
          exprasmlist^.concat(new(pai386,op_const_reg(A_ADD,S_L,8,R_ESP)));
          exprasmlist^.concat(new(pai386,op_const_reg(A_ADD,S_L,8,R_ESP)));
          if popedx then
          if popedx then
            exprasmlist^.concat(new(pai386,op_reg(A_POP,S_L,R_EDX)));
            exprasmlist^.concat(new(pai386,op_reg(A_POP,S_L,R_EDX)));
@@ -2134,6 +2205,7 @@ implementation
          opsize : topsize;
          opsize : topsize;
          otlabel,hlabel,oflabel : plabel;
          otlabel,hlabel,oflabel : plabel;
          hregister : tregister;
          hregister : tregister;
+         use_strconcat : boolean;
          loc : tloc;
          loc : tloc;
 
 
       begin
       begin
@@ -2142,7 +2214,8 @@ implementation
          getlabel(truelabel);
          getlabel(truelabel);
          getlabel(falselabel);
          getlabel(falselabel);
          { calculate left sides }
          { calculate left sides }
-         secondpass(p^.left);
+         if not(p^.concat_string) then
+           secondpass(p^.left);
 
 
          if codegenerror then
          if codegenerror then
            exit;
            exit;
@@ -2220,12 +2293,32 @@ implementation
 {$endif test_dest_loc}
 {$endif test_dest_loc}
          if p^.left^.resulttype^.deftype=stringdef then
          if p^.left^.resulttype^.deftype=stringdef then
            begin
            begin
-             { we do not need destination anymore }
-             del_reference(p^.left^.location.reference);
-             { only source if withresult is set }
-             del_reference(p^.right^.location.reference);
-             loadstring(p);
-             ungetiftemp(p^.right^.location.reference);
+{$ifdef UseAnsiString}
+              if is_ansistring(p^.left^.resulttype) then
+                begin
+
+                  { we do not need destination anymore }
+                  del_reference(p^.left^.location.reference);
+                  { only source if withresult is set }
+                  del_reference(p^.right^.location.reference);
+                  loadansistring(p);
+                end
+              else
+{$endif UseAnsiString}
+              if not (p^.concat_string) then
+                begin
+                  { we do not need destination anymore }
+                  del_reference(p^.left^.location.reference);
+                  { only source if withresult is set }
+                  del_reference(p^.right^.location.reference);
+                  loadstring(p);
+                  ungetiftemp(p^.right^.location.reference);
+                end
+              else
+                begin
+                  { its the only thing we have to do }
+                  del_reference(p^.right^.location.reference);
+                end
            end
            end
         else case p^.right^.location.loc of
         else case p^.right^.location.loc of
             LOC_REFERENCE,
             LOC_REFERENCE,
@@ -2663,7 +2756,7 @@ implementation
          { help reference pointer }
          { help reference pointer }
          r : preference;
          r : preference;
          pp,params : ptree;
          pp,params : ptree;
-
+         inlinecode : ptree;
          { instruction for alignement correction }
          { instruction for alignement correction }
          corr : pai386;
          corr : pai386;
          { we must pop this size also after !! }
          { we must pop this size also after !! }
@@ -2676,11 +2769,18 @@ implementation
       begin
       begin
          extended_new:=false;
          extended_new:=false;
          iolabel:=nil;
          iolabel:=nil;
+         inlinecode:=nil;
          loadesi:=true;
          loadesi:=true;
          no_virtual_call:=false;
          no_virtual_call:=false;
          unusedregisters:=unused;
          unusedregisters:=unused;
+
          if not assigned(p^.procdefinition) then
          if not assigned(p^.procdefinition) then
           exit;
           exit;
+         if (p^.procdefinition^.options and poinline)<>0 then
+           begin
+              inlinecode:=p^.right;
+              p^.right:=nil;
+           end;
          { only if no proc var }
          { only if no proc var }
          if not(assigned(p^.right)) then
          if not(assigned(p^.right)) then
            is_con_or_destructor:=((p^.procdefinition^.options and poconstructor)<>0)
            is_con_or_destructor:=((p^.procdefinition^.options and poconstructor)<>0)
@@ -3089,11 +3189,14 @@ implementation
                      end;
                      end;
                    exprasmlist^.concat(new(pai386,op_ref(A_CALL,S_NO,r)));
                    exprasmlist^.concat(new(pai386,op_ref(A_CALL,S_NO,r)));
                 end
                 end
-              else
+              else if (p^.procdefinition^.options and poinline)=0 then
                 emitcall(p^.procdefinition^.mangledname,
                 emitcall(p^.procdefinition^.mangledname,
                   (p^.symtableproc^.symtabletype=unitsymtable) or
                   (p^.symtableproc^.symtabletype=unitsymtable) or
                   ((p^.symtableproc^.symtabletype=objectsymtable) and
                   ((p^.symtableproc^.symtabletype=objectsymtable) and
-                  (pobjectdef(p^.symtableproc^.defowner)^.owner^.symtabletype=unitsymtable)));
+                  (pobjectdef(p^.symtableproc^.defowner)^.owner^.symtabletype=unitsymtable)))
+              else { inlined proc }
+                { inlined code is in p^.right }
+                secondpass(p^.right);
               if ((p^.procdefinition^.options and poclearstack)<>0) then
               if ((p^.procdefinition^.options and poclearstack)<>0) then
                 begin
                 begin
                    { consider the alignment with the rest (PM) }
                    { consider the alignment with the rest (PM) }
@@ -3866,6 +3969,11 @@ implementation
               begin
               begin
                  secondpass(p^.left);
                  secondpass(p^.left);
                  set_location(p^.location,p^.left^.location);
                  set_location(p^.location,p^.left^.location);
+                 { length in ansi strings is at offset -8 }
+{$ifdef UseAnsiString}
+                 if is_ansistring(p^.left^.resultype)) then
+                   dec(p^.location.reference.offset,8);
+{$endif UseAnsiString}
               end;
               end;
             in_pred_x,
             in_pred_x,
             in_succ_x:
             in_succ_x:
@@ -4242,9 +4350,17 @@ implementation
          href.symbol := Nil;
          href.symbol := Nil;
          clear_reference(href);
          clear_reference(href);
          getlabel(l);
          getlabel(l);
-         href.symbol:=stringdup(lab2str(l));
          stringdispose(p^.location.reference.symbol);
          stringdispose(p^.location.reference.symbol);
-         datasegment^.concat(new(pai_label,init(l)));
+         if not (current_module^.output_format in [of_nasm,of_obj]) then
+           begin
+              href.symbol:=stringdup(lab2str(l));
+              datasegment^.concat(new(pai_label,init(l)));
+           end
+         else
+           begin
+              href.symbol:=stringdup('$set_const'+tostr(l^.nb));
+              datasegment^.concat(new(pai_symbol,init('$set_const'+tostr(l^.nb))));
+           end;
            {if psetdef(p^.resulttype)=smallset then
            {if psetdef(p^.resulttype)=smallset then
            begin
            begin
               smallsetvalue:=(p^.constset^[3]*256)+p^.constset^[2];
               smallsetvalue:=(p^.constset^[3]*256)+p^.constset^[2];
@@ -4313,7 +4429,8 @@ implementation
 
 
        var
        var
            pushed,ranges : boolean;
            pushed,ranges : boolean;
-           hr : tregister;
+           hr,pleftreg : tregister;
+           opsize : topsize;
            setparts:array[1..8] of Tsetpart;
            setparts:array[1..8] of Tsetpart;
            i,numparts:byte;
            i,numparts:byte;
            href,href2:Treference;
            href,href2:Treference;
@@ -4498,13 +4615,22 @@ implementation
                             {If register is used, use only lower 8 bits}
                             {If register is used, use only lower 8 bits}
                             if p^.left^.location.loc in [LOC_REGISTER,LOC_CREGISTER] then
                             if p^.left^.location.loc in [LOC_REGISTER,LOC_CREGISTER] then
                              begin
                              begin
-                               if p^.left^.location.register in [R_AL..R_DH] then
-                                 exprasmlist^.concat(new(pai386,op_const_reg(
-                                   A_AND,S_B,255,p^.left^.location.register)))
+                               pleftreg:=p^.left^.location.register;
+                               if pleftreg in [R_AL..R_DH] then
+                                 begin
+                                    exprasmlist^.concat(new(pai386,op_const_reg(
+                                      A_AND,S_B,255,pleftreg)));
+                                    opsize:=S_B;
+                                 end
                                else
                                else
-
-                                 exprasmlist^.concat(new(pai386,op_const_reg(
-                                   A_AND,S_L,255,p^.left^.location.register)));
+                                 begin
+                                    exprasmlist^.concat(new(pai386,op_const_reg(
+                                      A_AND,S_L,255,pleftreg)));
+                                    if pleftreg in [R_EAX..R_EDI] then
+                                      opsize:=S_L
+                                    else
+                                      opsize:=S_W;
+                                 end;
                              end;
                              end;
                             {Get a label to jump to the end.}
                             {Get a label to jump to the end.}
                             p^.location.loc:=LOC_FLAGS;
                             p^.location.loc:=LOC_FLAGS;
@@ -4532,8 +4658,8 @@ implementation
                                         case p^.left^.location.loc of
                                         case p^.left^.location.loc of
                                            LOC_REGISTER,
                                            LOC_REGISTER,
                                            LOC_CREGISTER :
                                            LOC_CREGISTER :
-                                             exprasmlist^.concat(new(pai386,op_const_reg(A_CMP,S_B,
-                                               setparts[i].start,p^.left^.location.register)));
+                                             exprasmlist^.concat(new(pai386,op_const_reg(A_CMP,opsize,
+                                               setparts[i].start,pleftreg)));
                                            else
                                            else
                                              exprasmlist^.concat(new(pai386,op_const_ref(A_CMP,S_B,
                                              exprasmlist^.concat(new(pai386,op_const_ref(A_CMP,S_B,
                                                setparts[i].start,newreference(p^.left^.location.reference))));
                                                setparts[i].start,newreference(p^.left^.location.reference))));
@@ -4546,8 +4672,8 @@ implementation
                                         case p^.left^.location.loc of
                                         case p^.left^.location.loc of
                                            LOC_REGISTER,
                                            LOC_REGISTER,
                                            LOC_CREGISTER:
                                            LOC_CREGISTER:
-                                             exprasmlist^.concat(new(pai386,op_const_reg(A_CMP,S_B,
-                                               setparts[i].stop,p^.left^.location.register)));
+                                             exprasmlist^.concat(new(pai386,op_const_reg(A_CMP,opsize,
+                                               setparts[i].stop,pleftreg)));
                                            else
                                            else
                                              exprasmlist^.concat(new(pai386,op_const_ref(A_CMP,S_B,
                                              exprasmlist^.concat(new(pai386,op_const_ref(A_CMP,S_B,
                                                setparts[i].stop,newreference(p^.left^.location.reference))));
                                                setparts[i].stop,newreference(p^.left^.location.reference))));
@@ -4567,8 +4693,8 @@ implementation
                                              case p^.left^.location.loc of
                                              case p^.left^.location.loc of
                                                LOC_REGISTER,
                                                LOC_REGISTER,
                                                LOC_CREGISTER :
                                                LOC_CREGISTER :
-                                                 exprasmlist^.concat(new(pai386,op_const_reg(A_CMP,S_B,
-                                                 setparts[i].start,p^.left^.location.register)));
+                                                 exprasmlist^.concat(new(pai386,op_const_reg(A_CMP,opsize,
+                                                 setparts[i].start,pleftreg)));
                                                else
                                                else
                                                  exprasmlist^.concat(new(pai386,op_const_ref(A_CMP,S_B,
                                                  exprasmlist^.concat(new(pai386,op_const_ref(A_CMP,S_B,
                                                setparts[i].start,newreference(p^.left^.location.reference))));
                                                setparts[i].start,newreference(p^.left^.location.reference))));
@@ -4583,8 +4709,8 @@ implementation
                                              case p^.left^.location.loc of
                                              case p^.left^.location.loc of
                                                LOC_REGISTER,
                                                LOC_REGISTER,
                                                LOC_CREGISTER :
                                                LOC_CREGISTER :
-                                                 exprasmlist^.concat(new(pai386,op_const_reg(A_CMP,S_B,
-                                                   setparts[i].stop+1,p^.left^.location.register)));
+                                                 exprasmlist^.concat(new(pai386,op_const_reg(A_CMP,opsize,
+                                                   setparts[i].stop+1,pleftreg)));
                                                else
                                                else
                                                  exprasmlist^.concat(new(pai386,op_const_ref(A_CMP,S_B,
                                                  exprasmlist^.concat(new(pai386,op_const_ref(A_CMP,S_B,
                                                    setparts[i].stop+1,newreference(p^.left^.location.reference))));
                                                    setparts[i].stop+1,newreference(p^.left^.location.reference))));
@@ -4602,8 +4728,8 @@ implementation
                                    case p^.left^.location.loc of
                                    case p^.left^.location.loc of
                                       LOC_REGISTER,
                                       LOC_REGISTER,
                                       LOC_CREGISTER:
                                       LOC_CREGISTER:
-                                        exprasmlist^.concat(new(pai386,op_const_reg(A_CMP,S_B,
-                                          setparts[i].stop,p^.left^.location.register)));
+                                        exprasmlist^.concat(new(pai386,op_const_reg(A_CMP,opsize,
+                                          setparts[i].stop,pleftreg)));
                                       else
                                       else
                                         exprasmlist^.concat(new(pai386,op_const_ref(A_CMP,S_B,
                                         exprasmlist^.concat(new(pai386,op_const_ref(A_CMP,S_B,
                                           setparts[i].stop,newreference(p^.left^.location.reference))));
                                           setparts[i].stop,newreference(p^.left^.location.reference))));
@@ -4623,7 +4749,7 @@ implementation
                             case p^.left^.location.loc of
                             case p^.left^.location.loc of
                                LOC_REGISTER,
                                LOC_REGISTER,
                                LOC_CREGISTER:
                                LOC_CREGISTER:
-                                 ungetregister32(p^.left^.location.register);
+                                 ungetregister32(pleftreg);
                                else
                                else
                                  del_reference(p^.left^.location.reference);
                                  del_reference(p^.left^.location.reference);
                             end;
                             end;
@@ -5569,6 +5695,28 @@ do_jmp:
             end;
             end;
        end;
        end;
 
 
+    { not used for now }
+
+    procedure secondprocinline(var p : ptree);
+
+       var st : psymtable;
+
+       begin
+          st:=p^.inlineprocdef^.parast;
+          st^.call_offset:=4;
+          st:=p^.inlineprocdef^.localst;
+          st^.call_offset:=gettempofsize(st^.datasize);
+          exprasmlist^.concat(new(pai_asm_comment,init('Start of inlined proc')));
+          exprasmlist^.concat(new(pai386,op_reg(A_PUSH,S_L,R_EBP)));
+          exprasmlist^.concat(new(pai386,op_reg_reg(A_MOV,S_L,R_ESP,R_EBP)));
+          secondpass(p^.left);
+          exprasmlist^.concat(new(pai386,op_reg(A_POP,S_L,R_EBP)));
+          exprasmlist^.concat(new(pai_asm_comment,init('End of inlined proc')));
+          {we can free the local stack now }
+          ungettemp(st^.call_offset,st^.datasize);
+       end;
+
+
      procedure secondpass(var p : ptree);
      procedure secondpass(var p : ptree);
 
 
        const
        const
@@ -5592,7 +5740,7 @@ do_jmp:
              secondexitn,secondwith,secondcase,secondlabel,
              secondexitn,secondwith,secondcase,secondlabel,
              secondgoto,secondsimplenewdispose,secondtryexcept,secondraise,
              secondgoto,secondsimplenewdispose,secondtryexcept,secondraise,
              secondnothing,secondtryfinally,secondis,secondas,seconderror,
              secondnothing,secondtryfinally,secondis,secondas,seconderror,
-             secondfail,
+             secondfail,secondadd,secondprocinline,
              secondnothing,secondloadvmt);
              secondnothing,secondloadvmt);
       var
       var
          oldcodegenerror : boolean;
          oldcodegenerror : boolean;
@@ -5740,7 +5888,7 @@ do_jmp:
                    if assigned(aktprocsym) then
                    if assigned(aktprocsym) then
                      begin
                      begin
                        if (aktprocsym^.definition^.options and
                        if (aktprocsym^.definition^.options and
-                        poconstructor+podestructor+poinline+pointerrupt=0) and
+                        poconstructor+podestructor{+poinline}+pointerrupt=0) and
                         ((procinfo.flags and pi_do_call)=0) and (lexlevel>1) then
                         ((procinfo.flags and pi_do_call)=0) and (lexlevel>1) then
                        begin
                        begin
                          { use ESP as frame pointer }
                          { use ESP as frame pointer }
@@ -5877,7 +6025,15 @@ do_jmp:
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.17  1998-04-27 23:10:27  peter
+  Revision 1.18  1998-04-29 10:33:48  pierre
+    + added some code for ansistring (not complete nor working yet)
+    * corrected operator overloading
+    * corrected nasm output
+    + started inline procedures
+    + added starstarn : use ** for exponentiation (^ gave problems)
+    + started UseTokenInfo cond to get accurate positions
+
+  Revision 1.17  1998/04/27 23:10:27  peter
     + new scanner
     + new scanner
     * $makelib -> if smartlink
     * $makelib -> if smartlink
     * small filename fixes pmodule.setfilename
     * small filename fixes pmodule.setfilename

+ 45 - 6
compiler/cgi386ad.inc

@@ -213,13 +213,46 @@
             { because of jump being produced at comparison below: }
             { because of jump being produced at comparison below: }
             p^.swaped:=not(p^.swaped);
             p^.swaped:=not(p^.swaped);
          end;
          end;
+{$ifdef UseAnsiString}
+              if is_ansistring(p^.left^.resulttype) then
+                begin
+                  case p^.treetype of
+                  addn :
+                    begin
+                       { we do not need destination anymore }
+                       del_reference(p^.left^.location.reference);
+                       del_reference(p^.right^.location.reference);
+                       concatansistring(p);
+                    end;
+                  ltn,lten,gtn,gten,
+                  equaln,unequaln :
+                    begin
+                       pushusedregisters(pushedregs,$ff);
+                       secondpass(p^.left);
+                       del_reference(p^.left^.location.reference);
+                       emitpushreferenceaddr(p^.left^.location.reference);
+                       secondpass(p^.right);
+                       del_reference(p^.right^.location.reference);
+                       emitpushreferenceaddr(p^.right^.location.reference);
+                       emitcall('ANSISTRCMP',true);
+                       maybe_loadesi;
+                       popusedregisters(pushedregs);
+                    end;
+                  end;
+                end
+              else
+{$endif UseAnsiString}
        case p^.treetype of
        case p^.treetype of
           addn :
           addn :
             begin
             begin
                cmpop:=false;
                cmpop:=false;
                secondpass(p^.left);
                secondpass(p^.left);
-               if (p^.left^.treetype<>addn) then
+               { if str_concat is set in expr
+                 s:=s+ ... no need to create a temp string (PM) }
+
+               if (p^.left^.treetype<>addn) and not (p^.use_strconcat) then
                  begin
                  begin
+
                     { can only reference be }
                     { can only reference be }
                     { string in register would be funny    }
                     { string in register would be funny    }
                     { therefore produce a temporary string }
                     { therefore produce a temporary string }
@@ -275,7 +308,10 @@
                 end
                 end
                else }
                else }
                 begin
                 begin
-                  pushusedregisters(pushedregs,$ff);
+                  if p^.use_strconcat then
+                    pushusedregisters(pushedregs,pstringdef(p^.left^.resulttype)^.len)
+                  else
+                    pushusedregisters(pushedregs,$ff);
                   emitpushreferenceaddr(p^.left^.location.reference);
                   emitpushreferenceaddr(p^.left^.location.reference);
                   emitpushreferenceaddr(p^.right^.location.reference);
                   emitpushreferenceaddr(p^.right^.location.reference);
                   emitcall('STRCONCAT',true);
                   emitcall('STRCONCAT',true);
@@ -1234,10 +1270,13 @@
 
 
 {
 {
      $Log$
      $Log$
-     Revision 1.4  1998-04-21 15:22:45  pierre
-       * typing error in secondadd for mmx corrected
-       * USE_RHIDE sets usestderr to true
-         replacing gpc by fpc in RHIDE should be a lot easier
+     Revision 1.5  1998-04-29 10:33:49  pierre
+       + added some code for ansistring (not complete nor working yet)
+       * corrected operator overloading
+       * corrected nasm output
+       + started inline procedures
+       + added starstarn : use ** for exponentiation (^ gave problems)
+       + started UseTokenInfo cond to get accurate positions
 
 
      Revision 1.3  1998/04/08 11:34:22  peter
      Revision 1.3  1998/04/08 11:34:22  peter
        * nasm works (linux only tested)
        * nasm works (linux only tested)

+ 32 - 14
compiler/cobjects.pas

@@ -54,7 +54,7 @@ unit cobjects;
        plinkedlist_item = ^tlinkedlist_item;
        plinkedlist_item = ^tlinkedlist_item;
 
 
        tlinkedlist_item = object
        tlinkedlist_item = object
-          next,last : plinkedlist_item;
+          next,previous : plinkedlist_item;
           { does nothing }
           { does nothing }
           constructor init;
           constructor init;
           destructor done;virtual;
           destructor done;virtual;
@@ -223,6 +223,9 @@ unit cobjects;
     { if p=nil then freemem isn't called          }
     { if p=nil then freemem isn't called          }
     procedure stringdispose(var p : pstring);
     procedure stringdispose(var p : pstring);
 
 
+    { idem for ansistrings }
+    procedure ansistringdispose(var p : pchar;length : longint);
+
     { allocates mem for a copy of s, copies s to this mem and returns }
     { allocates mem for a copy of s, copies s to this mem and returns }
     { a pointer to this mem                                           }
     { a pointer to this mem                                           }
     function stringdup(const s : string) : pstring;
     function stringdup(const s : string) : pstring;
@@ -306,6 +309,13 @@ unit cobjects;
          p:=nil;
          p:=nil;
       end;
       end;
 
 
+    procedure ansistringdispose(var p : pchar;length : longint);
+      begin
+         if assigned(p) then
+           freemem(p,length+1);
+         p:=nil;
+      end;
+
     function stringdup(const s : string) : pstring;
     function stringdup(const s : string) : pstring;
 
 
       var
       var
@@ -489,7 +499,7 @@ end;
     constructor tlinkedlist_item.init;
     constructor tlinkedlist_item.init;
 
 
       begin
       begin
-         last:=nil;
+         previous:=nil;
          next:=nil;
          next:=nil;
       end;
       end;
 
 
@@ -558,7 +568,7 @@ end;
 
 
          { we have a double linked list }
          { we have a double linked list }
          if assigned(first) then
          if assigned(first) then
-           first^.last:=p^.last;
+           first^.previous:=p^.last;
 
 
          first:=p^.first;
          first:=p^.first;
 
 
@@ -573,14 +583,14 @@ end;
     procedure tlinkedlist.concat(p : plinkedlist_item);
     procedure tlinkedlist.concat(p : plinkedlist_item);
 
 
       begin
       begin
-         p^.last:=nil;
+         p^.previous:=nil;
          p^.next:=nil;
          p^.next:=nil;
          if not(assigned(first)) then
          if not(assigned(first)) then
            first:=p
            first:=p
            else
            else
              begin
              begin
                 last^.next:=p;
                 last^.next:=p;
-                p^.last:=last;
+                p^.previous:=last;
              end;
              end;
          last:=p;
          last:=p;
       end;
       end;
@@ -588,13 +598,13 @@ end;
     procedure tlinkedlist.insert(p : plinkedlist_item);
     procedure tlinkedlist.insert(p : plinkedlist_item);
 
 
       begin
       begin
-         p^.last:=nil;
+         p^.previous:=nil;
          p^.next:=nil;
          p^.next:=nil;
          if not(assigned(first)) then
          if not(assigned(first)) then
            last:=p
            last:=p
          else
          else
            begin
            begin
-              first^.last:=p;
+              first^.previous:=p;
               p^.next:=first;
               p^.next:=first;
               first:=p;
               first:=p;
            end;
            end;
@@ -615,21 +625,21 @@ end;
            begin
            begin
               first:=p^.next;
               first:=p^.next;
               if assigned(first) then
               if assigned(first) then
-                first^.last:=nil;
+                first^.previous:=nil;
            end
            end
          else if last=p then
          else if last=p then
            begin
            begin
-              last:=last^.last;
+              last:=last^.previous;
               if assigned(last) then
               if assigned(last) then
                 last^.next:=nil;
                 last^.next:=nil;
            end
            end
          else
          else
            begin
            begin
-              p^.last^.next:=p^.next;
-              p^.next^.last:=p^.last;
+              p^.previous^.next:=p^.next;
+              p^.next^.previous:=p^.previous;
            end;
            end;
          p^.next:=nil;
          p^.next:=nil;
-         p^.last:=nil;
+         p^.previous:=nil;
       end;
       end;
 
 
     procedure tlinkedlist.concatlist(p : plinkedlist);
     procedure tlinkedlist.concatlist(p : plinkedlist);
@@ -643,7 +653,7 @@ end;
            else
            else
              begin
              begin
                 last^.next:=p^.first;
                 last^.next:=p^.first;
-                p^.first^.last:=last;
+                p^.first^.previous:=last;
              end;
              end;
 
 
          last:=p^.last;
          last:=p^.last;
@@ -985,7 +995,15 @@ end;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.3  1998-04-27 23:10:28  peter
+  Revision 1.4  1998-04-29 10:33:50  pierre
+    + added some code for ansistring (not complete nor working yet)
+    * corrected operator overloading
+    * corrected nasm output
+    + started inline procedures
+    + added starstarn : use ** for exponentiation (^ gave problems)
+    + started UseTokenInfo cond to get accurate positions
+
+  Revision 1.3  1998/04/27 23:10:28  peter
     + new scanner
     + new scanner
     * $makelib -> if smartlink
     * $makelib -> if smartlink
     * small filename fixes pmodule.setfilename
     * small filename fixes pmodule.setfilename

+ 15 - 1
compiler/files.pas

@@ -73,6 +73,12 @@ unit files;
           procedure register_file(f : pextfile);
           procedure register_file(f : pextfile);
        end;
        end;
 
 
+       tfileposinfo = record
+         infile : pinputfile;
+         line : longint; { could be changed to abspos }
+       end;
+       pfileposinfo = ^tfileposinfo;
+
     type
     type
        tunitmap = array[0..maxunits-1] of pointer;
        tunitmap = array[0..maxunits-1] of pointer;
        punitmap = ^tunitmap;
        punitmap = ^tunitmap;
@@ -618,7 +624,15 @@ unit files;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.3  1998-04-27 23:10:28  peter
+  Revision 1.4  1998-04-29 10:33:52  pierre
+    + added some code for ansistring (not complete nor working yet)
+    * corrected operator overloading
+    * corrected nasm output
+    + started inline procedures
+    + added starstarn : use ** for exponentiation (^ gave problems)
+    + started UseTokenInfo cond to get accurate positions
+
+  Revision 1.3  1998/04/27 23:10:28  peter
     + new scanner
     + new scanner
     * $makelib -> if smartlink
     * $makelib -> if smartlink
     * small filename fixes pmodule.setfilename
     * small filename fixes pmodule.setfilename

+ 91 - 4
compiler/hcodegen.pas

@@ -138,12 +138,22 @@ unit hcodegen;
     { searches the lowest label }
     { searches the lowest label }
     function case_get_min(root : pcaserecord) : longint;
     function case_get_min(root : pcaserecord) : longint;
 
 
-    { concates the ASCII string to the const segment }
+    { concates the ASCII string to the data segment }
     procedure generate_ascii(hs : string);
     procedure generate_ascii(hs : string);
 
 
-    { inserts the ASCII string to the const segment }
+    { inserts the ASCII string to the data segment }
     procedure generate_ascii_insert(hs : string);
     procedure generate_ascii_insert(hs : string);
 
 
+    { concates the ASCII string from pchar to the data  segment }
+    { WARNING : if hs has no #0 and strlen(hs)=length           }
+    { the terminal zero is not written                          }
+    procedure generate_pascii(hs : pchar;length : longint);
+
+
+    { inserts the ASCII string from pchar to the data segment }
+    { see WARNING above                                       }
+    procedure generate_pascii_insert(hs : pchar;length : longint);
+
     procedure generate_interrupt_stackframe_entry;
     procedure generate_interrupt_stackframe_entry;
     procedure generate_interrupt_stackframe_exit;
     procedure generate_interrupt_stackframe_exit;
 
 
@@ -218,15 +228,84 @@ unit hcodegen;
 
 
     procedure generate_ascii_insert(hs : string);
     procedure generate_ascii_insert(hs : string);
 
 
+
       begin
       begin
          while length(hs)>32 do
          while length(hs)>32 do
            begin
            begin
               datasegment^.insert(new(pai_string,init(copy(hs,length(hs)-32+1,length(hs)))));
               datasegment^.insert(new(pai_string,init(copy(hs,length(hs)-32+1,length(hs)))));
+              { should be avoid very slow }
               delete(hs,length(hs)-32+1,length(hs));
               delete(hs,length(hs)-32+1,length(hs));
            end;
            end;
          datasegment^.insert(new(pai_string,init(hs)));
          datasegment^.insert(new(pai_string,init(hs)));
       end;
       end;
 
 
+    function strnew(p : pchar;length : longint) : pchar;
+
+      var
+         pc : pchar;
+      begin
+         getmem(pc,length);
+         move(p^,pc^,length);
+         strnew:=pc;
+      end;
+
+    { concates the ASCII string from pchar to the const segment }
+    procedure generate_pascii(hs : pchar;length : longint);
+      var
+         real_end,current_begin,current_end : pchar;
+         c :char;
+
+      begin
+         if assigned(hs) then
+           begin
+              current_begin:=hs;
+              real_end:=strend(hs);
+              c:=hs[0];
+              while length>32 do
+                begin
+                   { restore the char displaced }
+                   current_begin[0]:=c;
+                   current_end:=current_begin+32;
+                   { store the char for next loop }
+                   c:=current_end[0];
+                   current_end[0]:=#0;
+                   datasegment^.concat(new(pai_string,init_length_pchar(strnew(current_begin,32),32)));
+                   length:=length-32;
+                end;
+              datasegment^.concat(new(pai_string,init_length_pchar(strnew(current_begin,length),length)));
+           end;
+      end;
+
+
+    { inserts the ASCII string from pchar to the const segment }
+    procedure generate_pascii_insert(hs : pchar;length : longint);
+      var
+         real_end,current_begin,current_end : pchar;
+         c :char;
+
+      begin
+         if assigned(hs) then
+           begin
+              current_begin:=hs;
+              real_end:=strend(hs);
+              c:=hs[0];
+              length:=longint(real_end)-longint(hs);
+              while length>32 do
+                begin
+                   { restore the char displaced }
+                   current_begin[0]:=c;
+                   current_end:=current_begin+32;
+                   { store the char for next loop }
+                   c:=current_end[0];
+                   current_end[0]:=#0;
+                   datasegment^.insert(new(pai_string,init_length_pchar(strnew(current_begin,32),32)));
+                   length:=length-32;
+                end;
+              datasegment^.insert(new(pai_string,init_length_pchar(strnew(current_begin,length),length)));
+           end;
+      end;
+
+
     function case_count_labels(root : pcaserecord) : longint;
     function case_count_labels(root : pcaserecord) : longint;
 
 
       var
       var
@@ -276,8 +355,16 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.1  1998-03-25 11:18:13  root
-  Initial revision
+  Revision 1.2  1998-04-29 10:33:53  pierre
+    + added some code for ansistring (not complete nor working yet)
+    * corrected operator overloading
+    * corrected nasm output
+    + started inline procedures
+    + added starstarn : use ** for exponentiation (^ gave problems)
+    + started UseTokenInfo cond to get accurate positions
+
+  Revision 1.1.1.1  1998/03/25 11:18:13  root
+  * Restored version
 
 
   Revision 1.6  1998/03/10 16:27:38  pierre
   Revision 1.6  1998/03/10 16:27:38  pierre
     * better line info in stabs debug
     * better line info in stabs debug

+ 48 - 14
compiler/i386.pas

@@ -102,7 +102,32 @@ unit i386;
          R_ST,R_ST0,R_ST1,R_ST2,R_ST3,R_ST4,R_ST5,R_ST6,R_ST7,
          R_ST,R_ST0,R_ST1,R_ST2,R_ST3,R_ST4,R_ST5,R_ST6,R_ST7,
          R_MM0,R_MM1,R_MM2,R_MM3,R_MM4,R_MM5,R_MM6,R_MM7);
          R_MM0,R_MM1,R_MM2,R_MM3,R_MM4,R_MM5,R_MM6,R_MM7);
 
 
-       topsize = (S_NO,S_B,S_W,S_L,S_BW,S_BL,S_WL,S_Q,S_S,S_X,S_D);
+       { S_NO = No Size of operand }
+       { S_B  = Byte size operand  }
+       { S_W  = Word size operand  }
+       { S_L  = DWord size operand }
+       { USED FOR conversions in x86}
+       { S_BW = Byte to word       }
+       { S_BL = Byte to long       }
+       { S_WL = Word to long       }
+       { Floating point types      }
+       { S_FX  = Extended type      }
+       { S_FL  = double/64bit integer }
+       { S_FS  = single type (32 bit) }
+       { S_IQ  = integer on 64 bits   }
+       { S_IL  = integer on 32 bits   }
+       { S_IS  = integer on 16 bits   }
+       { S_D   = integer on  bits for MMX }
+       topsize = (S_NO,S_B,S_W,S_L,S_BW,S_BL,S_WL,
+                  S_IS,S_IL,S_IQ,S_FS,S_FL,S_FX,S_D);
+       { S_FS and S_FL added
+         S_X renamed to S_FX
+         S_IL added
+         S_S and S_Q renamed to S_IQ and S_IS
+         S_F? means a real load or store or read
+         added to distinguish between longint l suffix like 'movl'
+         and double l suffix 'fldl'
+         distinction needed for intel output !! }
 
 
        plocation = ^tlocation;
        plocation = ^tlocation;
 
 
@@ -959,8 +984,11 @@ unit i386;
         'psubusb','psubusw','psubw','punpckhbw','punpckhdq',
         'psubusb','psubusw','psubw','punpckhbw','punpckhdq',
         'punpckhwd','punpcklbw','punpckldq','punpcklwd','pxor');
         'punpckhwd','punpcklbw','punpckldq','punpcklwd','pxor');
 
 
+     {  topsize = (S_NO,S_B,S_W,S_L,S_BW,S_BL,S_WL,
+                  S_IS,S_IL,S_IQ,S_FS,S_FL,S_FX,S_D); }
      att_opsize2str : array[topsize] of string[2] =
      att_opsize2str : array[topsize] of string[2] =
-       ('','b','w','l','bw','bl','wl','q','s','t','d');
+       ('','b','w','l','bw','bl','wl',
+        's','l','q','s','l','t','d');
 
 
      att_reg2str : array[tregister] of string[6] =
      att_reg2str : array[tregister] of string[6] =
        ('','%eax','%ecx','%edx','%ebx','%esp','%ebp','%esi','%edi',
        ('','%eax','%ecx','%edx','%ebx','%esp','%ebp','%esi','%edi',
@@ -1079,17 +1107,11 @@ unit i386;
            lab2str:='ILLEGAL'
            lab2str:='ILLEGAL'
          else
          else
          begin
          begin
-           if not(current_module^.output_format in [of_obj,of_nasm]) then
-              lab2str:=target_info.labelprefix+tostr(l^.nb)
-           else
-              lab2str:='?L'+tostr(l^.nb);
+            lab2str:=target_info.labelprefix+tostr(l^.nb);
          end;
          end;
 {$else EXTDEBUG}
 {$else EXTDEBUG}
            internalerror(2000);
            internalerror(2000);
-           if not(current_module^.output_format in [of_obj,of_nasm]) then
-              lab2str:=target_info.labelprefix+tostr(l^.nb)
-           else
-              lab2str:='?L'+tostr(l^.nb);
+           lab2str:=target_info.labelprefix+tostr(l^.nb);
 {$endif EXTDEBUG}
 {$endif EXTDEBUG}
          { was missed: }
          { was missed: }
          inc(l^.refcount);
          inc(l^.refcount);
@@ -1460,15 +1482,19 @@ unit i386;
          inherited init;
          inherited init;
          typ:=ait_instruction;
          typ:=ait_instruction;
          _operator:=op;
          _operator:=op;
-         if ((op=A_CMP) or (op=A_AND) or (op=A_ADD) or (op=A_ADC)) and
+         if ((op=A_CMP) or (op=A_AND) or (op=A_ADD) or
+            (op=A_ADC) or (op=A_SUB) or (op=A_SBB)) and
             ((_size=S_B) or (_size=S_BW) or (_size=S_BL)) and
             ((_size=S_B) or (_size=S_BW) or (_size=S_BL)) and
             ((_op2<R_AL) or (_op2>R_DH)) and
             ((_op2<R_AL) or (_op2>R_DH)) and
             (_op1>127) then
             (_op1>127) then
            begin
            begin
 {$ifdef extdebug}
 {$ifdef extdebug}
-              comment(v_warning,'wrong size for A_CMP or A_AND due to implicit size extension !!');
+              comment(v_warning,'wrong size for instruction due to implicit size extension !!');
 {$endif extdebug}
 {$endif extdebug}
-              _size:=S_L;
+              if _size=S_BW then
+                _size:=S_W
+              else
+                _size:=S_L;
            end;
            end;
          opxt:=Top_const+Top_reg shl 4;
          opxt:=Top_const+Top_reg shl 4;
          size:=_size;
          size:=_size;
@@ -1754,7 +1780,15 @@ unit i386;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.4  1998-04-09 15:46:38  florian
+  Revision 1.5  1998-04-29 10:33:53  pierre
+    + added some code for ansistring (not complete nor working yet)
+    * corrected operator overloading
+    * corrected nasm output
+    + started inline procedures
+    + added starstarn : use ** for exponentiation (^ gave problems)
+    + started UseTokenInfo cond to get accurate positions
+
+  Revision 1.4  1998/04/09 15:46:38  florian
     + register allocation tracing stuff added
     + register allocation tracing stuff added
 
 
   Revision 1.3  1998/04/08 16:58:02  pierre
   Revision 1.3  1998/04/08 16:58:02  pierre

+ 27 - 9
compiler/m68k.pas

@@ -110,10 +110,14 @@ unit m68k;
        { S_BL = Byte to long       }
        { S_BL = Byte to long       }
        { S_WL = Word to long       }
        { S_WL = Word to long       }
        { Floating point types      }
        { Floating point types      }
-       { S_X  = Extended type      }
-       { S_Q  = double/64bit integer }
-       { S_S  = single type (32 bit) }
-       topsize = (S_NO,S_B,S_W,S_L,S_BW,S_BL,S_WL,S_Q,S_S,S_X);
+       { S_FS  = single type (32 bit) }
+       { S_FL  = double/64bit integer }
+       { S_FX  = Extended type      }
+       { S_IS  = integer on 16 bits   }
+       { S_IL  = integer on 32 bits   }
+       { S_IQ  = integer on 64 bits   }
+       topsize = (S_NO,S_B,S_W,S_L,S_BW,S_BL,S_WL,
+                  S_FS,S_FL,S_FX,S_IS,S_IL,S_IQ);
 
 
        plocation = ^tlocation;
        plocation = ^tlocation;
 
 
@@ -823,7 +827,11 @@ type
        '');
        '');
 
 
      mot_opsize2str : array[topsize] of string[2] =
      mot_opsize2str : array[topsize] of string[2] =
-      ('','.b','.w','.l','.b','.b','.w','.d','.s','.x');
+      ('','.b','.w','.l','.b','.b','.w',
+       '.s','.d','.x','.s','.l','.q');
+       { I don't know about S_IS, S_IL and S_IQ for m68k
+         so I guessed, I am not even sure it can happen !!
+         (PM) }
 
 
      mot_reg2str : array[R_NO..R_FPSR] of string[6] =
      mot_reg2str : array[R_NO..R_FPSR] of string[6] =
       ('', 'd0','d1','d2','d3','d4','d5','d6','d7',
       ('', 'd0','d1','d2','d3','d4','d5','d6','d7',
@@ -834,7 +842,8 @@ type
        'sfc','vbr','fpsr');
        'sfc','vbr','fpsr');
 
 
      gas_opsize2str : array[topsize] of string[2] =
      gas_opsize2str : array[topsize] of string[2] =
-      ('','.b','.w','.l','.b','.b','.w','.d','.s','.x');
+      ('','.b','.w','.l','.b','.b','.w',
+       '.s','.d','.x','.s','.l','.q');
 
 
      gas_reg2str : array[R_NO..R_FPSR] of string[6] =
      gas_reg2str : array[R_NO..R_FPSR] of string[6] =
       ('', 'd0','d1','d2','d3','d4','d5','d6','d7',
       ('', 'd0','d1','d2','d3','d4','d5','d6','d7',
@@ -845,7 +854,8 @@ type
        'sfc','vbr','fpsr');
        'sfc','vbr','fpsr');
 
 
      mit_opsize2str : array[topsize] of string[2] =
      mit_opsize2str : array[topsize] of string[2] =
-      ('','b','w','l','b','b','w','d','s','x');
+      ('','b','w','l','b','b','w',
+       's','d','x','s','l','q');
 
 
      mit_reg2str : array[R_NO..R_FPSR] of string[6] =
      mit_reg2str : array[R_NO..R_FPSR] of string[6] =
       ('', 'd0','d1','d2','d3','d4','d5','d6','d7',
       ('', 'd0','d1','d2','d3','d4','d5','d6','d7',
@@ -1632,8 +1642,16 @@ type
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.1  1998-03-25 11:18:13  root
-  Initial revision
+  Revision 1.2  1998-04-29 10:33:54  pierre
+    + added some code for ansistring (not complete nor working yet)
+    * corrected operator overloading
+    * corrected nasm output
+    + started inline procedures
+    + added starstarn : use ** for exponentiation (^ gave problems)
+    + started UseTokenInfo cond to get accurate positions
+
+  Revision 1.1.1.1  1998/03/25 11:18:13  root
+  * Restored version
 
 
   Revision 1.13  1998/03/10 01:17:20  peter
   Revision 1.13  1998/03/10 01:17:20  peter
     * all files have the same header
     * all files have the same header

+ 2 - 1
compiler/msgidx.inc

@@ -231,7 +231,8 @@ sym_e_id_is_no_label_id,
 sym_e_label_already_defined,
 sym_e_label_already_defined,
 sym_e_ill_type_decl_set,
 sym_e_ill_type_decl_set,
 sym_e_class_forward_not_resolved,
 sym_e_class_forward_not_resolved,
-sym_h_identifier_not_used,
+sym_n_para_identifier_not_used,
+sym_w_local_identifier_not_used,
 sym_e_set_element_are_not_comp,
 sym_e_set_element_are_not_comp,
 sym_e_set_expected,
 sym_e_set_expected,
 sym_w_function_result_not_set,
 sym_w_function_result_not_set,

+ 489 - 485
compiler/msgtxt.inc

@@ -1,4 +1,4 @@
-const msgtxt : array[1..13962] of char=(
+const msgtxt : array[1..14011] of char=(
   'I','_','$','1',' ','k','B',' ','f','r','e','e',#000,'L','_',
   'I','_','$','1',' ','k','B',' ','f','r','e','e',#000,'L','_',
   '$','1',' ','l','i','n','e','s',' ','$','2',' ','k','B',' ',
   '$','1',' ','l','i','n','e','s',' ','$','2',' ','k','B',' ',
   'f','r','e','e',#000,'I','_','$','1',' ','s','t','r','e','a',
   'f','r','e','e',#000,'I','_','$','1',' ','s','t','r','e','a',
@@ -440,493 +440,497 @@ const msgtxt : array[1..13962] of char=(
   'm','e','n','t','s',#000,'E','_','F','o','r','w','a','r','d',
   'm','e','n','t','s',#000,'E','_','F','o','r','w','a','r','d',
   ' ','c','l','a','s','s',' ','d','e','f','i','n','i','t','i',
   ' ','c','l','a','s','s',' ','d','e','f','i','n','i','t','i',
   'o','n',' ','n','o','t',' ','r','e','s','o','l','v','e','d',
   'o','n',' ','n','o','t',' ','r','e','s','o','l','v','e','d',
-  ' ','$','1',#000,'H','_','I','d','e','n','t','i','f','i','e',
-  'r',' ','n','o','t',' ','u','s','e','d',' ','$','1',',',' ',
-  'd','e','c','l','a','r','e','d',' ','i','n',' ','l','i','n',
-  'e',' ','$','2',#000,'E','_','S','e','t',' ','e','l','e','m',
-  'e','n','t','s',' ','a','r','e',' ','n','o','t',' ','c','o',
-  'm','p','a','t','i','b','l','e',#000,'E','_','S','e','t',' ',
-  't','y','p','e',' ','e','x','p','e','c','t','e','d',#000,'W',
-  '_','F','u','n','c','t','i','o','n',' ','r','e','s','u','l',
-  't',' ','d','o','e','s',' ','n','o','t',' ','s','e','e','m',
-  ' ','t','o',' ','b','e',' ','s','e','t',#000,'E','_','U','n',
-  'k','n','o','w','n',' ','f','i','e','l','d',' ','i','d','e',
-  'n','t','i','f','i','e','r',#000,'N','_','L','o','c','a','l',
-  ' ','v','a','r','i','a','b','l','e',' ','d','o','e','s',' ',
-  'n','o','t',' ','s','e','e','m',' ','t','o',' ','b','e',' ',
-  'i','n','i','t','i','a','l','i','z','e','d',':',' ','$','1',
-  #000,'E','_','i','d','e','n','t','i','f','i','e','r',' ','i',
-  'd','e','n','t','s',' ','n','o',' ','m','e','m','b','e','r',
-  #000,'E','_','B','R','E','A','K',' ','n','o','t',' ','a','l',
-  'l','o','w','e','d',#000,'E','_','C','O','N','T','I','N','U',
-  'E',' ','n','o','t',' ','a','l','l','o','w','e','d',#000,'E',
-  '_','E','x','p','r','e','s','s','i','o','n',' ','t','o','o',
-  ' ','c','o','m','p','l','i','c','a','t','e','d',' ','-',' ',
-  'F','P','U',' ','s','t','a','c','k',' ','o','v','e','r','f',
-  'l','o','w',#000,'E','_','I','l','l','e','g','a','l',' ','e',
-  'x','p','r','e','s','s','i','o','n',#000,'E','_','I','n','v',
-  'a','l','i','d',' ','i','n','t','e','g','e','r',#000,'E','_',
-  'I','l','l','e','g','a','l',' ','q','u','a','l','i','f','i',
-  'e','r',#000,'E','_','H','i','g','h',' ','r','a','n','g','e',
-  ' ','l','i','m','i','t',' ','<',' ','l','o','w',' ','r','a',
-  'n','g','e',' ','l','i','m','i','t',#000,'E','_','I','l','l',
-  'e','g','a','l',' ','c','o','u','n','t','e','r',' ','v','a',
-  'r','i','a','b','l','e',#000,'E','_','C','a','n',#039,'t',' ',
-  'd','e','t','e','r','m','i','n','e',' ','w','h','i','c','h',
-  ' ','o','v','e','r','l','o','a','d','e','d',' ','f','u','n',
-  'c','t','i','o','n',' ','t','o',' ','c','a','l','l',#000,'E',
-  '_','P','a','r','a','m','e','t','e','r',' ','l','i','s','t',
-  ' ','s','i','z','e',' ','e','x','c','e','e','d','s',' ','6',
-  '5','5','3','5',' ','b','y','t','e','s',#000,'E','_','I','l',
-  'l','e','g','a','l',' ','t','y','p','e',' ','c','o','n','v',
-  'e','r','s','i','o','n',#000,'E','_','F','i','l','e',' ','t',
-  'y','p','e','s',' ','m','u','s','t',' ','b','e',' ','v','a',
-  'r',' ','p','a','r','a','m','e','t','e','r','s',#000,'E','_',
-  'T','h','e',' ','u','s','e',' ','o','f',' ','a',' ','f','a',
-  'r',' ','p','o','i','n','t','e','r',' ','i','s','n',#039,'t',
-  ' ','a','l','l','o','w','e','d',' ','t','h','e','r','e',#000,
-  'E','_','i','l','l','e','g','a','l',' ','c','a','l','l',' ',
-  'b','y',' ','r','e','f','e','r','e','n','c','e',' ','p','a',
-  'r','a','m','e','t','e','r','s',#000,'E','_','E','X','P','O',
-  'R','T',' ','d','e','c','l','a','r','e','d',' ','f','u','n',
-  'c','t','i','o','n','s',' ','c','a','n',#039,'t',' ','b','e',
-  ' ','c','a','l','l','e','d',#000,'W','_','P','o','s','s','i',
-  'b','l','e',' ','i','l','l','e','g','a','l',' ','c','a','l',
-  'l',' ','o','f',' ','c','o','n','s','t','r','u','c','t','o',
-  'r',' ','o','r',' ','d','e','s','t','r','u','c','t','o','r',
-  ' ','(','d','o','e','s','n',#039,'t',' ','m','a','t','c','h',
-  ' ','t','o',' ','t','h','i','s',' ','c','o','n','t','e','x',
-  't',')',#000,'N','_','I','n','e','f','f','i','c','i','e','n',
-  't',' ','c','o','d','e',#000,'W','_','u','n','r','e','a','c',
-  'h','a','b','l','e',' ','c','o','d','e',#000,'E','_','p','r',
-  'o','c','e','d','u','r','e',' ','c','a','l','l',' ','w','i',
-  't','h',' ','s','t','a','c','k','f','r','a','m','e',' ','E',
-  'S','P','/','S','P',#000,'E','_','A','b','s','t','r','a','c',
-  't',' ','m','e','t','h','o','d','s',' ','c','a','n',#039,'t',
-  ' ','b','e',' ','c','a','l','l','e','d',' ','d','i','r','e',
-  'c','t','l','y',#000,'F','_','I','n','t','e','r','n','a','l',
-  ' ','E','r','r','o','r',' ','i','n',' ','g','e','t','f','l',
-  'o','a','t','r','e','g','(',')',',',' ','a','l','l','o','c',
-  'a','t','i','o','n',' ','f','a','i','l','u','r','e',#000,'F',
-  '_','U','n','k','n','o','w','n',' ','f','l','o','a','t',' ',
-  't','y','p','e',#000,'F','_','S','e','c','o','n','d','V','e',
-  'c','n','(',')',' ','b','a','s','e',' ','d','e','f','i','n',
-  'e','d',' ','t','w','i','c','e',#000,'F','_','E','x','t','e',
-  'n','d','e','d',' ','c','g','6','8','k',' ','n','o','t',' ',
-  's','u','p','p','o','r','t','e','d',#000,'F','_','3','2','-',
-  'b','i','t',' ','u','n','s','i','g','n','e','d',' ','n','o',
-  't',' ','s','u','p','p','o','r','t','e','d',' ','i','n',' ',
-  'M','C','6','8','0','0','0',' ','m','o','d','e',#000,'F','_',
-  'I','n','t','e','r','n','a','l',' ','E','r','r','o','r',' ',
-  'i','n',' ','s','e','c','o','n','d','i','n','l','i','n','e',
-  '(',')',#000,'D','_','R','e','g','i','s','t','e','r',' ','$',
-  '1',' ','w','e','i','g','h','t',' ','$','2',' ','$','3',#000,
-  'E','_','S','t','a','c','k',' ','l','i','m','i','t',' ','e',
-  'x','c','e','d','e','e','d',' ','i','n',' ','l','o','c','a',
-  'l',' ','r','o','u','t','i','n','e',#000,'D','_','S','t','a',
-  'c','k',' ','f','r','a','m','e',' ','i','s',' ','o','m','i',
-  't','e','d',#000,'F','_','D','i','v','i','d','e',' ','b','y',
-  ' ','z','e','r','o',' ','i','n',' ','a','s','m',' ','e','v',
-  'a','l','u','a','t','o','r',#000,'F','_','E','v','a','l','u',
-  'a','t','o','r',' ','s','t','a','c','k',' ','o','v','e','r',
-  'f','l','o','w',#000,'F','_','E','v','a','l','u','a','t','o',
-  'r',' ','s','t','a','c','k',' ','u','n','d','e','r','f','l',
-  'o','w',#000,'F','_','I','n','v','a','l','i','d',' ','n','u',
-  'm','e','r','i','c',' ','f','o','r','m','a','t',' ','i','n',
-  ' ','a','s','m',' ','e','v','a','l','u','a','t','o','r',#000,
-  'F','_','I','n','v','a','l','i','d',' ','O','p','e','r','a',
-  't','o','r',' ','i','n',' ','a','s','m',' ','e','v','a','l',
-  'u','a','t','o','r',#000,'F','_','U','n','k','n','o','w','n',
-  ' ','e','r','r','o','r',' ','i','n',' ','a','s','m',' ','e',
-  'v','a','l','u','a','t','o','r',#000,'W','_','I','n','v','a',
-  'l','i','d',' ','n','u','m','e','r','i','c',' ','v','a','l',
-  'u','e',#000,'E','_','e','s','c','a','p','e',' ','s','e','q',
-  'u','e','n','c','e',' ','i','g','n','o','r','e','d',':',' ',
-  '$','1',#000,'E','_','A','s','m',' ','s','y','n','t','a','x',
-  ' ','e','r','r','o','r',' ','-',' ','P','r','e','f','i','x',
-  ' ','n','o','t',' ','f','o','u','n','d',#000,'E','_','A','s',
+  ' ','$','1',#000,'H','_','P','a','r','a','m','e','t','e','r',
+  ' ','n','o','t',' ','u','s','e','d',' ','$','1',',',' ','d',
+  'e','c','l','a','r','e','d',' ','i','n',' ','l','i','n','e',
+  ' ','$','2',#000,'W','_','L','o','c','a','l',' ','v','a','r',
+  'i','a','b','l','e',' ','n','o','t',' ','u','s','e','d',' ',
+  '$','1',',',' ','d','e','c','l','a','r','e','d',' ','i','n',
+  ' ','l','i','n','e',' ','$','2',#000,'E','_','S','e','t',' ',
+  'e','l','e','m','e','n','t','s',' ','a','r','e',' ','n','o',
+  't',' ','c','o','m','p','a','t','i','b','l','e',#000,'E','_',
+  'S','e','t',' ','t','y','p','e',' ','e','x','p','e','c','t',
+  'e','d',#000,'W','_','F','u','n','c','t','i','o','n',' ','r',
+  'e','s','u','l','t',' ','d','o','e','s',' ','n','o','t',' ',
+  's','e','e','m',' ','t','o',' ','b','e',' ','s','e','t',#000,
+  'E','_','U','n','k','n','o','w','n',' ','f','i','e','l','d',
+  ' ','i','d','e','n','t','i','f','i','e','r',#000,'N','_','L',
+  'o','c','a','l',' ','v','a','r','i','a','b','l','e',' ','d',
+  'o','e','s',' ','n','o','t',' ','s','e','e','m',' ','t','o',
+  ' ','b','e',' ','i','n','i','t','i','a','l','i','z','e','d',
+  ':',' ','$','1',#000,'E','_','i','d','e','n','t','i','f','i',
+  'e','r',' ','i','d','e','n','t','s',' ','n','o',' ','m','e',
+  'm','b','e','r',#000,'E','_','B','R','E','A','K',' ','n','o',
+  't',' ','a','l','l','o','w','e','d',#000,'E','_','C','O','N',
+  'T','I','N','U','E',' ','n','o','t',' ','a','l','l','o','w',
+  'e','d',#000,'E','_','E','x','p','r','e','s','s','i','o','n',
+  ' ','t','o','o',' ','c','o','m','p','l','i','c','a','t','e',
+  'd',' ','-',' ','F','P','U',' ','s','t','a','c','k',' ','o',
+  'v','e','r','f','l','o','w',#000,'E','_','I','l','l','e','g',
+  'a','l',' ','e','x','p','r','e','s','s','i','o','n',#000,'E',
+  '_','I','n','v','a','l','i','d',' ','i','n','t','e','g','e',
+  'r',#000,'E','_','I','l','l','e','g','a','l',' ','q','u','a',
+  'l','i','f','i','e','r',#000,'E','_','H','i','g','h',' ','r',
+  'a','n','g','e',' ','l','i','m','i','t',' ','<',' ','l','o',
+  'w',' ','r','a','n','g','e',' ','l','i','m','i','t',#000,'E',
+  '_','I','l','l','e','g','a','l',' ','c','o','u','n','t','e',
+  'r',' ','v','a','r','i','a','b','l','e',#000,'E','_','C','a',
+  'n',#039,'t',' ','d','e','t','e','r','m','i','n','e',' ','w',
+  'h','i','c','h',' ','o','v','e','r','l','o','a','d','e','d',
+  ' ','f','u','n','c','t','i','o','n',' ','t','o',' ','c','a',
+  'l','l',#000,'E','_','P','a','r','a','m','e','t','e','r',' ',
+  'l','i','s','t',' ','s','i','z','e',' ','e','x','c','e','e',
+  'd','s',' ','6','5','5','3','5',' ','b','y','t','e','s',#000,
+  'E','_','I','l','l','e','g','a','l',' ','t','y','p','e',' ',
+  'c','o','n','v','e','r','s','i','o','n',#000,'E','_','F','i',
+  'l','e',' ','t','y','p','e','s',' ','m','u','s','t',' ','b',
+  'e',' ','v','a','r',' ','p','a','r','a','m','e','t','e','r',
+  's',#000,'E','_','T','h','e',' ','u','s','e',' ','o','f',' ',
+  'a',' ','f','a','r',' ','p','o','i','n','t','e','r',' ','i',
+  's','n',#039,'t',' ','a','l','l','o','w','e','d',' ','t','h',
+  'e','r','e',#000,'E','_','i','l','l','e','g','a','l',' ','c',
+  'a','l','l',' ','b','y',' ','r','e','f','e','r','e','n','c',
+  'e',' ','p','a','r','a','m','e','t','e','r','s',#000,'E','_',
+  'E','X','P','O','R','T',' ','d','e','c','l','a','r','e','d',
+  ' ','f','u','n','c','t','i','o','n','s',' ','c','a','n',#039,
+  't',' ','b','e',' ','c','a','l','l','e','d',#000,'W','_','P',
+  'o','s','s','i','b','l','e',' ','i','l','l','e','g','a','l',
+  ' ','c','a','l','l',' ','o','f',' ','c','o','n','s','t','r',
+  'u','c','t','o','r',' ','o','r',' ','d','e','s','t','r','u',
+  'c','t','o','r',' ','(','d','o','e','s','n',#039,'t',' ','m',
+  'a','t','c','h',' ','t','o',' ','t','h','i','s',' ','c','o',
+  'n','t','e','x','t',')',#000,'N','_','I','n','e','f','f','i',
+  'c','i','e','n','t',' ','c','o','d','e',#000,'W','_','u','n',
+  'r','e','a','c','h','a','b','l','e',' ','c','o','d','e',#000,
+  'E','_','p','r','o','c','e','d','u','r','e',' ','c','a','l',
+  'l',' ','w','i','t','h',' ','s','t','a','c','k','f','r','a',
+  'm','e',' ','E','S','P','/','S','P',#000,'E','_','A','b','s',
+  't','r','a','c','t',' ','m','e','t','h','o','d','s',' ','c',
+  'a','n',#039,'t',' ','b','e',' ','c','a','l','l','e','d',' ',
+  'd','i','r','e','c','t','l','y',#000,'F','_','I','n','t','e',
+  'r','n','a','l',' ','E','r','r','o','r',' ','i','n',' ','g',
+  'e','t','f','l','o','a','t','r','e','g','(',')',',',' ','a',
+  'l','l','o','c','a','t','i','o','n',' ','f','a','i','l','u',
+  'r','e',#000,'F','_','U','n','k','n','o','w','n',' ','f','l',
+  'o','a','t',' ','t','y','p','e',#000,'F','_','S','e','c','o',
+  'n','d','V','e','c','n','(',')',' ','b','a','s','e',' ','d',
+  'e','f','i','n','e','d',' ','t','w','i','c','e',#000,'F','_',
+  'E','x','t','e','n','d','e','d',' ','c','g','6','8','k',' ',
+  'n','o','t',' ','s','u','p','p','o','r','t','e','d',#000,'F',
+  '_','3','2','-','b','i','t',' ','u','n','s','i','g','n','e',
+  'd',' ','n','o','t',' ','s','u','p','p','o','r','t','e','d',
+  ' ','i','n',' ','M','C','6','8','0','0','0',' ','m','o','d',
+  'e',#000,'F','_','I','n','t','e','r','n','a','l',' ','E','r',
+  'r','o','r',' ','i','n',' ','s','e','c','o','n','d','i','n',
+  'l','i','n','e','(',')',#000,'D','_','R','e','g','i','s','t',
+  'e','r',' ','$','1',' ','w','e','i','g','h','t',' ','$','2',
+  ' ','$','3',#000,'E','_','S','t','a','c','k',' ','l','i','m',
+  'i','t',' ','e','x','c','e','d','e','e','d',' ','i','n',' ',
+  'l','o','c','a','l',' ','r','o','u','t','i','n','e',#000,'D',
+  '_','S','t','a','c','k',' ','f','r','a','m','e',' ','i','s',
+  ' ','o','m','i','t','e','d',#000,'F','_','D','i','v','i','d',
+  'e',' ','b','y',' ','z','e','r','o',' ','i','n',' ','a','s',
+  'm',' ','e','v','a','l','u','a','t','o','r',#000,'F','_','E',
+  'v','a','l','u','a','t','o','r',' ','s','t','a','c','k',' ',
+  'o','v','e','r','f','l','o','w',#000,'F','_','E','v','a','l',
+  'u','a','t','o','r',' ','s','t','a','c','k',' ','u','n','d',
+  'e','r','f','l','o','w',#000,'F','_','I','n','v','a','l','i',
+  'd',' ','n','u','m','e','r','i','c',' ','f','o','r','m','a',
+  't',' ','i','n',' ','a','s','m',' ','e','v','a','l','u','a',
+  't','o','r',#000,'F','_','I','n','v','a','l','i','d',' ','O',
+  'p','e','r','a','t','o','r',' ','i','n',' ','a','s','m',' ',
+  'e','v','a','l','u','a','t','o','r',#000,'F','_','U','n','k',
+  'n','o','w','n',' ','e','r','r','o','r',' ','i','n',' ','a',
+  's','m',' ','e','v','a','l','u','a','t','o','r',#000,'W','_',
+  'I','n','v','a','l','i','d',' ','n','u','m','e','r','i','c',
+  ' ','v','a','l','u','e',#000,'E','_','e','s','c','a','p','e',
+  ' ','s','e','q','u','e','n','c','e',' ','i','g','n','o','r',
+  'e','d',':',' ','$','1',#000,'E','_','A','s','m',' ','s','y',
+  'n','t','a','x',' ','e','r','r','o','r',' ','-',' ','P','r',
+  'e','f','i','x',' ','n','o','t',' ','f','o','u','n','d',#000,
+  'E','_','A','s','m',' ','s','y','n','t','a','x',' ','e','r',
+  'r','o','r',' ','-',' ','T','r','y','i','n','g',' ','t','o',
+  ' ','a','d','d',' ','m','o','r','e',' ','t','h','a','n',' ',
+  'o','n','e',' ','p','r','e','f','i','x',#000,'E','_','A','s',
   'm',' ','s','y','n','t','a','x',' ','e','r','r','o','r',' ',
   'm',' ','s','y','n','t','a','x',' ','e','r','r','o','r',' ',
-  '-',' ','T','r','y','i','n','g',' ','t','o',' ','a','d','d',
-  ' ','m','o','r','e',' ','t','h','a','n',' ','o','n','e',' ',
-  'p','r','e','f','i','x',#000,'E','_','A','s','m',' ','s','y',
-  'n','t','a','x',' ','e','r','r','o','r',' ','-',' ','O','p',
-  'c','o','d','e',' ','n','o','t',' ','f','o','u','n','d',#000,
-  'E','_','I','n','v','a','l','i','d',' ','s','y','m','b','o',
-  'l',' ','r','e','f','e','r','e','n','c','e',#000,'W','_','C',
-  'a','l','l','i','n','g',' ','a','n',' ','o','v','e','r','l',
-  'o','a','d',' ','f','u','n','c','t','i','o','n',' ','i','n',
-  ' ','a','n',' ','a','s','m',#000,'E','_','C','o','n','s','t',
-  'a','n','t',' ','v','a','l','u','e',' ','o','u','t',' ','o',
-  'f',' ','b','o','u','n','d','s',#000,'E','_','N','o','n','-',
-  'l','a','b','e','l',' ','p','a','t','t','e','r','n',' ','c',
-  'o','n','t','a','i','n','s',' ','@',#000,'E','_','I','n','v',
-  'a','l','i','d',' ','O','p','e','r','a','n','d',':',' ','$',
-  '1',#000,'W','_','O','v','e','r','r','i','d','e',' ','o','p',
-  'e','r','a','t','o','r',' ','n','o','t',' ','s','u','p','p',
-  'o','r','t','e','d',#000,'E','_','E','r','r','o','r',' ','i',
-  'n',' ','b','i','n','a','r','y',' ','c','o','n','s','t','a',
-  'n','t',':',' ','$','1',#000,'E','_','E','r','r','o','r',' ',
-  'i','n',' ','o','c','t','a','l',' ','c','o','n','s','t','a',
-  'n','t',':',' ','$','1',#000,'E','_','E','r','r','o','r',' ',
-  'i','n',' ','h','e','x','a','d','e','c','i','m','a','l',' ',
-  'c','o','n','s','t','a','n','t',':',' ','$','1',#000,'E','_',
-  'E','r','r','o','r',' ','i','n',' ','i','n','t','e','g','e',
-  'r',' ','c','o','n','s','t','a','n','t',':',' ','$','1',#000,
-  'E','_','I','n','v','a','l','i','d',' ','l','a','b','e','l',
-  'e','d',' ','o','p','c','o','d','e',#000,'F','_','I','n','t',
-  'e','r','n','a','l',' ','e','r','r','o','r',' ','i','n',' ',
-  'F','i','n','d','t','y','p','e','(',')',#000,'E','_','I','n',
-  'v','a','l','i','d',' ','s','i','z','e',' ','f','o','r',' ',
-  'M','O','V','S','X','/','M','O','V','Z','X',#000,'E','_','1',
-  '6','-','b','i','t',' ','b','a','s','e',' ','i','n',' ','3',
-  '2','-','b','i','t',' ','s','e','g','m','e','n','t',#000,'E',
-  '_','1','6','-','b','i','t',' ','i','n','d','e','x',' ','i',
-  'n',' ','3','2','-','b','i','t',' ','s','e','g','m','e','n',
-  't',#000,'E','_','I','n','v','a','l','i','d',' ','O','p','c',
-  'o','d','e',#000,'E','_','C','o','n','s','t','a','n','t',' ',
-  'r','e','f','e','r','e','n','c','e',' ','n','o','t',' ','a',
-  'l','l','o','w','e','d',#000,'W','_','F','w','a','i','t',' ',
-  'c','a','n',' ','c','a','u','s','e',' ','e','m','u','l','a',
-  't','i','o','n',' ','p','r','o','b','l','e','m','s',' ','w',
-  'i','t','h',' ','e','m','u','3','8','7',#000,'E','_','I','n',
-  'v','a','l','i','d',' ','c','o','m','b','i','n','a','t','i',
-  'o','n',' ','o','f',' ','o','p','c','o','d','e',' ','a','n',
-  'd',' ','o','p','e','r','a','n','d','s',#000,'W','_','O','p',
-  'c','o','d','e',' ','$','1',' ','n','o','t',' ','i','n',' ',
-  't','a','b','l','e',',',' ','o','p','e','r','a','n','d','s',
-  ' ','n','o','t',' ','c','h','e','c','k','e','d',#000,'F','_',
-  'I','n','t','e','r','n','a','l',' ','E','r','r','o','r',' ',
-  'i','n',' ','C','o','n','c','a','t','O','p','c','o','d','e',
-  '(',')',#000,'E','_','I','n','v','a','l','i','d',' ','s','i',
-  'z','e',' ','i','n',' ','r','e','f','e','r','e','n','c','e',
-  #000,'E','_','I','n','v','a','l','i','d',' ','m','i','d','d',
-  'l','e',' ','s','i','z','e','d',' ','o','p','e','r','a','n',
-  'd',#000,'E','_','I','n','v','a','l','i','d',' ','t','h','r',
-  'e','e',' ','o','p','e','r','a','n','d',' ','o','p','c','o',
-  'd','e',#000,'E','_','A','s','s','e','m','b','l','e','r',' ',
-  's','y','n','t','a','x',' ','e','r','r','o','r',#000,'E','_',
-  'I','n','v','a','l','i','d',' ','o','p','e','r','a','n','d',
-  ' ','t','y','p','e',#000,'E','_','S','e','g','m','e','n','t',
-  ' ','o','v','e','r','r','i','d','e','s',' ','n','o','t',' ',
-  's','u','p','p','o','r','t','e','d',#000,'E','_','I','n','v',
-  'a','l','i','d',' ','c','o','n','s','t','a','n','t',' ','s',
-  'y','m','b','o','l',' ','$','1',#000,'F','_','I','n','t','e',
-  'r','n','a','l',' ','E','r','r','r','o','r',' ','c','o','n',
-  'v','e','r','t','i','n','g',' ','b','i','n','a','r','y',#000,
+  '-',' ','O','p','c','o','d','e',' ','n','o','t',' ','f','o',
+  'u','n','d',#000,'E','_','I','n','v','a','l','i','d',' ','s',
+  'y','m','b','o','l',' ','r','e','f','e','r','e','n','c','e',
+  #000,'W','_','C','a','l','l','i','n','g',' ','a','n',' ','o',
+  'v','e','r','l','o','a','d',' ','f','u','n','c','t','i','o',
+  'n',' ','i','n',' ','a','n',' ','a','s','m',#000,'E','_','C',
+  'o','n','s','t','a','n','t',' ','v','a','l','u','e',' ','o',
+  'u','t',' ','o','f',' ','b','o','u','n','d','s',#000,'E','_',
+  'N','o','n','-','l','a','b','e','l',' ','p','a','t','t','e',
+  'r','n',' ','c','o','n','t','a','i','n','s',' ','@',#000,'E',
+  '_','I','n','v','a','l','i','d',' ','O','p','e','r','a','n',
+  'd',':',' ','$','1',#000,'W','_','O','v','e','r','r','i','d',
+  'e',' ','o','p','e','r','a','t','o','r',' ','n','o','t',' ',
+  's','u','p','p','o','r','t','e','d',#000,'E','_','E','r','r',
+  'o','r',' ','i','n',' ','b','i','n','a','r','y',' ','c','o',
+  'n','s','t','a','n','t',':',' ','$','1',#000,'E','_','E','r',
+  'r','o','r',' ','i','n',' ','o','c','t','a','l',' ','c','o',
+  'n','s','t','a','n','t',':',' ','$','1',#000,'E','_','E','r',
+  'r','o','r',' ','i','n',' ','h','e','x','a','d','e','c','i',
+  'm','a','l',' ','c','o','n','s','t','a','n','t',':',' ','$',
+  '1',#000,'E','_','E','r','r','o','r',' ','i','n',' ','i','n',
+  't','e','g','e','r',' ','c','o','n','s','t','a','n','t',':',
+  ' ','$','1',#000,'E','_','I','n','v','a','l','i','d',' ','l',
+  'a','b','e','l','e','d',' ','o','p','c','o','d','e',#000,'F',
+  '_','I','n','t','e','r','n','a','l',' ','e','r','r','o','r',
+  ' ','i','n',' ','F','i','n','d','t','y','p','e','(',')',#000,
+  'E','_','I','n','v','a','l','i','d',' ','s','i','z','e',' ',
+  'f','o','r',' ','M','O','V','S','X','/','M','O','V','Z','X',
+  #000,'E','_','1','6','-','b','i','t',' ','b','a','s','e',' ',
+  'i','n',' ','3','2','-','b','i','t',' ','s','e','g','m','e',
+  'n','t',#000,'E','_','1','6','-','b','i','t',' ','i','n','d',
+  'e','x',' ','i','n',' ','3','2','-','b','i','t',' ','s','e',
+  'g','m','e','n','t',#000,'E','_','I','n','v','a','l','i','d',
+  ' ','O','p','c','o','d','e',#000,'E','_','C','o','n','s','t',
+  'a','n','t',' ','r','e','f','e','r','e','n','c','e',' ','n',
+  'o','t',' ','a','l','l','o','w','e','d',#000,'W','_','F','w',
+  'a','i','t',' ','c','a','n',' ','c','a','u','s','e',' ','e',
+  'm','u','l','a','t','i','o','n',' ','p','r','o','b','l','e',
+  'm','s',' ','w','i','t','h',' ','e','m','u','3','8','7',#000,
+  'E','_','I','n','v','a','l','i','d',' ','c','o','m','b','i',
+  'n','a','t','i','o','n',' ','o','f',' ','o','p','c','o','d',
+  'e',' ','a','n','d',' ','o','p','e','r','a','n','d','s',#000,
+  'W','_','O','p','c','o','d','e',' ','$','1',' ','n','o','t',
+  ' ','i','n',' ','t','a','b','l','e',',',' ','o','p','e','r',
+  'a','n','d','s',' ','n','o','t',' ','c','h','e','c','k','e',
+  'd',#000,'F','_','I','n','t','e','r','n','a','l',' ','E','r',
+  'r','o','r',' ','i','n',' ','C','o','n','c','a','t','O','p',
+  'c','o','d','e','(',')',#000,'E','_','I','n','v','a','l','i',
+  'd',' ','s','i','z','e',' ','i','n',' ','r','e','f','e','r',
+  'e','n','c','e',#000,'E','_','I','n','v','a','l','i','d',' ',
+  'm','i','d','d','l','e',' ','s','i','z','e','d',' ','o','p',
+  'e','r','a','n','d',#000,'E','_','I','n','v','a','l','i','d',
+  ' ','t','h','r','e','e',' ','o','p','e','r','a','n','d',' ',
+  'o','p','c','o','d','e',#000,'E','_','A','s','s','e','m','b',
+  'l','e','r',' ','s','y','n','t','a','x',' ','e','r','r','o',
+  'r',#000,'E','_','I','n','v','a','l','i','d',' ','o','p','e',
+  'r','a','n','d',' ','t','y','p','e',#000,'E','_','S','e','g',
+  'm','e','n','t',' ','o','v','e','r','r','i','d','e','s',' ',
+  'n','o','t',' ','s','u','p','p','o','r','t','e','d',#000,'E',
+  '_','I','n','v','a','l','i','d',' ','c','o','n','s','t','a',
+  'n','t',' ','s','y','m','b','o','l',' ','$','1',#000,'F','_',
+  'I','n','t','e','r','n','a','l',' ','E','r','r','r','o','r',
+  ' ','c','o','n','v','e','r','t','i','n','g',' ','b','i','n',
+  'a','r','y',#000,'F','_','I','n','t','e','r','n','a','l',' ',
+  'E','r','r','r','o','r',' ','c','o','n','v','e','r','t','i',
+  'n','g',' ','h','e','x','a','d','e','c','i','m','a','l',#000,
   'F','_','I','n','t','e','r','n','a','l',' ','E','r','r','r',
   'F','_','I','n','t','e','r','n','a','l',' ','E','r','r','r',
-  'o','r',' ','c','o','n','v','e','r','t','i','n','g',' ','h',
-  'e','x','a','d','e','c','i','m','a','l',#000,'F','_','I','n',
-  't','e','r','n','a','l',' ','E','r','r','r','o','r',' ','c',
-  'o','n','v','e','r','t','i','n','g',' ','o','c','t','a','l',
-  #000,'E','_','I','n','v','a','l','i','d',' ','c','o','n','s',
-  't','a','n','t',' ','e','x','p','r','e','s','s','i','o','n',
-  #000,'E','_','U','n','k','n','o','w','n',' ','i','d','e','n',
-  't','i','f','i','e','r',':',' ','$','1',#000,'E','_','T','r',
-  'y','i','n','g',' ','t','o',' ','d','e','f','i','n','e',' ',
-  'a','n',' ','i','n','d','e','x',' ','r','e','g','i','s','t',
-  'e','r',' ','m','o','r','e',' ','t','h','a','n',' ','o','n',
-  'c','e',#000,'E','_','I','n','v','a','l','i','d',' ','f','i',
-  'e','l','d',' ','s','p','e','c','i','f','i','e','r',#000,'F',
-  '_','I','n','t','e','r','n','a','l',' ','E','r','r','o','r',
-  ' ','i','n',' ','B','u','i','l','d','S','c','a','l','i','n',
-  'g','(',')',#000,'E','_','I','n','v','a','l','i','d',' ','s',
-  'c','a','l','i','n','g',' ','f','a','c','t','o','r',#000,'E',
-  '_','I','n','v','a','l','i','d',' ','s','c','a','l','i','n',
-  'g',' ','v','a','l','u','e',#000,'E','_','S','c','a','l','i',
-  'n','g',' ','v','a','l','u','e',' ','o','n','l','y',' ','a',
-  'l','l','o','w','e','d',' ','w','i','t','h',' ','i','n','d',
-  'e','x',#000,'E','_','I','n','v','a','l','i','d',' ','a','s',
-  's','e','m','b','l','e','r',' ','s','y','n','t','a','x','.',
-  ' ','N','o',' ','r','e','f',' ','w','i','t','h',' ','b','r',
-  'a','c','k','e','t','s',')',#000,'E','_','E','x','p','r','e',
-  's','s','i','o','n','s',' ','o','f',' ','t','h','e',' ','f',
-  'o','r','m',' ','[','s','r','e','g',':','r','e','g','.','.',
-  '.',']',' ','a','r','e',' ','c','u','r','r','e','n','t','l',
-  'y',' ','n','o','t',' ','s','u','p','p','o','r','t','e','d',
-  #000,'E','_','T','r','y','i','n','g',' ','t','o',' ','d','e',
-  'f','i','n','e',' ','a',' ','s','e','g','m','e','n','t',' ',
-  'r','e','g','i','s','t','e','r',' ','t','w','i','c','e',#000,
+  'o','r',' ','c','o','n','v','e','r','t','i','n','g',' ','o',
+  'c','t','a','l',#000,'E','_','I','n','v','a','l','i','d',' ',
+  'c','o','n','s','t','a','n','t',' ','e','x','p','r','e','s',
+  's','i','o','n',#000,'E','_','U','n','k','n','o','w','n',' ',
+  'i','d','e','n','t','i','f','i','e','r',':',' ','$','1',#000,
   'E','_','T','r','y','i','n','g',' ','t','o',' ','d','e','f',
   'E','_','T','r','y','i','n','g',' ','t','o',' ','d','e','f',
-  'i','n','e',' ','a',' ','b','a','s','e',' ','r','e','g','i',
-  's','t','e','r',' ','t','w','i','c','e',#000,'E','_','T','r',
-  'y','i','n','g',' ','t','o',' ','u','s','e',' ','a',' ','n',
-  'e','g','a','t','i','v','e',' ','i','n','d','e','x',' ','r',
-  'e','g','i','s','t','e','r',#000,'E','_','A','s','m',' ','s',
-  'y','n','t','a','x',' ','e','r','r','o','r',' ','-',' ','e',
-  'r','r','o','r',' ','i','n',' ','r','e','f','e','r','e','n',
-  'c','e',#000,'E','_','L','o','c','a','l',' ','s','y','m','b',
-  'o','l','s',' ','n','o','t',' ','a','l','l','o','w','e','d',
-  ' ','a','s',' ','r','e','f','e','r','e','n','c','e','s',#000,
-  'E','_','I','n','v','a','l','i','d',' ','o','p','e','r','a',
-  'n','d',' ','i','n',' ','b','r','a','c','k','e','t',' ','e',
-  'x','p','r','e','s','s','i','o','n',#000,'E','_','I','n','v',
-  'a','l','i','d',' ','s','y','m','b','o','l',' ','n','a','m',
-  'e',':',' ','$','1',#000,'E','_','I','n','v','a','l','i','d',
-  ' ','R','e','f','e','r','e','n','c','e',' ','s','y','n','t',
-  'a','x',#000,'E','_','I','n','v','a','l','i','d',' ','s','t',
-  'r','i','n','g',' ','a','s',' ','o','p','c','o','d','e',' ',
-  'o','p','e','r','a','n','d',':',' ','$','1',#000,'W','_','@',
-  'C','O','D','E',' ','a','n','d',' ','@','D','A','T','A',' ',
-  'n','o','t',' ','s','u','p','p','o','r','t','e','d',#000,'E',
-  '_','N','u','l','l',' ','l','a','b','e','l',' ','r','e','f',
-  'e','r','e','n','c','e','s',' ','a','r','e',' ','n','o','t',
-  ' ','a','l','l','o','w','e','d',#000,'E','_','C','a','n','n',
-  'o','t',' ','u','s','e',' ','S','E','L','F',' ','o','u','t',
-  's','i','d','e',' ','a',' ','m','e','t','h','o','d',#000,'E',
-  '_','A','s','m',' ','s','y','n','t','a','x',' ','e','r','r',
-  'o','r',' ','-',' ','S','h','o','u','l','d',' ','s','t','a',
-  'r','t',' ','w','i','t','h',' ','b','r','a','c','k','e','t',
-  #000,'E','_','A','s','m',' ','s','y','n','t','a','x',' ','e',
-  'r','r','o','r',' ','-',' ','r','e','g','i','s','t','e','r',
-  ':',' ','$','1',#000,'E','_','S','E','G',' ','a','n','d',' ',
-  'O','F','F','S','E','T',' ','n','o','t',' ','s','u','p','p',
-  'o','r','t','e','d',#000,'E','_','A','s','m',' ','s','y','n',
-  't','a','x',' ','e','r','r','o','r',' ','-',' ','i','n',' ',
-  'o','p','c','o','d','e',' ','o','p','e','r','a','n','d',#000,
-  'E','_','I','n','v','a','l','i','d',' ','S','t','r','i','n',
-  'g',' ','e','x','p','r','e','s','s','i','o','n',#000,'E','_',
-  'C','o','n','s','t','a','n','t',' ','e','x','p','r','e','s',
-  's','i','o','n',' ','o','u','t',' ','o','f',' ','b','o','u',
-  'n','d','s',#000,'F','_','I','n','t','e','r','n','a','l',' ',
-  'E','r','r','o','r',' ','i','n',' ','B','u','i','l','d','C',
-  'o','n','s','t','a','n','t','(',')',#000,'W','_','A',' ','r',
-  'e','p','e','a','t',' ','p','r','e','f','i','x',' ','a','n',
-  'd',' ','a',' ','s','e','g','m','e','n','t',' ','o','v','e',
-  'r','r','i','d','e',' ','o','n',' ','<','=',' ','i','3','8',
-  '6',' ','m','a','y',' ','r','e','s','u','l','t',' ','i','n',
-  ' ','e','r','r','o','r','s',' ','i','f',' ','a','n',' ','i',
-  'n','t','e','r','r','u','p','t',' ','o','c','c','u','r','s',
-  #000,'E','_','I','n','v','a','l','i','d',' ','o','r',' ','m',
-  'i','s','s','i','n','g',' ','o','p','c','o','d','e',#000,'E',
-  '_','I','n','v','a','l','i','d',' ','c','o','m','b','i','n',
-  'a','t','i','o','n',' ','o','f',' ','p','r','e','f','i','x',
-  ' ','a','n','d',' ','o','p','c','o','d','e',':',' ','$','1',
-  #000,'E','_','I','n','v','a','l','i','d',' ','c','o','m','b',
-  'i','n','a','t','i','o','n',' ','o','f',' ','o','v','e','r',
-  'r','i','d','e',' ','a','n','d',' ','o','p','c','o','d','e',
-  ':',' ','$','1',#000,'E','_','T','o','o',' ','m','a','n','y',
-  ' ','o','p','e','r','a','n','d','s',' ','o','n',' ','l','i',
-  'n','e',#000,'E','_','D','u','p','l','i','c','a','t','e',' ',
-  'l','o','c','a','l',' ','s','y','m','b','o','l',':',' ','$',
-  '1',#000,'E','_','U','n','k','n','o','w','n',' ','l','a','b',
-  'e','l',' ','i','d','e','n','t','i','f','e','r',':',' ','$',
-  '1',#000,'E','_','A','s','s','e','m','b','l','e',' ','n','o',
-  'd','e',' ','s','y','n','t','a','x',' ','e','r','r','o','r',
-  #000,'E','_','U','n','d','e','f','i','n','e','d',' ','l','o',
-  'c','a','l',' ','s','y','m','b','o','l',':',' ','$','1',#000,
-  'D','_','S','t','a','r','t','i','n','g',' ','i','n','t','e',
-  'l',' ','s','t','y','l','e','d',' ','a','s','s','e','m','b',
-  'l','e','r',' ','p','a','r','s','i','n','g','.','.','.',#000,
-  'D','_','F','i','n','i','s','h','e','d',' ','i','n','t','e',
-  'l',' ','s','t','y','l','e','d',' ','a','s','s','e','m','b',
-  'l','e','r',' ','p','a','r','s','i','n','g','.','.','.',#000,
-  'E','_','N','o','t',' ','a',' ','d','i','r','e','c','t','i',
-  'v','e',' ','o','r',' ','l','o','c','a','l',' ','s','y','m',
-  'b','o','l',':',' ','$','1',#000,'E','_','/',' ','a','t',' ',
-  'b','e','g','i','n','n','i','n','g',' ','o','f',' ','l','i',
-  'n','e',' ','n','o','t',' ','a','l','l','o','w','e','d',#000,
-  'E','_','N','O','R',' ','n','o','t',' ','s','u','p','p','o',
-  'r','t','e','d',#000,'E','_','I','n','v','a','l','i','d',' ',
-  'f','l','o','a','t','i','n','g',' ','p','o','i','n','t',' ',
-  'r','e','g','i','s','t','e','r',' ','n','a','m','e',#000,'W',
-  '_','M','o','d','u','l','o',' ','n','o','t',' ','s','u','p',
-  'p','o','r','t','e','d',#000,'E','_','I','n','v','a','l','i',
-  'd',' ','f','l','o','a','t','i','n','g',' ','p','o','i','n',
-  't',' ','c','o','n','s','t','a','n','t',':',' ','$','1',#000,
-  'E','_','S','i','z','e',' ','s','u','f','f','i','x',' ','a',
-  'n','d',' ','d','e','s','t','i','n','a','t','i','o','n',' ',
-  'r','e','g','i','s','t','e','r',' ','d','o',' ','n','o','t',
-  ' ','m','a','t','c','h',#000,'E','_','I','n','t','e','r','n',
-  'a','l',' ','e','r','r','o','r',' ','i','n',' ','C','o','n',
-  'c','a','t','L','a','b','e','l','e','d','I','n','s','t','r',
-  '(',')',#000,'W','_','F','l','o','a','t','i','n','g',' ','p',
-  'o','i','n','t',' ','b','i','n','a','r','y',' ','r','e','p',
-  'r','e','s','e','n','t','a','t','i','o','n',' ','i','g','n',
-  'o','r','e','d',#000,'W','_','F','l','o','a','t','i','n','g',
-  ' ','p','o','i','n','t',' ','h','e','x','a','d','e','c','i',
-  'm','a','l',' ','r','e','p','r','e','s','e','n','t','a','t',
-  'i','o','n',' ','i','g','n','o','r','e','d',#000,'W','_','F',
-  'l','o','a','t','i','n','g',' ','p','o','i','n','t',' ','o',
-  'c','t','a','l',' ','r','e','p','r','e','s','e','n','t','a',
-  't','i','o','n',' ','i','g','n','o','r','e','d',#000,'E','_',
-  'I','n','v','a','l','i','d',' ','r','e','a','l',' ','c','o',
-  'n','s','t','a','n','t',' ','e','x','p','r','e','s','s','i',
-  'o','n',#000,'E','_','P','a','r','e','n','t','h','e','s','i',
-  's',' ','a','r','e',' ','n','o','t',' ','a','l','l','o','w',
-  'e','d',#000,'E','_','I','n','v','a','l','i','d',' ','R','e',
-  'f','e','r','e','n','c','e',#000,'E','_','C','a','n','n','o',
-  't',' ','u','s','e',' ','_','_','S','E','L','F',' ','o','u',
-  't','s','i','d','e',' ','a',' ','m','e','t','h','o','d',#000,
-  'E','_','C','a','n','n','o','t',' ','u','s','e',' ','_','_',
-  'O','L','D','E','B','P',' ','o','u','t','s','i','d','e',' ',
-  'a',' ','n','e','s','t','e','d',' ','p','r','o','c','e','d',
-  'u','r','e',#000,'W','_','I','d','e','n','t','i','f','i','e',
-  'r',' ','$','1',' ','s','u','p','p','o','s','e','d',' ','e',
-  'x','t','e','r','n','a','l',#000,'E','_','I','n','v','a','l',
-  'i','d',' ','s','e','g','m','e','n','t',' ','o','v','e','r',
-  'r','i','d','e',' ','e','x','p','r','e','s','s','i','o','n',
-  #000,'E','_','S','t','r','i','n','g','s',' ','n','o','t',' ',
-  'a','l','l','o','w','e','d',' ','a','s',' ','c','o','n','s',
-  't','a','n','t','s',#000,'D','_','S','t','a','r','t','i','n',
-  'g',' ','A','T','&','T',' ','s','t','y','l','e','d',' ','a',
-  's','s','e','m','b','l','e','r',' ','p','a','r','s','i','n',
-  'g','.','.','.',#000,'D','_','F','i','n','i','s','h','e','d',
-  ' ','A','T','&','T',' ','s','t','y','l','e','d',' ','a','s',
+  'i','n','e',' ','a','n',' ','i','n','d','e','x',' ','r','e',
+  'g','i','s','t','e','r',' ','m','o','r','e',' ','t','h','a',
+  'n',' ','o','n','c','e',#000,'E','_','I','n','v','a','l','i',
+  'd',' ','f','i','e','l','d',' ','s','p','e','c','i','f','i',
+  'e','r',#000,'F','_','I','n','t','e','r','n','a','l',' ','E',
+  'r','r','o','r',' ','i','n',' ','B','u','i','l','d','S','c',
+  'a','l','i','n','g','(',')',#000,'E','_','I','n','v','a','l',
+  'i','d',' ','s','c','a','l','i','n','g',' ','f','a','c','t',
+  'o','r',#000,'E','_','I','n','v','a','l','i','d',' ','s','c',
+  'a','l','i','n','g',' ','v','a','l','u','e',#000,'E','_','S',
+  'c','a','l','i','n','g',' ','v','a','l','u','e',' ','o','n',
+  'l','y',' ','a','l','l','o','w','e','d',' ','w','i','t','h',
+  ' ','i','n','d','e','x',#000,'E','_','I','n','v','a','l','i',
+  'd',' ','a','s','s','e','m','b','l','e','r',' ','s','y','n',
+  't','a','x','.',' ','N','o',' ','r','e','f',' ','w','i','t',
+  'h',' ','b','r','a','c','k','e','t','s',')',#000,'E','_','E',
+  'x','p','r','e','s','s','i','o','n','s',' ','o','f',' ','t',
+  'h','e',' ','f','o','r','m',' ','[','s','r','e','g',':','r',
+  'e','g','.','.','.',']',' ','a','r','e',' ','c','u','r','r',
+  'e','n','t','l','y',' ','n','o','t',' ','s','u','p','p','o',
+  'r','t','e','d',#000,'E','_','T','r','y','i','n','g',' ','t',
+  'o',' ','d','e','f','i','n','e',' ','a',' ','s','e','g','m',
+  'e','n','t',' ','r','e','g','i','s','t','e','r',' ','t','w',
+  'i','c','e',#000,'E','_','T','r','y','i','n','g',' ','t','o',
+  ' ','d','e','f','i','n','e',' ','a',' ','b','a','s','e',' ',
+  'r','e','g','i','s','t','e','r',' ','t','w','i','c','e',#000,
+  'E','_','T','r','y','i','n','g',' ','t','o',' ','u','s','e',
+  ' ','a',' ','n','e','g','a','t','i','v','e',' ','i','n','d',
+  'e','x',' ','r','e','g','i','s','t','e','r',#000,'E','_','A',
+  's','m',' ','s','y','n','t','a','x',' ','e','r','r','o','r',
+  ' ','-',' ','e','r','r','o','r',' ','i','n',' ','r','e','f',
+  'e','r','e','n','c','e',#000,'E','_','L','o','c','a','l',' ',
+  's','y','m','b','o','l','s',' ','n','o','t',' ','a','l','l',
+  'o','w','e','d',' ','a','s',' ','r','e','f','e','r','e','n',
+  'c','e','s',#000,'E','_','I','n','v','a','l','i','d',' ','o',
+  'p','e','r','a','n','d',' ','i','n',' ','b','r','a','c','k',
+  'e','t',' ','e','x','p','r','e','s','s','i','o','n',#000,'E',
+  '_','I','n','v','a','l','i','d',' ','s','y','m','b','o','l',
+  ' ','n','a','m','e',':',' ','$','1',#000,'E','_','I','n','v',
+  'a','l','i','d',' ','R','e','f','e','r','e','n','c','e',' ',
+  's','y','n','t','a','x',#000,'E','_','I','n','v','a','l','i',
+  'd',' ','s','t','r','i','n','g',' ','a','s',' ','o','p','c',
+  'o','d','e',' ','o','p','e','r','a','n','d',':',' ','$','1',
+  #000,'W','_','@','C','O','D','E',' ','a','n','d',' ','@','D',
+  'A','T','A',' ','n','o','t',' ','s','u','p','p','o','r','t',
+  'e','d',#000,'E','_','N','u','l','l',' ','l','a','b','e','l',
+  ' ','r','e','f','e','r','e','n','c','e','s',' ','a','r','e',
+  ' ','n','o','t',' ','a','l','l','o','w','e','d',#000,'E','_',
+  'C','a','n','n','o','t',' ','u','s','e',' ','S','E','L','F',
+  ' ','o','u','t','s','i','d','e',' ','a',' ','m','e','t','h',
+  'o','d',#000,'E','_','A','s','m',' ','s','y','n','t','a','x',
+  ' ','e','r','r','o','r',' ','-',' ','S','h','o','u','l','d',
+  ' ','s','t','a','r','t',' ','w','i','t','h',' ','b','r','a',
+  'c','k','e','t',#000,'E','_','A','s','m',' ','s','y','n','t',
+  'a','x',' ','e','r','r','o','r',' ','-',' ','r','e','g','i',
+  's','t','e','r',':',' ','$','1',#000,'E','_','S','E','G',' ',
+  'a','n','d',' ','O','F','F','S','E','T',' ','n','o','t',' ',
+  's','u','p','p','o','r','t','e','d',#000,'E','_','A','s','m',
+  ' ','s','y','n','t','a','x',' ','e','r','r','o','r',' ','-',
+  ' ','i','n',' ','o','p','c','o','d','e',' ','o','p','e','r',
+  'a','n','d',#000,'E','_','I','n','v','a','l','i','d',' ','S',
+  't','r','i','n','g',' ','e','x','p','r','e','s','s','i','o',
+  'n',#000,'E','_','C','o','n','s','t','a','n','t',' ','e','x',
+  'p','r','e','s','s','i','o','n',' ','o','u','t',' ','o','f',
+  ' ','b','o','u','n','d','s',#000,'F','_','I','n','t','e','r',
+  'n','a','l',' ','E','r','r','o','r',' ','i','n',' ','B','u',
+  'i','l','d','C','o','n','s','t','a','n','t','(',')',#000,'W',
+  '_','A',' ','r','e','p','e','a','t',' ','p','r','e','f','i',
+  'x',' ','a','n','d',' ','a',' ','s','e','g','m','e','n','t',
+  ' ','o','v','e','r','r','i','d','e',' ','o','n',' ','<','=',
+  ' ','i','3','8','6',' ','m','a','y',' ','r','e','s','u','l',
+  't',' ','i','n',' ','e','r','r','o','r','s',' ','i','f',' ',
+  'a','n',' ','i','n','t','e','r','r','u','p','t',' ','o','c',
+  'c','u','r','s',#000,'E','_','I','n','v','a','l','i','d',' ',
+  'o','r',' ','m','i','s','s','i','n','g',' ','o','p','c','o',
+  'd','e',#000,'E','_','I','n','v','a','l','i','d',' ','c','o',
+  'm','b','i','n','a','t','i','o','n',' ','o','f',' ','p','r',
+  'e','f','i','x',' ','a','n','d',' ','o','p','c','o','d','e',
+  ':',' ','$','1',#000,'E','_','I','n','v','a','l','i','d',' ',
+  'c','o','m','b','i','n','a','t','i','o','n',' ','o','f',' ',
+  'o','v','e','r','r','i','d','e',' ','a','n','d',' ','o','p',
+  'c','o','d','e',':',' ','$','1',#000,'E','_','T','o','o',' ',
+  'm','a','n','y',' ','o','p','e','r','a','n','d','s',' ','o',
+  'n',' ','l','i','n','e',#000,'E','_','D','u','p','l','i','c',
+  'a','t','e',' ','l','o','c','a','l',' ','s','y','m','b','o',
+  'l',':',' ','$','1',#000,'E','_','U','n','k','n','o','w','n',
+  ' ','l','a','b','e','l',' ','i','d','e','n','t','i','f','e',
+  'r',':',' ','$','1',#000,'E','_','A','s','s','e','m','b','l',
+  'e',' ','n','o','d','e',' ','s','y','n','t','a','x',' ','e',
+  'r','r','o','r',#000,'E','_','U','n','d','e','f','i','n','e',
+  'd',' ','l','o','c','a','l',' ','s','y','m','b','o','l',':',
+  ' ','$','1',#000,'D','_','S','t','a','r','t','i','n','g',' ',
+  'i','n','t','e','l',' ','s','t','y','l','e','d',' ','a','s',
   's','e','m','b','l','e','r',' ','p','a','r','s','i','n','g',
   's','e','m','b','l','e','r',' ','p','a','r','s','i','n','g',
-  '.','.','.',#000,'E','_','S','w','i','t','c','h','i','n','g',
-  ' ','s','e','c','t','i','o','n','s',' ','i','s',' ','n','o',
-  't',' ','a','l','l','o','w','e','d',' ','i','n',' ','a','n',
-  ' ','a','s','s','e','m','b','l','e','r',' ','b','l','o','c',
-  'k',#000,'E','_','I','n','v','a','l','i','d',' ','g','l','o',
-  'b','a','l',' ','d','e','f','i','n','i','t','i','o','n',#000,
-  'E','_','L','i','n','e',' ','s','e','p','a','r','a','t','o',
-  'r',' ','e','x','p','e','c','t','e','d',#000,'W','_','g','l',
-  'o','b','l',' ','n','o','t',' ','s','u','p','p','o','r','t',
-  'e','d',#000,'W','_','a','l','i','g','n',' ','n','o','t',' ',
-  's','u','p','p','o','r','t','e','d',#000,'W','_','l','c','o',
-  'm','m',' ','n','o','t',' ','s','u','p','p','o','r','t','e',
-  'd',#000,'W','_','c','o','m','m',' ','n','o','t',' ','s','u',
-  'p','p','o','r','t','e','d',#000,'E','_','I','n','v','a','l',
-  'i','d',' ','l','o','c','a','l',' ','c','o','m','m','o','n',
-  ' ','d','e','f','i','n','i','t','i','o','n',#000,'E','_','I',
-  'n','v','a','l','i','d',' ','g','l','o','b','a','l',' ','c',
-  'o','m','m','o','n',' ','d','e','f','i','n','i','t','i','o',
-  'n',#000,'E','_','l','o','c','a','l',' ','s','y','m','b','o',
-  'l',':',' ','$','1',' ','n','o','t',' ','f','o','u','n','d',
-  ' ','i','n','s','i','d','e',' ','a','s','m',' ','s','t','a',
-  't','e','m','e','n','t',#000,'E','_','a','s','s','e','m','b',
-  'l','e','r',' ','c','o','d','e',' ','n','o','t',' ','r','e',
-  't','u','r','n','e','d',' ','t','o',' ','t','e','x','t',#000,
-  'F','_','i','n','t','e','r','n','a','l',' ','e','r','r','o',
-  'r',' ','i','n',' ','B','u','i','l','d','R','e','f','e','r',
-  'e','n','c','e','(',')',#000,'E','_','i','n','v','a','l','i',
-  'd',' ','o','p','c','o','d','e',' ','s','i','z','e',#000,'W',
-  '_','N','E','A','R',' ','i','g','n','o','r','e','d',#000,'W',
-  '_','F','A','R',' ','i','g','n','o','r','e','d',#000,'D','_',
-  'C','r','e','a','t','i','n','g',' ','i','n','l','i','n','e',
-  ' ','a','s','m',' ','l','o','o','k','u','p',' ','t','a','b',
-  'l','e','s',#000,'W','_','U','s','i','n','g',' ','a',' ','d',
-  'e','f','i','n','e','d',' ','n','a','m','e',' ','a','s',' ',
-  'a',' ','l','o','c','a','l',' ','l','a','b','e','l',#000,'F',
-  '_','i','n','t','e','r','n','a','l',' ','e','r','r','o','r',
-  ' ','i','n',' ','H','a','n','d','l','e','E','x','t','e','n',
-  'd','(',')',#000,'E','_','I','n','v','a','l','i','d',' ','c',
-  'h','a','r','a','c','t','e','r',':',' ','<',#000,'E','_','I',
-  'n','v','a','l','i','d',' ','c','h','a','r','a','c','t','e',
-  'r',':',' ','>',#000,'E','_','U','n','s','u','p','p','o','r',
-  't','e','d',' ','o','p','c','o','d','e',#000,'E','_','I','n',
-  'c','r','e','m','e','n','t',' ','a','n','d',' ','D','e','c',
-  'r','e','m','e','n','t',' ','m','o','d','e',' ','n','o','t',
-  ' ','a','l','l','o','w','e','d',' ','t','o','g','e','t','h',
-  'e','r',#000,'E','_','I','n','v','a','l','i','d',' ','R','e',
-  'g','i','s','t','e','r',' ','l','i','s','t',' ','i','n',' ',
-  'm','o','v','e','m','/','f','m','o','v','e','m',#000,'E','_',
-  'I','n','v','a','l','i','d',' ','R','e','g','i','s','t','e',
-  'r',' ','l','i','s','t',' ','f','o','r',' ','o','p','c','o',
-  'd','e',#000,'E','_','6','8','0','2','0','+',' ','m','o','d',
-  'e',' ','r','e','q','u','i','r','e','d',' ','t','o',' ','a',
-  's','s','e','m','b','l','e',#000,'D','_','S','t','a','r','t',
-  'i','n','g',' ','M','o','t','o','r','o','l','a',' ','s','t',
-  'y','l','e','d',' ','a','s','s','e','m','b','l','e','r',' ',
-  'p','a','r','s','i','n','g','.','.','.',#000,'D','_','F','i',
-  'n','i','s','h','e','d',' ','M','o','t','o','r','o','l','a',
-  ' ','s','t','y','l','e','d',' ','a','s','s','e','m','b','l',
-  'e','r',' ','p','a','r','s','i','n','g','.','.','.',#000,'W',
-  '_','X','D','E','F',' ','n','o','t',' ','s','u','p','p','o',
-  'r','t','e','d',#000,'W','_','F','u','n','c','t','i','o','n',
-  's',' ','w','i','t','h',' ','v','o','i','d',' ','r','e','t',
-  'u','r','n',' ','v','a','l','u','e',' ','c','a','n',#039,'t',
-  ' ','r','e','t','u','r','n',' ','a','n','y',' ','v','a','l',
-  'u','e',' ','i','n',' ','a','s','m',' ','c','o','d','e',#000,
-  'E','_','I','n','v','a','l','i','d',' ','s','u','f','f','i',
-  'x',' ','f','o','r',' ','i','n','t','e','l',' ','a','s','s',
-  'e','m','b','l','e','r',#000,'E','_','E','x','t','e','n','d',
-  'e','d',' ','n','o','t',' ','s','u','p','p','o','r','t','e',
-  'd',' ','i','n',' ','t','h','i','s',' ','m','o','d','e',#000,
-  'E','_','C','o','m','p',' ','n','o','t',' ','s','u','p','p',
+  '.','.','.',#000,'D','_','F','i','n','i','s','h','e','d',' ',
+  'i','n','t','e','l',' ','s','t','y','l','e','d',' ','a','s',
+  's','e','m','b','l','e','r',' ','p','a','r','s','i','n','g',
+  '.','.','.',#000,'E','_','N','o','t',' ','a',' ','d','i','r',
+  'e','c','t','i','v','e',' ','o','r',' ','l','o','c','a','l',
+  ' ','s','y','m','b','o','l',':',' ','$','1',#000,'E','_','/',
+  ' ','a','t',' ','b','e','g','i','n','n','i','n','g',' ','o',
+  'f',' ','l','i','n','e',' ','n','o','t',' ','a','l','l','o',
+  'w','e','d',#000,'E','_','N','O','R',' ','n','o','t',' ','s',
+  'u','p','p','o','r','t','e','d',#000,'E','_','I','n','v','a',
+  'l','i','d',' ','f','l','o','a','t','i','n','g',' ','p','o',
+  'i','n','t',' ','r','e','g','i','s','t','e','r',' ','n','a',
+  'm','e',#000,'W','_','M','o','d','u','l','o',' ','n','o','t',
+  ' ','s','u','p','p','o','r','t','e','d',#000,'E','_','I','n',
+  'v','a','l','i','d',' ','f','l','o','a','t','i','n','g',' ',
+  'p','o','i','n','t',' ','c','o','n','s','t','a','n','t',':',
+  ' ','$','1',#000,'E','_','S','i','z','e',' ','s','u','f','f',
+  'i','x',' ','a','n','d',' ','d','e','s','t','i','n','a','t',
+  'i','o','n',' ','r','e','g','i','s','t','e','r',' ','d','o',
+  ' ','n','o','t',' ','m','a','t','c','h',#000,'E','_','I','n',
+  't','e','r','n','a','l',' ','e','r','r','o','r',' ','i','n',
+  ' ','C','o','n','c','a','t','L','a','b','e','l','e','d','I',
+  'n','s','t','r','(',')',#000,'W','_','F','l','o','a','t','i',
+  'n','g',' ','p','o','i','n','t',' ','b','i','n','a','r','y',
+  ' ','r','e','p','r','e','s','e','n','t','a','t','i','o','n',
+  ' ','i','g','n','o','r','e','d',#000,'W','_','F','l','o','a',
+  't','i','n','g',' ','p','o','i','n','t',' ','h','e','x','a',
+  'd','e','c','i','m','a','l',' ','r','e','p','r','e','s','e',
+  'n','t','a','t','i','o','n',' ','i','g','n','o','r','e','d',
+  #000,'W','_','F','l','o','a','t','i','n','g',' ','p','o','i',
+  'n','t',' ','o','c','t','a','l',' ','r','e','p','r','e','s',
+  'e','n','t','a','t','i','o','n',' ','i','g','n','o','r','e',
+  'd',#000,'E','_','I','n','v','a','l','i','d',' ','r','e','a',
+  'l',' ','c','o','n','s','t','a','n','t',' ','e','x','p','r',
+  'e','s','s','i','o','n',#000,'E','_','P','a','r','e','n','t',
+  'h','e','s','i','s',' ','a','r','e',' ','n','o','t',' ','a',
+  'l','l','o','w','e','d',#000,'E','_','I','n','v','a','l','i',
+  'd',' ','R','e','f','e','r','e','n','c','e',#000,'E','_','C',
+  'a','n','n','o','t',' ','u','s','e',' ','_','_','S','E','L',
+  'F',' ','o','u','t','s','i','d','e',' ','a',' ','m','e','t',
+  'h','o','d',#000,'E','_','C','a','n','n','o','t',' ','u','s',
+  'e',' ','_','_','O','L','D','E','B','P',' ','o','u','t','s',
+  'i','d','e',' ','a',' ','n','e','s','t','e','d',' ','p','r',
+  'o','c','e','d','u','r','e',#000,'W','_','I','d','e','n','t',
+  'i','f','i','e','r',' ','$','1',' ','s','u','p','p','o','s',
+  'e','d',' ','e','x','t','e','r','n','a','l',#000,'E','_','I',
+  'n','v','a','l','i','d',' ','s','e','g','m','e','n','t',' ',
+  'o','v','e','r','r','i','d','e',' ','e','x','p','r','e','s',
+  's','i','o','n',#000,'E','_','S','t','r','i','n','g','s',' ',
+  'n','o','t',' ','a','l','l','o','w','e','d',' ','a','s',' ',
+  'c','o','n','s','t','a','n','t','s',#000,'D','_','S','t','a',
+  'r','t','i','n','g',' ','A','T','&','T',' ','s','t','y','l',
+  'e','d',' ','a','s','s','e','m','b','l','e','r',' ','p','a',
+  'r','s','i','n','g','.','.','.',#000,'D','_','F','i','n','i',
+  's','h','e','d',' ','A','T','&','T',' ','s','t','y','l','e',
+  'd',' ','a','s','s','e','m','b','l','e','r',' ','p','a','r',
+  's','i','n','g','.','.','.',#000,'E','_','S','w','i','t','c',
+  'h','i','n','g',' ','s','e','c','t','i','o','n','s',' ','i',
+  's',' ','n','o','t',' ','a','l','l','o','w','e','d',' ','i',
+  'n',' ','a','n',' ','a','s','s','e','m','b','l','e','r',' ',
+  'b','l','o','c','k',#000,'E','_','I','n','v','a','l','i','d',
+  ' ','g','l','o','b','a','l',' ','d','e','f','i','n','i','t',
+  'i','o','n',#000,'E','_','L','i','n','e',' ','s','e','p','a',
+  'r','a','t','o','r',' ','e','x','p','e','c','t','e','d',#000,
+  'W','_','g','l','o','b','l',' ','n','o','t',' ','s','u','p',
+  'p','o','r','t','e','d',#000,'W','_','a','l','i','g','n',' ',
+  'n','o','t',' ','s','u','p','p','o','r','t','e','d',#000,'W',
+  '_','l','c','o','m','m',' ','n','o','t',' ','s','u','p','p',
+  'o','r','t','e','d',#000,'W','_','c','o','m','m',' ','n','o',
+  't',' ','s','u','p','p','o','r','t','e','d',#000,'E','_','I',
+  'n','v','a','l','i','d',' ','l','o','c','a','l',' ','c','o',
+  'm','m','o','n',' ','d','e','f','i','n','i','t','i','o','n',
+  #000,'E','_','I','n','v','a','l','i','d',' ','g','l','o','b',
+  'a','l',' ','c','o','m','m','o','n',' ','d','e','f','i','n',
+  'i','t','i','o','n',#000,'E','_','l','o','c','a','l',' ','s',
+  'y','m','b','o','l',':',' ','$','1',' ','n','o','t',' ','f',
+  'o','u','n','d',' ','i','n','s','i','d','e',' ','a','s','m',
+  ' ','s','t','a','t','e','m','e','n','t',#000,'E','_','a','s',
+  's','e','m','b','l','e','r',' ','c','o','d','e',' ','n','o',
+  't',' ','r','e','t','u','r','n','e','d',' ','t','o',' ','t',
+  'e','x','t',#000,'F','_','i','n','t','e','r','n','a','l',' ',
+  'e','r','r','o','r',' ','i','n',' ','B','u','i','l','d','R',
+  'e','f','e','r','e','n','c','e','(',')',#000,'E','_','i','n',
+  'v','a','l','i','d',' ','o','p','c','o','d','e',' ','s','i',
+  'z','e',#000,'W','_','N','E','A','R',' ','i','g','n','o','r',
+  'e','d',#000,'W','_','F','A','R',' ','i','g','n','o','r','e',
+  'd',#000,'D','_','C','r','e','a','t','i','n','g',' ','i','n',
+  'l','i','n','e',' ','a','s','m',' ','l','o','o','k','u','p',
+  ' ','t','a','b','l','e','s',#000,'W','_','U','s','i','n','g',
+  ' ','a',' ','d','e','f','i','n','e','d',' ','n','a','m','e',
+  ' ','a','s',' ','a',' ','l','o','c','a','l',' ','l','a','b',
+  'e','l',#000,'F','_','i','n','t','e','r','n','a','l',' ','e',
+  'r','r','o','r',' ','i','n',' ','H','a','n','d','l','e','E',
+  'x','t','e','n','d','(',')',#000,'E','_','I','n','v','a','l',
+  'i','d',' ','c','h','a','r','a','c','t','e','r',':',' ','<',
+  #000,'E','_','I','n','v','a','l','i','d',' ','c','h','a','r',
+  'a','c','t','e','r',':',' ','>',#000,'E','_','U','n','s','u',
+  'p','p','o','r','t','e','d',' ','o','p','c','o','d','e',#000,
+  'E','_','I','n','c','r','e','m','e','n','t',' ','a','n','d',
+  ' ','D','e','c','r','e','m','e','n','t',' ','m','o','d','e',
+  ' ','n','o','t',' ','a','l','l','o','w','e','d',' ','t','o',
+  'g','e','t','h','e','r',#000,'E','_','I','n','v','a','l','i',
+  'd',' ','R','e','g','i','s','t','e','r',' ','l','i','s','t',
+  ' ','i','n',' ','m','o','v','e','m','/','f','m','o','v','e',
+  'm',#000,'E','_','I','n','v','a','l','i','d',' ','R','e','g',
+  'i','s','t','e','r',' ','l','i','s','t',' ','f','o','r',' ',
+  'o','p','c','o','d','e',#000,'E','_','6','8','0','2','0','+',
+  ' ','m','o','d','e',' ','r','e','q','u','i','r','e','d',' ',
+  't','o',' ','a','s','s','e','m','b','l','e',#000,'D','_','S',
+  't','a','r','t','i','n','g',' ','M','o','t','o','r','o','l',
+  'a',' ','s','t','y','l','e','d',' ','a','s','s','e','m','b',
+  'l','e','r',' ','p','a','r','s','i','n','g','.','.','.',#000,
+  'D','_','F','i','n','i','s','h','e','d',' ','M','o','t','o',
+  'r','o','l','a',' ','s','t','y','l','e','d',' ','a','s','s',
+  'e','m','b','l','e','r',' ','p','a','r','s','i','n','g','.',
+  '.','.',#000,'W','_','X','D','E','F',' ','n','o','t',' ','s',
+  'u','p','p','o','r','t','e','d',#000,'W','_','F','u','n','c',
+  't','i','o','n','s',' ','w','i','t','h',' ','v','o','i','d',
+  ' ','r','e','t','u','r','n',' ','v','a','l','u','e',' ','c',
+  'a','n',#039,'t',' ','r','e','t','u','r','n',' ','a','n','y',
+  ' ','v','a','l','u','e',' ','i','n',' ','a','s','m',' ','c',
+  'o','d','e',#000,'E','_','I','n','v','a','l','i','d',' ','s',
+  'u','f','f','i','x',' ','f','o','r',' ','i','n','t','e','l',
+  ' ','a','s','s','e','m','b','l','e','r',#000,'E','_','E','x',
+  't','e','n','d','e','d',' ','n','o','t',' ','s','u','p','p',
   'o','r','t','e','d',' ','i','n',' ','t','h','i','s',' ','m',
   'o','r','t','e','d',' ','i','n',' ','t','h','i','s',' ','m',
-  'o','d','e',#000,'W','_','Y','o','u',' ','n','e','e','d',' ',
-  'G','N','U',' ','a','s',' ','v','e','r','s','i','o','n',' ',
-  '>','=',' ','2','.','8','1',' ','t','o',' ','c','o','m','p',
-  'i','l','e',' ','t','h','i','s',' ','M','M','X',' ','c','o',
-  'd','e',#000,'I','_','A','s','s','e','m','b','l','i','n','g',
-  ' ','(','p','i','p','e',')',' ','$','1',#000,'E','_','C','a',
-  'n',#039,'t',' ','c','r','e','a','t','e',' ','a','s','s','e',
-  'm','b','e','r',' ','f','i','l','e',' ','$','1',#000,'W','_',
-  'A','s','s','e','m','b','l','e','r',' ','$','1',' ','n','o',
-  't',' ','f','o','u','n','d',',',' ','s','w','i','t','c','h',
-  'i','n','g',' ','t','o',' ','e','x','t','e','r','n','a','l',
-  ' ','a','s','s','e','m','b','l','i','n','g',#000,'U','_','U',
-  's','i','n','g',' ','a','s','s','e','m','b','l','e','r',':',
-  ' ','$','1',#000,'W','_','E','r','r','o','r',' ','w','h','i',
-  'l','e',' ','a','s','s','e','m','b','l','i','n','g',#000,'W',
-  '_','C','a','n',#039,'t',' ','c','a','l','l',' ','t','h','e',
-  ' ','a','s','s','e','m','b','l','e','r',',',' ','s','w','i',
-  't','c','h','i','n','g',' ','t','o',' ','e','x','t','e','r',
-  'n','a','l',' ','a','s','s','e','m','b','l','i','n','g',#000,
-  'I','_','A','s','s','e','m','b','l','i','n','g',' ','$','1',
-  #000,'W','_','L','i','n','k','e','r',' ','$','1',' ','n','o',
-  't',' ','f','o','u','n','d',',',' ','s','w','i','t','c','h',
-  'i','n','g',' ','t','o',' ','e','x','t','e','r','n','a','l',
-  ' ','l','i','n','k','i','n','g',#000,'U','_','U','s','i','n',
-  'g',' ','l','i','n','k','e','r',':',' ','$','1',#000,'E','_',
-  'F','i','l','e',' ','$','1',' ','n','o','t',' ','f','o','u',
-  'n','d',',',' ','L','i','n','k','i','n','g',' ','m','a','y',
-  ' ','f','a','i','l',' ','!','!',#000,'W','_','E','r','r','o',
-  'r',' ','w','h','i','l','e',' ','l','i','n','k','i','n','g',
-  #000,'W','_','C','a','n',#039,'t',' ','c','a','l','l',' ','t',
-  'h','e',' ','l','i','n','k','e','r',',',' ','s','w','i','t',
-  'c','h','i','n','g',' ','t','o',' ','e','x','t','e','r','n',
-  'a','l',' ','l','i','n','k','i','n','g',#000,'I','_','L','i',
-  'n','k','i','n','g',' ','$','1',#000,'W','_','b','i','n','d',
-  'e','r',' ','n','o','t',' ','f','o','u','n','d',',',' ','s',
-  'w','i','t','c','h','i','n','g',' ','t','o',' ','e','x','t',
-  'e','r','n','a','l',' ','b','i','n','d','i','n','g',#000,'W',
-  '_','a','r',' ','n','o','t',' ','f','o','u','n','d',',',' ',
+  'o','d','e',#000,'E','_','C','o','m','p',' ','n','o','t',' ',
+  's','u','p','p','o','r','t','e','d',' ','i','n',' ','t','h',
+  'i','s',' ','m','o','d','e',#000,'W','_','Y','o','u',' ','n',
+  'e','e','d',' ','G','N','U',' ','a','s',' ','v','e','r','s',
+  'i','o','n',' ','>','=',' ','2','.','8','1',' ','t','o',' ',
+  'c','o','m','p','i','l','e',' ','t','h','i','s',' ','M','M',
+  'X',' ','c','o','d','e',#000,'I','_','A','s','s','e','m','b',
+  'l','i','n','g',' ','(','p','i','p','e',')',' ','$','1',#000,
+  'E','_','C','a','n',#039,'t',' ','c','r','e','a','t','e',' ',
+  'a','s','s','e','m','b','e','r',' ','f','i','l','e',' ','$',
+  '1',#000,'W','_','A','s','s','e','m','b','l','e','r',' ','$',
+  '1',' ','n','o','t',' ','f','o','u','n','d',',',' ','s','w',
+  'i','t','c','h','i','n','g',' ','t','o',' ','e','x','t','e',
+  'r','n','a','l',' ','a','s','s','e','m','b','l','i','n','g',
+  #000,'U','_','U','s','i','n','g',' ','a','s','s','e','m','b',
+  'l','e','r',':',' ','$','1',#000,'W','_','E','r','r','o','r',
+  ' ','w','h','i','l','e',' ','a','s','s','e','m','b','l','i',
+  'n','g',#000,'W','_','C','a','n',#039,'t',' ','c','a','l','l',
+  ' ','t','h','e',' ','a','s','s','e','m','b','l','e','r',',',
+  ' ','s','w','i','t','c','h','i','n','g',' ','t','o',' ','e',
+  'x','t','e','r','n','a','l',' ','a','s','s','e','m','b','l',
+  'i','n','g',#000,'I','_','A','s','s','e','m','b','l','i','n',
+  'g',' ','$','1',#000,'W','_','L','i','n','k','e','r',' ','$',
+  '1',' ','n','o','t',' ','f','o','u','n','d',',',' ','s','w',
+  'i','t','c','h','i','n','g',' ','t','o',' ','e','x','t','e',
+  'r','n','a','l',' ','l','i','n','k','i','n','g',#000,'U','_',
+  'U','s','i','n','g',' ','l','i','n','k','e','r',':',' ','$',
+  '1',#000,'E','_','F','i','l','e',' ','$','1',' ','n','o','t',
+  ' ','f','o','u','n','d',',',' ','L','i','n','k','i','n','g',
+  ' ','m','a','y',' ','f','a','i','l',' ','!','!',#000,'W','_',
+  'E','r','r','o','r',' ','w','h','i','l','e',' ','l','i','n',
+  'k','i','n','g',#000,'W','_','C','a','n',#039,'t',' ','c','a',
+  'l','l',' ','t','h','e',' ','l','i','n','k','e','r',',',' ',
   's','w','i','t','c','h','i','n','g',' ','t','o',' ','e','x',
   's','w','i','t','c','h','i','n','g',' ','t','o',' ','e','x',
-  't','e','r','n','a','l',' ','a','r',#000,'E','_','D','y','n',
-  'a','m','i','c',' ','L','i','b','r','a','r','i','e','s',' ',
-  'n','o','t',' ','s','u','p','p','o','r','t','e','d',#000,'I',
-  '_','C','l','o','s','i','n','g',' ','s','c','r','i','p','t',
-  ' ','$','1',#000,'U','_','P','P','U',' ','L','o','a','d','i',
-  'n','g',' ','$','1',#000,'D','_','P','P','U',' ','T','i','m',
-  'e',':',' ','$','1',#000,'D','_','P','P','U',' ','F','i','l',
-  'e',' ','t','o','o',' ','s','h','o','r','t',#000,'D','_','P',
-  'P','U',' ','I','n','v','a','l','i','d',' ','H','e','a','d',
-  'e','r',' ','(','n','o',' ','P','P','U',' ','a','t',' ','t',
-  'h','e',' ','b','e','g','i','n',')',#000,'D','_','P','P','U',
-  ' ','I','n','v','a','l','i','d',' ','V','e','r','s','i','o',
-  'n',' ','$','1',#000,'D','_','P','P','U',' ','F','l','a','g',
-  's',':',' ','$','1',#000,'D','_','P','P','U',' ','C','r','c',
-  ':',' ','$','1',#000,'T','_','P','P','U',' ','S','o','u','r',
-  'c','e',':',' ','$','1',#000,'D','_','o','b','j','e','c','t',
-  'f','i','l','e',' ','a','n','d',' ','a','s','s','e','m','b',
-  'l','e','r','f','i','l','e',' ','a','r','e',' ','o','l','d',
-  'e','r',' ','t','h','a','n',' ','p','p','u','f','i','l','e',
-  #000,'D','_','o','b','j','e','c','t','f','i','l','e',' ','i',
-  's',' ','o','l','d','e','r',' ','t','h','a','n',' ','a','s',
-  's','e','m','b','l','e','r','f','i','l','e',#000,'T','_','U',
-  'n','i','t','s','e','a','r','c','h',':',' ','$','1',#000,'U',
-  '_','W','r','i','t','i','n','g',' ','$','1',#000,'F','_','C',
-  'a','n',#039,'t',' ','W','r','i','t','e',' ','P','P','U','-',
-  'F','i','l','e',#000,'F','_','r','e','a','d','i','n','g',' ',
-  'P','P','U','-','F','i','l','e',#000,'F','_','I','n','v','a',
-  'l','i','d',' ','P','P','U','-','F','i','l','e',' ','e','n',
-  't','r','y',':',' ','$','1',#000,'F','_','P','P','U',' ','D',
-  'b','x',' ','c','o','u','n','t',' ','p','r','o','b','l','e',
-  'm',#000,'E','_','I','l','l','e','g','a','l',' ','u','n','i',
-  't',' ','n','a','m','e',':',' ','$','1',#000,'F','_','T','o',
-  'o',' ','m','u','c','h',' ','u','n','i','t','s',#000,'F','_',
-  'C','i','r','c','u','l','a','r',' ','u','n','i','t',' ','r',
-  'e','f','e','r','e','n','c','e',#000,'F','_','C','a','n',#039,
-  't',' ','c','o','m','p','i','l','e',' ','u','n','i','t',' ',
-  '$','1',',',' ','n','o',' ','s','o','u','r','c','e','s',' ',
-  'a','v','a','i','l','a','b','l','e',#000,'W','_','C','o','m',
-  'p','i','l','i','n','g',' ','t','h','e',' ','s','y','s','t',
-  'e','m',' ','u','n','i','t',' ','r','e','q','u','i','r','e',
-  's',' ','t','h','e',' ','-','U','s',' ','s','w','i','t','c',
-  'h',#000,'E','_','$','1',' ','E','r','r','o','r','s',#000,'F',
-  '_','T','h','e','r','e',' ','w','e','r','e',' ','e','r','r',
-  'o','r','s',' ','c','o','m','p','i','l','i','n','g',' ','m',
-  'o','d','u','l','e',',',' ','c','o','m','p','i','l','a','t',
-  'i','o','n',' ','s','t','o','p','p','e','d',#000);
+  't','e','r','n','a','l',' ','l','i','n','k','i','n','g',#000,
+  'I','_','L','i','n','k','i','n','g',' ','$','1',#000,'W','_',
+  'b','i','n','d','e','r',' ','n','o','t',' ','f','o','u','n',
+  'd',',',' ','s','w','i','t','c','h','i','n','g',' ','t','o',
+  ' ','e','x','t','e','r','n','a','l',' ','b','i','n','d','i',
+  'n','g',#000,'W','_','a','r',' ','n','o','t',' ','f','o','u',
+  'n','d',',',' ','s','w','i','t','c','h','i','n','g',' ','t',
+  'o',' ','e','x','t','e','r','n','a','l',' ','a','r',#000,'E',
+  '_','D','y','n','a','m','i','c',' ','L','i','b','r','a','r',
+  'i','e','s',' ','n','o','t',' ','s','u','p','p','o','r','t',
+  'e','d',#000,'I','_','C','l','o','s','i','n','g',' ','s','c',
+  'r','i','p','t',' ','$','1',#000,'U','_','P','P','U',' ','L',
+  'o','a','d','i','n','g',' ','$','1',#000,'D','_','P','P','U',
+  ' ','T','i','m','e',':',' ','$','1',#000,'D','_','P','P','U',
+  ' ','F','i','l','e',' ','t','o','o',' ','s','h','o','r','t',
+  #000,'D','_','P','P','U',' ','I','n','v','a','l','i','d',' ',
+  'H','e','a','d','e','r',' ','(','n','o',' ','P','P','U',' ',
+  'a','t',' ','t','h','e',' ','b','e','g','i','n',')',#000,'D',
+  '_','P','P','U',' ','I','n','v','a','l','i','d',' ','V','e',
+  'r','s','i','o','n',' ','$','1',#000,'D','_','P','P','U',' ',
+  'F','l','a','g','s',':',' ','$','1',#000,'D','_','P','P','U',
+  ' ','C','r','c',':',' ','$','1',#000,'T','_','P','P','U',' ',
+  'S','o','u','r','c','e',':',' ','$','1',#000,'D','_','o','b',
+  'j','e','c','t','f','i','l','e',' ','a','n','d',' ','a','s',
+  's','e','m','b','l','e','r','f','i','l','e',' ','a','r','e',
+  ' ','o','l','d','e','r',' ','t','h','a','n',' ','p','p','u',
+  'f','i','l','e',#000,'D','_','o','b','j','e','c','t','f','i',
+  'l','e',' ','i','s',' ','o','l','d','e','r',' ','t','h','a',
+  'n',' ','a','s','s','e','m','b','l','e','r','f','i','l','e',
+  #000,'T','_','U','n','i','t','s','e','a','r','c','h',':',' ',
+  '$','1',#000,'U','_','W','r','i','t','i','n','g',' ','$','1',
+  #000,'F','_','C','a','n',#039,'t',' ','W','r','i','t','e',' ',
+  'P','P','U','-','F','i','l','e',#000,'F','_','r','e','a','d',
+  'i','n','g',' ','P','P','U','-','F','i','l','e',#000,'F','_',
+  'I','n','v','a','l','i','d',' ','P','P','U','-','F','i','l',
+  'e',' ','e','n','t','r','y',':',' ','$','1',#000,'F','_','P',
+  'P','U',' ','D','b','x',' ','c','o','u','n','t',' ','p','r',
+  'o','b','l','e','m',#000,'E','_','I','l','l','e','g','a','l',
+  ' ','u','n','i','t',' ','n','a','m','e',':',' ','$','1',#000,
+  'F','_','T','o','o',' ','m','u','c','h',' ','u','n','i','t',
+  's',#000,'F','_','C','i','r','c','u','l','a','r',' ','u','n',
+  'i','t',' ','r','e','f','e','r','e','n','c','e',#000,'F','_',
+  'C','a','n',#039,'t',' ','c','o','m','p','i','l','e',' ','u',
+  'n','i','t',' ','$','1',',',' ','n','o',' ','s','o','u','r',
+  'c','e','s',' ','a','v','a','i','l','a','b','l','e',#000,'W',
+  '_','C','o','m','p','i','l','i','n','g',' ','t','h','e',' ',
+  's','y','s','t','e','m',' ','u','n','i','t',' ','r','e','q',
+  'u','i','r','e','s',' ','t','h','e',' ','-','U','s',' ','s',
+  'w','i','t','c','h',#000,'E','_','$','1',' ','E','r','r','o',
+  'r','s',#000,'F','_','T','h','e','r','e',' ','w','e','r','e',
+  ' ','e','r','r','o','r','s',' ','c','o','m','p','i','l','i',
+  'n','g',' ','m','o','d','u','l','e',',',' ','c','o','m','p',
+  'i','l','a','t','i','o','n',' ','s','t','o','p','p','e','d',
+  #000);

+ 36 - 41
compiler/optmsg.inc

@@ -1,4 +1,4 @@
-const optiontxt : array[1..04755] of char=(
+const optiontxt : array[1..04676] of char=(
   ' ','[','o','p','t','i','o','n','s',']',' ','<','i','n','p',
   ' ','[','o','p','t','i','o','n','s',']',' ','<','i','n','p',
   'u','t','f','i','l','e','>',' ','[','o','p','t','i','o','n',
   'u','t','f','i','l','e','>',' ','[','o','p','t','i','o','n',
   's',']',#000,'O','n','l','y',' ','o','n','e',' ','s','o','u',
   's',']',#000,'O','n','l','y',' ','o','n','e',' ','s','o','u',
@@ -30,13 +30,13 @@ const optiontxt : array[1..04755] of char=(
   'a','t',' ','t','h','e',' ','e','n','d',' ','o','f',' ','t',
   'a','t',' ','t','h','e',' ','e','n','d',' ','o','f',' ','t',
   'h','e',' ','f','i','l','e',#000,'F','r','e','e',' ','P','a',
   'h','e',' ','f','i','l','e',#000,'F','r','e','e',' ','P','a',
   's','c','a','l',' ','C','o','m','p','i','l','e','r',' ','v',
   's','c','a','l',' ','C','o','m','p','i','l','e','r',' ','v',
-  'e','r','s','i','o','n',' ','0','.','9','9','.','6',' ','f',
+  'e','r','s','i','o','n',' ','0','.','9','9','.','5',' ','f',
   'o','r',' ','$','1',#000,'C','o','p','y','r','i','g','h','t',
   'o','r',' ','$','1',#000,'C','o','p','y','r','i','g','h','t',
   ' ','(','c',')',' ','1','9','9','3','-','9','8',' ','b','y',
   ' ','(','c',')',' ','1','9','9','3','-','9','8',' ','b','y',
   ' ','F','l','o','r','i','a','n',' ','K','l','a','e','m','p',
   ' ','F','l','o','r','i','a','n',' ','K','l','a','e','m','p',
   'f','l',#000,'F','r','e','e',' ','P','a','s','c','a','l',' ',
   'f','l',#000,'F','r','e','e',' ','P','a','s','c','a','l',' ',
   'C','o','m','p','i','l','e','r',' ','v','e','r','s','i','o',
   'C','o','m','p','i','l','e','r',' ','v','e','r','s','i','o',
-  'n',' ','0','.','9','9','.','6',#000,#000,'T','h','i','s',' ',
+  'n',' ','0','.','9','9','.','5',#000,#000,'T','h','i','s',' ',
   'p','r','o','g','r','a','m',' ','c','o','m','e','s',' ','u',
   'p','r','o','g','r','a','m',' ','c','o','m','e','s',' ','u',
   'n','d','e','r',' ','t','h','e',' ','G','N','U',' ','G','e',
   'n','d','e','r',' ','t','h','e',' ','G','N','U',' ','G','e',
   'n','e','r','a','l',' ','P','u','b','l','i','c',' ','L','i',
   'n','e','r','a','l',' ','P','u','b','l','i','c',' ','L','i',
@@ -278,41 +278,36 @@ const optiontxt : array[1..04755] of char=(
   'O','z','_','u','n','c','e','r','t','a','i','n',' ','o','p',
   'O','z','_','u','n','c','e','r','t','a','i','n',' ','o','p',
   't','i','m','i','z','e','s',' ','(','s','e','e',' ','d','o',
   't','i','m','i','z','e','s',' ','(','s','e','e',' ','d','o',
   'c','s',')',#000,'3','*','2','O','2','_','o','p','t','i','m',
   'c','s',')',#000,'3','*','2','O','2','_','o','p','t','i','m',
-  'i','z','e',' ','f','o','r',' ','t','h','e',' ','P','e','n',
-  't','i','u','m',' ','I','I',' ','(','t','m',')',#000,'3','*',
-  '2','O','3','_','o','p','t','i','m','i','z','e',' ','f','o',
-  'r',' ','t','h','e',' ','i','3','8','6',#000,'3','*','2','O',
-  '4','_','o','p','t','i','m','i','z','e',' ','f','o','r',' ',
-  't','h','e',' ','i','4','8','6',#000,'3','*','2','O','5','_',
-  'o','p','t','i','m','i','z','e',' ','f','o','r',' ','t','h',
-  'e',' ','P','e','n','t','i','u','m',' ','(','t','m',')',#000,
-  '3','*','2','O','6','_','o','p','t','i','m','i','z','e',' ',
-  'f','o','r',' ','t','h','e',' ','P','e','n','t','i','u','m',
-  'P','r','o',' ','(','t','m',')',#000,'3','*','2','O','7','_',
-  'o','p','t','i','m','i','z','e',' ','f','o','r',' ','t','h',
-  'e',' ','C','y','r','i','x',' ','6','x','8','6',#000,'3','*',
-  '2','O','8','_','o','p','t','i','m','i','z','e',' ','f','o',
-  'r',' ','t','h','e',' ','A','M','D',' ','K','6',#000,'6','*',
-  '1','A','_','o','u','t','p','u','t',' ','f','o','r','m','a',
-  't',#000,'6','*','2','A','g','a','s','_','G','N','U',' ','M',
-  'o','t','o','r','o','l','a',' ','a','s','s','e','m','b','l',
-  'e','r',#000,'6','*','2','A','o','_','U','N','I','X',' ','o',
-  '-','f','i','l','e',#000,'6','*','2','A','m','_','S','t','a',
-  'n','d','a','r','d',' ','M','o','t','o','r','o','l','a',' ',
-  'a','s','s','e','m','b','l','e','r',#000,'6','*','2','A','i',
-  '_','M','I','T',' ','S','y','n','t','a','x',' ','(','o','l',
-  'd',' ','G','A','S',')',#000,'6','*','1','O','_','o','p','t',
-  'i','m','i','z','a','t','i','o','n','s',#000,'6','*','2','O',
-  'a','_','s','i','m','p','l','e',' ','o','p','t','i','m','i',
-  'z','a','t','i','o','n','s',#000,'6','*','2','O','g','_','o',
-  'p','t','i','m','i','z','e',' ','f','o','r',' ','s','i','z',
-  'e',#000,'6','*','2','O','G','_','o','p','t','i','m','i','z',
-  'e',' ','f','o','r',' ','t','i','m','e',#000,'6','*','2','O',
-  'x','_','o','p','t','i','m','i','z','e',' ','m','a','x','i',
-  'm','u','m',#000,'6','*','2','O','2','_','t','a','r','g','e',
-  't',' ','i','s',' ','a',' ','M','C','6','8','0','2','0','+',
-  ' ','p','r','o','c','e','s','s','o','r',#000,'*','*','1','*',
-  '_',#000,'*','*','1','?','_','s','h','o','w','s',' ','t','h',
-  'i','s',' ','h','e','l','p',#000,'*','*','1','h','_','s','h',
-  'o','w','s',' ','t','h','i','s',' ','h','e','l','p',' ','w',
-  'i','t','h','o','u','t',' ','w','a','i','t','i','n','g',#000);
+  'i','z','e',' ','f','o','r',' ','P','e','n','t','i','u','m',
+  ' ','I','I',' ','(','t','m',')',#000,'3','*','2','O','3','_',
+  'o','p','t','i','m','i','z','e',' ','f','o','r',' ','i','3',
+  '8','6',#000,'3','*','2','O','4','_','o','p','t','i','m','i',
+  'z','e',' ','f','o','r',' ','i','4','8','6',#000,'3','*','2',
+  'O','5','_','o','p','t','i','m','i','z','e',' ','f','o','r',
+  ' ','P','e','n','t','i','u','m',' ','(','t','m',')',#000,'3',
+  '*','2','O','6','_','o','p','t','i','m','i','z','a','t','i',
+  'o','n','s',' ','f','o','r',' ','P','e','n','t','i','u','m',
+  'P','r','o',' ','(','t','m',')',#000,'6','*','1','A','_','o',
+  'u','t','p','u','t',' ','f','o','r','m','a','t',#000,'6','*',
+  '2','A','g','a','s','_','G','N','U',' ','M','o','t','o','r',
+  'o','l','a',' ','a','s','s','e','m','b','l','e','r',#000,'6',
+  '*','2','A','o','_','U','N','I','X',' ','o','-','f','i','l',
+  'e',#000,'6','*','2','A','m','_','S','t','a','n','d','a','r',
+  'd',' ','M','o','t','o','r','o','l','a',' ','a','s','s','e',
+  'm','b','l','e','r',#000,'6','*','2','A','i','_','M','I','T',
+  ' ','S','y','n','t','a','x',' ','(','o','l','d',' ','G','A',
+  'S',')',#000,'6','*','1','O','_','o','p','t','i','m','i','z',
+  'a','t','i','o','n','s',#000,'6','*','2','O','a','_','s','i',
+  'm','p','l','e',' ','o','p','t','i','m','i','z','a','t','i',
+  'o','n','s',#000,'6','*','2','O','g','_','o','p','t','i','m',
+  'i','z','e',' ','f','o','r',' ','s','i','z','e',#000,'6','*',
+  '2','O','G','_','o','p','t','i','m','i','z','e',' ','f','o',
+  'r',' ','t','i','m','e',#000,'6','*','2','O','x','_','o','p',
+  't','i','m','i','z','e',' ','m','a','x','i','m','u','m',#000,
+  '6','*','2','O','2','_','t','a','r','g','e','t',' ','i','s',
+  ' ','a',' ','M','C','6','8','0','2','0','+',' ','p','r','o',
+  'c','e','s','s','o','r',#000,'*','*','1','*','_',#000,'*','*',
+  '1','?','_','s','h','o','w','s',' ','t','h','i','s',' ','h',
+  'e','l','p',#000,'*','*','1','h','_','s','h','o','w','s',' ',
+  't','h','i','s',' ','h','e','l','p',' ','w','i','t','h','o',
+  'u','t',' ','w','a','i','t','i','n','g',#000);

+ 14 - 5
compiler/opts386.pas

@@ -35,7 +35,7 @@ type
 implementation
 implementation
 
 
 uses
 uses
-  globals;
+  systems,globals;
 
 
 procedure toption386.interpret_proc_specific_options(const opt:string);
 procedure toption386.interpret_proc_specific_options(const opt:string);
 var
 var
@@ -67,16 +67,22 @@ begin
                assem_need_external_list:=false;
                assem_need_external_list:=false;
              end
              end
            else
            else
+           { nasm supports local labels but
+             only inside one global label :
+             this does not work for const strings and
+             real references !! }
             if copy(opt,3,length(opt)-2)='obj' then
             if copy(opt,3,length(opt)-2)='obj' then
              begin
              begin
                output_format:=of_obj;
                output_format:=of_obj;
                assem_need_external_list:=true;
                assem_need_external_list:=true;
+               { target_info.labelprefix:='?L'; }
              end
              end
            else
            else
             if copy(opt,3,length(opt)-2)='nasm' then
             if copy(opt,3,length(opt)-2)='nasm' then
              begin
              begin
                output_format:=of_nasm;
                output_format:=of_nasm;
                assem_need_external_list:=true;
                assem_need_external_list:=true;
+               { target_info.labelprefix:='?L'; }
              end
              end
            else
            else
             IllegalPara(opt);
             IllegalPara(opt);
@@ -95,8 +101,6 @@ begin
             '4' : opt_processors:=i486;
             '4' : opt_processors:=i486;
             '5' : opt_processors:=pentium;
             '5' : opt_processors:=pentium;
             '6' : opt_processors:=pentiumpro;
             '6' : opt_processors:=pentiumpro;
-            '7' : opt_processors:=cx6x86;
-            '8' : opt_processors:=amdk6;
             else IllegalPara(opt);
             else IllegalPara(opt);
             end;
             end;
           end;
           end;
@@ -119,8 +123,13 @@ end;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.2  1998-04-09 14:28:09  jonas
-    + basic k6 and 6x86 optimizing support (-O7 and -O8)
+  Revision 1.3  1998-04-29 10:33:55  pierre
+    + added some code for ansistring (not complete nor working yet)
+    * corrected operator overloading
+    * corrected nasm output
+    + started inline procedures
+    + added starstarn : use ** for exponentiation (^ gave problems)
+    + started UseTokenInfo cond to get accurate positions
 
 
   Revision 1.1.1.1  1998/03/25 11:18:14  root
   Revision 1.1.1.1  1998/03/25 11:18:14  root
   * Restored version
   * Restored version

+ 26 - 4
compiler/parser.pas

@@ -127,6 +127,9 @@ unit parser;
 
 
          { some variables to save the compiler state }
          { some variables to save the compiler state }
          oldtoken : ttoken;
          oldtoken : ttoken;
+{$ifdef UseTokenInfo}
+         oldtokeninfo : ptokeninfo;
+{$endif UseTokenInfo}
          oldpattern : stringid;
          oldpattern : stringid;
 
 
          oldpreprocstack : ppreprocstack;
          oldpreprocstack : ppreprocstack;
@@ -243,6 +246,9 @@ unit parser;
          oldmacros:=macros;
          oldmacros:=macros;
          oldpattern:=pattern;
          oldpattern:=pattern;
          oldtoken:=token;
          oldtoken:=token;
+{$ifdef UseTokenInfo}
+         oldtokeninfo:=tokeninfo;
+{$endif UseTokenInfo}
          oldorgpattern:=orgpattern;
          oldorgpattern:=orgpattern;
          old_block_type:=block_type;
          old_block_type:=block_type;
          oldpreprocstack:=preprocstack;
          oldpreprocstack:=preprocstack;
@@ -290,7 +296,12 @@ unit parser;
          define_macros;
          define_macros;
 
 
          { startup scanner }
          { startup scanner }
+{$ifndef UseTokenInfo}
          token:=yylex;
          token:=yylex;
+{$else UseTokenInfo}
+         tokeninfo:=yylex;
+         token:=tokeninfo^.token;
+{$endif UseTokenInfo}
 
 
          { init asm writing }
          { init asm writing }
          datasegment:=new(paasmoutput,init);
          datasegment:=new(paasmoutput,init);
@@ -323,11 +334,11 @@ unit parser;
               readconstdefs;
               readconstdefs;
               { we could try to overload caret by default }
               { we could try to overload caret by default }
               symtablestack:=systemunit;
               symtablestack:=systemunit;
-              { if POWER is defined in the RTL then use it for caret overloading }
+              { if POWER is defined in the RTL then use it for starstar overloading }
               getsym('POWER',false);
               getsym('POWER',false);
               if assigned(srsym) and (srsym^.typ=procsym) and
               if assigned(srsym) and (srsym^.typ=procsym) and
-                 (overloaded_operators[CARET]=nil) then
-                overloaded_operators[CARET]:=pprocsym(srsym);
+                 (overloaded_operators[STARSTAR]=nil) then
+                overloaded_operators[STARSTAR]:=pprocsym(srsym);
            end
            end
          else
          else
            begin
            begin
@@ -471,6 +482,9 @@ done:
          { restore scanner state }
          { restore scanner state }
          pattern:=oldpattern;
          pattern:=oldpattern;
          token:=oldtoken;
          token:=oldtoken;
+{$ifdef UseTokenInfo}
+         tokeninfo:=oldtokeninfo;
+{$endif UseTokenInfo}
          orgpattern:=oldorgpattern;
          orgpattern:=oldorgpattern;
          block_type:=old_block_type;
          block_type:=old_block_type;
 
 
@@ -525,7 +539,15 @@ done:
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.7  1998-04-27 23:10:28  peter
+  Revision 1.8  1998-04-29 10:33:55  pierre
+    + added some code for ansistring (not complete nor working yet)
+    * corrected operator overloading
+    * corrected nasm output
+    + started inline procedures
+    + added starstarn : use ** for exponentiation (^ gave problems)
+    + started UseTokenInfo cond to get accurate positions
+
+  Revision 1.7  1998/04/27 23:10:28  peter
     + new scanner
     + new scanner
     * $makelib -> if smartlink
     * $makelib -> if smartlink
     * small filename fixes pmodule.setfilename
     * small filename fixes pmodule.setfilename

+ 269 - 56
compiler/pass_1.pas

@@ -590,7 +590,12 @@ unit pass_1;
          resultset : pconstset;
          resultset : pconstset;
          i : longint;
          i : longint;
          b : boolean;
          b : boolean;
+{$ifndef UseAnsiString}
          s1,s2:^string;
          s1,s2:^string;
+{$else UseAnsiString}
+         s1,s2 : pchar;
+         l1,l2 : longint;
+{$endif UseAnsiString}
 
 
          { this totally forgets to set the pi_do_call flag !! }
          { this totally forgets to set the pi_do_call flag !! }
       label
       label
@@ -600,25 +605,27 @@ unit pass_1;
          { first do the two subtrees }
          { first do the two subtrees }
          firstpass(p^.left);
          firstpass(p^.left);
          firstpass(p^.right);
          firstpass(p^.right);
+         lt:=p^.left^.treetype;
+         rt:=p^.right^.treetype;
+         rd:=p^.right^.resulttype;
+         ld:=p^.left^.resulttype;
 
 
          if codegenerror then
          if codegenerror then
            exit;
            exit;
 
 
-         new(s1);
-         new(s2);
          { overloaded operator ? }
          { overloaded operator ? }
          if (p^.treetype=caretn) or
          if (p^.treetype=caretn) or
-            (p^.left^.resulttype^.deftype=recorddef) or
+            (ld^.deftype=recorddef) or
             { <> and = are defined for classes }
             { <> and = are defined for classes }
-            ((p^.left^.resulttype^.deftype=objectdef) and
-             (not(pobjectdef(p^.left^.resulttype)^.isclass) or
+            ((ld^.deftype=objectdef) and
+             (not(pobjectdef(ld)^.isclass) or
               not(p^.treetype in [equaln,unequaln])
               not(p^.treetype in [equaln,unequaln])
              )
              )
             ) or
             ) or
-            (p^.right^.resulttype^.deftype=recorddef) or
+            (rd^.deftype=recorddef) or
             { <> and = are defined for classes }
             { <> and = are defined for classes }
-            ((p^.right^.resulttype^.deftype=objectdef) and
-             (not(pobjectdef(p^.right^.resulttype)^.isclass) or
+            ((rd^.deftype=objectdef) and
+             (not(pobjectdef(rd)^.isclass) or
               not(p^.treetype in [equaln,unequaln])
               not(p^.treetype in [equaln,unequaln])
              )
              )
             ) then
             ) then
@@ -633,8 +640,8 @@ unit pass_1;
                    t:=gencallnode(overloaded_operators[minus],nil);
                    t:=gencallnode(overloaded_operators[minus],nil);
                  muln:
                  muln:
                    t:=gencallnode(overloaded_operators[star],nil);
                    t:=gencallnode(overloaded_operators[star],nil);
-                 caretn:
-                   t:=gencallnode(overloaded_operators[caret],nil);
+                 starstarn:
+                   t:=gencallnode(overloaded_operators[starstar],nil);
                  slashn:
                  slashn:
                    t:=gencallnode(overloaded_operators[slash],nil);
                    t:=gencallnode(overloaded_operators[slash],nil);
                  ltn:
                  ltn:
@@ -657,8 +664,6 @@ unit pass_1;
                Message(parser_e_operator_not_overloaded);
                Message(parser_e_operator_not_overloaded);
               if p^.treetype=unequaln then
               if p^.treetype=unequaln then
                t:=gensinglenode(notn,t);
                t:=gensinglenode(notn,t);
-              dispose(s1);
-              dispose(s2);
               firstpass(t);
               firstpass(t);
               putnode(p);
               putnode(p);
               p:=t;
               p:=t;
@@ -666,8 +671,6 @@ unit pass_1;
            end;
            end;
          no_overload:
          no_overload:
          { compact consts }
          { compact consts }
-         lt:=p^.left^.treetype;
-         rt:=p^.right^.treetype;
 
 
          { convert int consts to real consts, if the }
          { convert int consts to real consts, if the }
          { other operand is a real const             }
          { other operand is a real const             }
@@ -728,8 +731,6 @@ unit pass_1;
                    Message(sym_e_type_mismatch);
                    Message(sym_e_type_mismatch);
                 end;
                 end;
               disposetree(p);
               disposetree(p);
-              dispose(s1);
-              dispose(s2);
               p:=t;
               p:=t;
               exit;
               exit;
               end
               end
@@ -767,48 +768,85 @@ unit pass_1;
               end;
               end;
               disposetree(p);
               disposetree(p);
               p:=t;
               p:=t;
-              dispose(s1);
-              dispose(s2);
               firstpass(p);
               firstpass(p);
               exit;
               exit;
            end;
            end;
          concatstrings:=false;
          concatstrings:=false;
+{$ifdef UseAnsiString}
+         s1:=nil;
+         s2:=nil;
+{$else UseAnsiString}
+         new(s1);
+         new(s2);
+{$endif UseAnsiString}
          if (lt=ordconstn) and (rt=ordconstn) and
          if (lt=ordconstn) and (rt=ordconstn) and
-           (p^.left^.resulttype^.deftype=orddef) and
-           (porddef(p^.left^.resulttype)^.typ=uchar) and
-           (p^.right^.resulttype^.deftype=orddef) and
-           (porddef(p^.right^.resulttype)^.typ=uchar) then
+           (ld^.deftype=orddef) and
+           (porddef(ld)^.typ=uchar) and
+           (rd^.deftype=orddef) and
+           (porddef(rd)^.typ=uchar) then
            begin
            begin
+{$ifdef UseAnsiString}
+              s1:=strpnew(char(byte(p^.left^.value)));
+              s2:=strpnew(char(byte(p^.right^.value)));
+              l1:=1;l2:=1;
+{$else UseAnsiString}
               s1^:=char(byte(p^.left^.value));
               s1^:=char(byte(p^.left^.value));
               s2^:=char(byte(p^.right^.value));
               s2^:=char(byte(p^.right^.value));
               concatstrings:=true;
               concatstrings:=true;
+{$endif UseAnsiString}
            end
            end
          else if (lt=stringconstn) and (rt=ordconstn) and
          else if (lt=stringconstn) and (rt=ordconstn) and
-           (p^.right^.resulttype^.deftype=orddef) and
-           (porddef(p^.right^.resulttype)^.typ=uchar) then
+           (rd^.deftype=orddef) and
+           (porddef(rd)^.typ=uchar) then
            begin
            begin
-              s1^:=Pstring(p^.left^.value)^;
+{$ifdef UseAnsiString}
+              { here there is allways the damn #0 problem !! }
+              s1:=getpcharcopy(p^.left);
+              l1:=p^.left^.length;
+              s2:=strpnew(char(byte(p^.right^.value)));
+              l2:=1;
+{$else UseAnsiString}
+              s1^:=p^.left^.values^;
               s2^:=char(byte(p^.right^.value));
               s2^:=char(byte(p^.right^.value));
               concatstrings:=true;
               concatstrings:=true;
+{$endif UseAnsiString}
            end
            end
          else if (lt=ordconstn) and (rt=stringconstn) and
          else if (lt=ordconstn) and (rt=stringconstn) and
-           (p^.left^.resulttype^.deftype=orddef) and
-           (porddef(p^.left^.resulttype)^.typ=uchar) then
+           (ld^.deftype=orddef) and
+           (porddef(ld)^.typ=uchar) then
            begin
            begin
+{$ifdef UseAnsiString}
+              { here there is allways the damn #0 problem !! }
+              s1:=strpnew(char(byte(p^.left^.value)));
+              l1:=1;
+              s2:=getpcharcopy(p^.right);
+              l2:=p^.right^.length;
+{$else UseAnsiString}
               s1^:=char(byte(p^.left^.value));
               s1^:=char(byte(p^.left^.value));
-              s2^:=pstring(p^.right^.value)^;
+              s2^:=p^.right^.values^;
               concatstrings:=true;
               concatstrings:=true;
+{$endif UseAnsiString}
            end
            end
          else if (lt=stringconstn) and (rt=stringconstn) then
          else if (lt=stringconstn) and (rt=stringconstn) then
            begin
            begin
-              s1^:=pstring(p^.left^.value)^;
-              s2^:=pstring(p^.right^.value)^;
+{$ifdef UseAnsiString}
+              s1:=getpcharcopy(p^.left);
+              l1:=p^.left^.length;
+              s2:=getpcharcopy(p^.right);
+              l2:=p^.right^.length;
+              concatstrings:=true;
+{$else UseAnsiString}
+              s1^:=p^.left^.values^;
+              s2^:=p^.right^.values^;
               concatstrings:=true;
               concatstrings:=true;
+{$endif UseAnsiString}
            end;
            end;
 
 
+         { I will need to translate all this to ansistrings !!! }
          if concatstrings then
          if concatstrings then
            begin
            begin
               case p^.treetype of
               case p^.treetype of
+{$ifndef UseAnsiString}
                  addn : t:=genstringconstnode(s1^+s2^);
                  addn : t:=genstringconstnode(s1^+s2^);
                  ltn : t:=genordinalconstnode(byte(s1^<s2^),booldef);
                  ltn : t:=genordinalconstnode(byte(s1^<s2^),booldef);
                  lten : t:=genordinalconstnode(byte(s1^<=s2^),booldef);
                  lten : t:=genordinalconstnode(byte(s1^<=s2^),booldef);
@@ -816,17 +854,41 @@ unit pass_1;
                  gten : t:=genordinalconstnode(byte(s1^>=s2^),booldef);
                  gten : t:=genordinalconstnode(byte(s1^>=s2^),booldef);
                  equaln : t:=genordinalconstnode(byte(s1^=s2^),booldef);
                  equaln : t:=genordinalconstnode(byte(s1^=s2^),booldef);
                  unequaln : t:=genordinalconstnode(byte(s1^<>s2^),booldef);
                  unequaln : t:=genordinalconstnode(byte(s1^<>s2^),booldef);
+{$else UseAnsiString}
+                 addn : t:=genpcharconstnode(
+                             concatansistrings(s1,s2,l1,l2),l1+l2);
+                 ltn : t:=genordinalconstnode(
+                           byte(compareansistrings(s1,s2,l1,l2)<0),booldef);
+                 lten : t:=genordinalconstnode(
+                            byte(compareansistrings(s1,s2,l1,l2)<=0),booldef);
+                 gtn : t:=genordinalconstnode(
+                            byte(compareansistrings(s1,s2,l1,l2)>0),booldef);
+                 gten : t:=genordinalconstnode(
+                             byte(compareansistrings(s1,s2,l1,l2)>=0),booldef);
+                 equaln : t:=genordinalconstnode(
+                               byte(compareansistrings(s1,s2,l1,l2)=0),booldef);
+                 unequaln : t:=genordinalconstnode(
+                                 byte(compareansistrings(s1,s2,l1,l2)<>0),booldef);
+{$endif UseAnsiString}
               end;
               end;
+{$ifdef UseAnsiString}
+              ansistringdispose(s1,l1);
+              ansistringdispose(s2,l2);
+{$else UseAnsiString}
               dispose(s1);
               dispose(s1);
               dispose(s2);
               dispose(s2);
+{$endif UseAnsiString}
               disposetree(p);
               disposetree(p);
               p:=t;
               p:=t;
               exit;
               exit;
            end;
            end;
-         rd:=p^.right^.resulttype;
-         ld:=p^.left^.resulttype;
+{$ifdef UseAnsiString}
+         ansistringdispose(s1,l1);
+         ansistringdispose(s2,l2);
+{$else UseAnsiString}
          dispose(s1);
          dispose(s1);
          dispose(s2);
          dispose(s2);
+{$endif UseAnsiString}
 
 
          { we can set this globally but it not allways true }
          { we can set this globally but it not allways true }
          { procinfo.flags:=procinfo.flags or pi_do_call;    }
          { procinfo.flags:=procinfo.flags or pi_do_call;    }
@@ -909,8 +971,9 @@ unit pass_1;
                 end;
                 end;
                 if not(is_equal(rd,ld)) then
                 if not(is_equal(rd,ld)) then
                  Message(sym_e_set_element_are_not_comp);
                  Message(sym_e_set_element_are_not_comp);
+                { why here its is alredy in entry of firstadd
                 firstpass(p^.left);
                 firstpass(p^.left);
-                firstpass(p^.right);
+                firstpass(p^.right); }
                 { do constant evalution }
                 { do constant evalution }
                 { set constructor ? }
                 { set constructor ? }
                 if (p^.right^.treetype=setconstrn) and
                 if (p^.right^.treetype=setconstrn) and
@@ -1235,7 +1298,17 @@ unit pass_1;
                  { the result of a string addition is a string of length 255 }
                  { the result of a string addition is a string of length 255 }
                  if (p^.left^.resulttype^.deftype=stringdef) or
                  if (p^.left^.resulttype^.deftype=stringdef) or
                     (p^.right^.resulttype^.deftype=stringdef) then
                     (p^.right^.resulttype^.deftype=stringdef) then
+                   begin
+{$ifndef UseAnsiString}
                    p^.resulttype:=cstringdef
                    p^.resulttype:=cstringdef
+{$else UseAnsiString}
+                      if is_ansistring(p^.left^.resulttype) or
+                         is_ansistring(p^.right^.resulttype) then
+                        p^.resulttype:=cansistringdef
+                      else
+                        p^.resulttype:=cstringdef;
+{$endif UseAnsiString}
+                   end
                  else
                  else
                    p^.resulttype:=p^.left^.resulttype;
                    p^.resulttype:=p^.left^.resulttype;
               end;
               end;
@@ -1394,7 +1467,7 @@ unit pass_1;
            { nasm can not cope with negativ reals !! }
            { nasm can not cope with negativ reals !! }
          if is_constrealnode(p^.left)
          if is_constrealnode(p^.left)
 {$ifdef i386}
 {$ifdef i386}
-         and (current_module^.output_format<>of_nasm)
+         and not(current_module^.output_format in [of_nasm,of_obj])
 {$endif}
 {$endif}
            then
            then
            begin
            begin
@@ -1653,6 +1726,8 @@ unit pass_1;
          { assignements to open arrays aren't allowed }
          { assignements to open arrays aren't allowed }
          if is_open_array(p^.left^.resulttype) then
          if is_open_array(p^.left^.resulttype) then
            Message(sym_e_type_mismatch);
            Message(sym_e_type_mismatch);
+         { test if we can avoid copying string to temp
+           as in s:=s+...; (PM) }
 {$ifdef dummyi386}
 {$ifdef dummyi386}
          if ((p^.right^.treetype=addn) or (p^.right^.treetype=subn)) and
          if ((p^.right^.treetype=addn) or (p^.right^.treetype=subn)) and
             equal_trees(p^.left,p^.right^.left) and
             equal_trees(p^.left,p^.right^.left) and
@@ -1686,7 +1761,8 @@ unit pass_1;
          if codegenerror then
          if codegenerror then
            exit;
            exit;
 
 
-       { some string functions don't need conversion, so treat them separatly }
+         { some string functions don't need conversion, so treat them separatly }
+
          if (p^.left^.resulttype^.deftype=stringdef) and (assigned(p^.right^.resulttype)) then
          if (p^.left^.resulttype^.deftype=stringdef) and (assigned(p^.right^.resulttype)) then
           begin
           begin
             if not (p^.right^.resulttype^.deftype in [stringdef,orddef]) then
             if not (p^.right^.resulttype^.deftype in [stringdef,orddef]) then
@@ -1696,8 +1772,24 @@ unit pass_1;
                if codegenerror then
                if codegenerror then
                 exit;
                 exit;
              end;
              end;
-          { we call STRCOPY }
+            { we call STRCOPY }
             procinfo.flags:=procinfo.flags or pi_do_call;
             procinfo.flags:=procinfo.flags or pi_do_call;
+            hp:=p^.right;
+            { test for s:=s+anything ... }
+            { the problem is for
+              s:=s+s+s;
+              this is broken here !! }
+            { while hp^.treetype=addn do hp:=hp^.left;
+            if equal_trees(p^.left,hp) then
+              begin
+                p^.concat_string:=true;
+                hp:=p^.right;
+                while hp^.treetype=addn do
+                  begin
+                    hp^.use_strconcat:=true;
+                    hp:=hp^.left;
+                  end;
+              end; }
           end
           end
          else
          else
           begin
           begin
@@ -1902,15 +1994,16 @@ unit pass_1;
 
 
     procedure first_string_string(var p : ptree);
     procedure first_string_string(var p : ptree);
 
 
-      var l : longint;
-
            begin
            begin
-                   if p^.left^.treetype=stringconstn then
-                     l:=length(pstring(p^.left^.value)^)
-                   else
-                     l:=pstringdef(p^.left^.resulttype)^.len;
-                   if l<>parraydef(p^.resulttype)^.highrange-parraydef(p^.resulttype)^.lowrange+1 then
-                     Message(sym_e_type_mismatch);
+              if pstringdef(p^.resulttype)^.string_typ<>
+                 pstringdef(p^.left^.resulttype)^.string_typ then
+                begin
+                   { call shortstring_to_ansistring or ansistring_to_shortstring }
+                   procinfo.flags:=procinfo.flags or pi_do_call;
+                end;
+              { for simplicity lets first keep all ansistrings
+                as LOC_MEM, could also become LOC_REGISTER }
+              p^.location.loc:=LOC_MEM;
            end;
            end;
 
 
     procedure first_char_to_string(var p : ptree);
     procedure first_char_to_string(var p : ptree);
@@ -2163,7 +2256,7 @@ unit pass_1;
          tfirstconvproc = (first_bigger_smaller,first_nothing,first_bigger_smaller,
          tfirstconvproc = (first_bigger_smaller,first_nothing,first_bigger_smaller,
                            first_bigger_smaller,first_bigger_smaller,
                            first_bigger_smaller,first_bigger_smaller,
                            first_bigger_smaller,first_bigger_smaller,
                            first_bigger_smaller,first_bigger_smaller,
-                           first_bigger_smaller,first_locmem,
+                           first_bigger_smaller,first_string_string,
                            first_cstring_charpointer,first_string_chararray,
                            first_cstring_charpointer,first_string_chararray,
                            first_array_to_pointer,first_pointer_to_array,
                            first_array_to_pointer,first_pointer_to_array,
                            first_char_to_string,first_bigger_smaller,
                            first_char_to_string,first_bigger_smaller,
@@ -2567,7 +2660,6 @@ unit pass_1;
          regi : tregister;
          regi : tregister;
          store_valid, old_count_ref : boolean;
          store_valid, old_count_ref : boolean;
 
 
-
       { types.is_equal can't handle a formaldef ! }
       { types.is_equal can't handle a formaldef ! }
       function is_equal(def1,def2 : pdef) : boolean;
       function is_equal(def1,def2 : pdef) : boolean;
 
 
@@ -2651,6 +2743,7 @@ unit pass_1;
               p^.procdefinition:=pprocdef(p^.right^.resulttype);
               p^.procdefinition:=pprocdef(p^.right^.resulttype);
            end
            end
          else
          else
+         { not a procedure variable }
            begin
            begin
               { determine the type of the parameters }
               { determine the type of the parameters }
               if assigned(p^.left) then
               if assigned(p^.left) then
@@ -2669,7 +2762,7 @@ unit pass_1;
               { do we know the procedure to call ? }
               { do we know the procedure to call ? }
               if not(assigned(p^.procdefinition)) then
               if not(assigned(p^.procdefinition)) then
                 begin
                 begin
-
+                   actprocsym:=p^.symtableprocentry;
                    { determine length of parameter list }
                    { determine length of parameter list }
                    pt:=p^.left;
                    pt:=p^.left;
                    paralength:=0;
                    paralength:=0;
@@ -2681,7 +2774,6 @@ unit pass_1;
 
 
                    { alle in Frage kommenden Prozeduren in eine }
                    { alle in Frage kommenden Prozeduren in eine }
                    { verkettete Liste einf�gen                  }
                    { verkettete Liste einf�gen                  }
-                   actprocsym:=p^.symtableprocentry;
                    pd:=actprocsym^.definition;
                    pd:=actprocsym^.definition;
                    while assigned(pd) do
                    while assigned(pd) do
                      begin
                      begin
@@ -2977,8 +3069,10 @@ unit pass_1;
      {$ifdef UseBrowser}
      {$ifdef UseBrowser}
                    add_new_ref(procs^.data^.lastref);
                    add_new_ref(procs^.data^.lastref);
      {$endif UseBrowser}
      {$endif UseBrowser}
+
                    p^.procdefinition:=procs^.data;
                    p^.procdefinition:=procs^.data;
                    p^.resulttype:=procs^.data^.retdef;
                    p^.resulttype:=procs^.data^.retdef;
+                   p^.symtableproc:=p^.procdefinition^.owner;
                    p^.location.loc:=LOC_MEM;
                    p^.location.loc:=LOC_MEM;
 {$ifdef CHAINPROCSYMS}
 {$ifdef CHAINPROCSYMS}
                    { object with method read;
                    { object with method read;
@@ -3031,6 +3125,21 @@ unit pass_1;
                 end
                 end
               else
               else
                 { no intern procedure => we do a call }
                 { no intern procedure => we do a call }
+              { handle predefined procedures }
+              if (p^.procdefinition^.options and poinline)<>0 then
+                begin
+                   if assigned(p^.methodpointer) then
+                     comment(v_fatal,'Unable to inline object methods');
+                   if assigned(p^.right) then
+                     comment(v_fatal,'Unable to inline procvar calls');
+                   { p^.treetype:=procinlinen; }
+                   if assigned(p^.procdefinition^.code) then
+                     p^.right:=genprocinlinenode(p,ptree(p^.procdefinition^.code))
+                   else
+                     comment(v_fatal,'no code for inline procedure stored');
+                   firstpass(p^.right);
+                end
+              else
                 procinfo.flags:=procinfo.flags or pi_do_call;
                 procinfo.flags:=procinfo.flags or pi_do_call;
 
 
               { calc the correture value for the register }
               { calc the correture value for the register }
@@ -3121,6 +3230,7 @@ unit pass_1;
            end;
            end;
 
 
          { determine the registers of the procedure variable }
          { determine the registers of the procedure variable }
+         { is this OK for inlined procs also ?? (PM)         }
          if assigned(p^.right) then
          if assigned(p^.right) then
            begin
            begin
               p^.registersfpu:=max(p^.right^.registersfpu,p^.registersfpu);
               p^.registersfpu:=max(p^.right^.registersfpu,p^.registersfpu);
@@ -3326,7 +3436,12 @@ unit pass_1;
                end;
                end;
              in_length_string:
              in_length_string:
                begin
                begin
-                  p^.resulttype:=u8bitdef;
+{$ifdef UseAnsiString}
+                  if is_ansistring(p^.left^.resulttype) then
+                    p^.resulttype:=s32bitdef
+                  else
+{$endif UseAnsiString}
+                    p^.resulttype:=u8bitdef;
                   { wer don't need string conversations here }
                   { wer don't need string conversations here }
                   if (p^.left^.treetype=typeconvn) and
                   if (p^.left^.treetype=typeconvn) and
                      (p^.left^.left^.resulttype^.deftype=stringdef) then
                      (p^.left^.left^.resulttype^.deftype=stringdef) then
@@ -4520,19 +4635,98 @@ unit pass_1;
            end;
            end;
       end;
       end;
 
 
-{    procedure firstprocinline(var p : ptree);
-      var old_inline_proc_firsttemp : longint;
+    procedure firstprocinline(var p : ptree);
 
 
       begin
       begin
-         old_inline_proc_firsttemp:=procinfo.firsttemp;
-         procinfo.firsttemp:=procinfo.firsttemp+p^.inlineproc^.definition^.localst^.datasize;
-      end; }
+          {left contains the code in tree form }
+          { but it has already been firstpassed }
+          { so firstpass(p^.left); does not seem required }
+          { might be required later if we change the arg handling !! }
+      end;
 
 
     type
     type
        firstpassproc = procedure(var p : ptree);
        firstpassproc = procedure(var p : ptree);
 
 
     procedure firstpass(var p : ptree);
     procedure firstpass(var p : ptree);
 
 
+(*       ttreetyp = (addn,            {Represents the + operator.}
+                   muln,            {Represents the * operator.}
+                   subn,            {Represents the - operator.}
+                   divn,            {Represents the div operator.}
+                   symdifn,         {Represents the >< operator.}
+                   modn,            {Represents the mod operator.}
+                   assignn,         {Represents an assignment.}
+                   loadn,           {Represents the use of a variabele.}
+                   rangen,          {Represents a range (i.e. 0..9).}
+                   ltn,             {Represents the < operator.}
+                   lten,            {Represents the <= operator.}
+                   gtn,             {Represents the > operator.}
+                   gten,            {Represents the >= operator.}
+                   equaln,          {Represents the = operator.}
+                   unequaln,        {Represents the <> operator.}
+                   inn,             {Represents the in operator.}
+                   orn,             {Represents the or operator.}
+                   xorn,            {Represents the xor operator.}
+                   shrn,            {Represents the shr operator.}
+                   shln,            {Represents the shl operator.}
+                   slashn,          {Represents the / operator.}
+                   andn,            {Represents the and operator.}
+                   subscriptn,      {??? Field in a record/object?}
+                   derefn,          {Dereferences a pointer.}
+                   addrn,           {Represents the @ operator.}
+                   doubleaddrn,     {Represents the @@ operator.}
+                   ordconstn,       {Represents an ordinal value.}
+                   typeconvn,       {Represents type-conversion/typecast.}
+                   calln,           {Represents a call node.}
+                   callparan,       {Represents a parameter.}
+                   realconstn,      {Represents a real value.}
+                   fixconstn,       {Represents a fixed value.}
+                   umminusn,        {Represents a sign change (i.e. -2).}
+                   asmn,            {Represents an assembler node }
+                   vecn,            {Represents array indexing.}
+                   stringconstn,    {Represents a string constant.}
+                   funcretn,        {Represents the function result var.}
+                   selfn,           {Represents the self parameter.}
+                   notn,            {Represents the not operator.}
+                   inlinen,         {Internal procedures (i.e. writeln).}
+                   niln,            {Represents the nil pointer.}
+                   errorn,          {This part of the tree could not be
+                                     parsed because of a compiler error.}
+                   typen,           {A type name. Used for i.e. typeof(obj).}
+                   hnewn,           {The new operation, constructor call.}
+                   hdisposen,       {The dispose operation with destructor call.}
+                   newn,            {The new operation, constructor call.}
+                   simpledisposen,  {The dispose operation.}
+                   setelen,         {A set element (i.e. [a,b]).}
+                   setconstrn,      {A set constant (i.e. [1,2]).}
+                   blockn,          {A block of statements.}
+                   anwein,          {A linear list of nodes.}
+                   loopn,           { used in genloopnode, must be converted }
+                   ifn,             {An if statement.}
+                   breakn,          {A break statement.}
+                   continuen,       {A continue statement.}
+                   repeatn,         {A repeat until block.}
+                   whilen,          {A while do statement.}
+                   forn,            {A for loop.}
+                   exitn,           {An exit statement.}
+                   withn,           {A with statement.}
+                   casen,           {A case statement.}
+                   labeln,          {A label.}
+                   goton,           {A goto statement.}
+                   simplenewn,      {The new operation.}
+                   tryexceptn,      {A try except block.}
+                   raisen,          {A raise statement.}
+                   switchesn,       {??? Currently unused...}
+                   tryfinallyn,     {A try finally statement.}
+                   isn,             {Represents the is operator.}
+                   asn,             {Represents the as typecast.}
+                   caretn,          {Represents the ^ operator.}
+                   failn,           {Represents the fail statement.}
+                   starstarn,       {Represents the ** operator exponentiation }
+                   procinlinen,      {Procedures that can be inlined }
+                   { added for optimizations where we cannot suppress }
+                   nothingn,
+                   loadvmtn);       {???.} *)
       const
       const
          procedures : array[ttreetyp] of firstpassproc =
          procedures : array[ttreetyp] of firstpassproc =
             (firstadd,firstadd,firstadd,firstmoddiv,firstadd,
             (firstadd,firstadd,firstadd,firstmoddiv,firstadd,
@@ -4552,7 +4746,7 @@ unit pass_1;
              firstexitn,firstwith,firstcase,firstlabel,
              firstexitn,firstwith,firstcase,firstlabel,
              firstgoto,firstsimplenewdispose,firsttryexcept,firstraise,
              firstgoto,firstsimplenewdispose,firsttryexcept,firstraise,
              firstnothing,firsttryfinally,firstis,firstas,firstadd,
              firstnothing,firsttryfinally,firstis,firstas,firstadd,
-             firstnothing,firstnothing,firstloadvmt);
+             firstnothing,firstadd,firstprocinline,firstnothing,firstloadvmt);
 
 
       var
       var
          oldcodegenerror : boolean;
          oldcodegenerror : boolean;
@@ -4597,10 +4791,29 @@ unit pass_1;
          do_firstpass:=codegenerror;
          do_firstpass:=codegenerror;
       end;
       end;
 
 
+    { to be called only for a whole function }
+    { to insert code at entry and exit       }
+
+    function function_firstpass(var p : ptree) : boolean;
+
+      begin
+         codegenerror:=false;
+         firstpass(p);
+         function_firstpass:=codegenerror;
+      end;
+
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.12  1998-04-22 21:06:50  florian
+  Revision 1.13  1998-04-29 10:33:56  pierre
+    + added some code for ansistring (not complete nor working yet)
+    * corrected operator overloading
+    * corrected nasm output
+    + started inline procedures
+    + added starstarn : use ** for exponentiation (^ gave problems)
+    + started UseTokenInfo cond to get accurate positions
+
+  Revision 1.12  1998/04/22 21:06:50  florian
     * last fixes before the release:
     * last fixes before the release:
       - veryyyy slow firstcall fixed
       - veryyyy slow firstcall fixed
 
 

+ 50 - 3
compiler/pbase.pas

@@ -45,6 +45,9 @@ unit pbase;
     var
     var
        { contains the current token to be processes }
        { contains the current token to be processes }
        token : ttoken;
        token : ttoken;
+{$ifdef UseTokenInfo}
+       tokeninfo : ptokeninfo;
+{$endif UseTokenInfo}
 
 
        { size of data segment, set by proc_unit or proc_program }
        { size of data segment, set by proc_unit or proc_program }
        datasize : longint;
        datasize : longint;
@@ -102,7 +105,8 @@ unit pbase;
 
 
       { This is changed since I changed the order of token
       { This is changed since I changed the order of token
       in cobjects.pas for operator overloading !!!! }
       in cobjects.pas for operator overloading !!!! }
-      { ttoken = (PLUS,MINUS,STAR,SLASH,EQUAL,GT,LT,LTE,GTE,SYMDIF,CARET,ASSIGNMENT,
+      { ttoken = (PLUS,MINUS,STAR,SLASH,EQUAL,GT,
+                 LT,LTE,GTE,SYMDIF,STARSTAR,ASSIGNMENT,CARET,
                  LECKKLAMMER,RECKKLAMMER,
                  LECKKLAMMER,RECKKLAMMER,
                  POINT,COMMA,LKLAMMER,RKLAMMER,COLON,SEMICOLON,
                  POINT,COMMA,LKLAMMER,RKLAMMER,COLON,SEMICOLON,
                  KLAMMERAFFE,UNEQUAL,POINTPOINT,
                  KLAMMERAFFE,UNEQUAL,POINTPOINT,
@@ -111,7 +115,7 @@ unit pbase;
 
 
       const tokens : array[PLUS..DOUBLEADDR] of string[12] = (
       const tokens : array[PLUS..DOUBLEADDR] of string[12] = (
                  '+','-','*','/','=','>','<','>=','<=','is','as','in',
                  '+','-','*','/','=','>','<','>=','<=','is','as','in',
-                 '><','^',':=','<>','[',']','.',',','(',')',':',';',
+                 '><','**',':=','^','<>','[',']','.',',','(',')',':',';',
                  '@','..',
                  '@','..',
                  'identifier','const real.','end of file',
                  'identifier','const real.','end of file',
                  'ord const','const string','const char','@@');
                  'ord const','const string','const char','@@');
@@ -120,6 +124,7 @@ unit pbase;
          j : integer;
          j : integer;
 
 
       begin
       begin
+{$ifndef UseTokenInfo}
          if token<>i then
          if token<>i then
            begin
            begin
               if i<_AND then
               if i<_AND then
@@ -139,16 +144,50 @@ unit pbase;
            end
            end
          else
          else
            token:=yylex;
            token:=yylex;
+{$else UseTokenInfo}
+         if token<>i then
+           begin
+              if i<_AND then
+                syntaxerror(tokens[i])
+              else
+                begin
+
+                   { um die ProgrammgrӇe klein zu halten, }
+                   { wird f�r ein Schl�sselwort-Token der  }
+                   { "Text" in der Schl�sselworttabelle    }
+                   { des Scanners nachgeschaut             }
+
+                   for j:=1 to anz_keywords do
+                     if keyword_token[j]=i then
+                       syntaxerror(keyword[j])
+                end;
+           end
+         else
+           begin
+             if assigned(tokeninfo) then
+               dispose(tokeninfo);
+             tokeninfo:=yylex;
+             token:=tokeninfo^.token;
+           end;
+{$endif UseTokenInfo}
       end;
       end;
 
 
     procedure consume_all_until(atoken : ttoken);
     procedure consume_all_until(atoken : ttoken);
 
 
       begin
       begin
+{$ifndef UseTokenInfo}
+         while (token<>atoken) and (token<>_EOF) do
+           consume(token);
+         { this will create an error if the token is _EOF }
+         if token<>atoken then
+           consume(atoken);
+{$else UseTokenInfo}
          while (token<>atoken) and (token<>_EOF) do
          while (token<>atoken) and (token<>_EOF) do
            consume(token);
            consume(token);
          { this will create an error if the token is _EOF }
          { this will create an error if the token is _EOF }
          if token<>atoken then
          if token<>atoken then
            consume(atoken);
            consume(atoken);
+{$endif UseTokenInfo}
          { this error is fatal as we have read the whole file }
          { this error is fatal as we have read the whole file }
          Message(scan_f_end_of_file);
          Message(scan_f_end_of_file);
       end;
       end;
@@ -205,7 +244,15 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.2  1998-04-07 22:45:05  florian
+  Revision 1.3  1998-04-29 10:33:57  pierre
+    + added some code for ansistring (not complete nor working yet)
+    * corrected operator overloading
+    * corrected nasm output
+    + started inline procedures
+    + added starstarn : use ** for exponentiation (^ gave problems)
+    + started UseTokenInfo cond to get accurate positions
+
+  Revision 1.2  1998/04/07 22:45:05  florian
     * bug0092, bug0115 and bug0121 fixed
     * bug0092, bug0115 and bug0121 fixed
     + packed object/class/array
     + packed object/class/array
 
 

+ 20 - 7
compiler/pdecl.pas

@@ -80,6 +80,7 @@ unit pdecl;
          name : stringid;
          name : stringid;
          p : ptree;
          p : ptree;
          def : pdef;
          def : pdef;
+         sym : psym;
          ps : pconstset;
          ps : pconstset;
          pd : pdouble;
          pd : pdouble;
 
 
@@ -136,9 +137,10 @@ unit pdecl;
                    def:=read_type('');
                    def:=read_type('');
                    block_type:=bt_general;
                    block_type:=bt_general;
                    ignore_equal:=false;
                    ignore_equal:=false;
-                   symtablestack^.insert(new(ptypedconstsym,init(name,def)));
+                   sym:=new(ptypedconstsym,init(name,def));
+                   symtablestack^.insert(sym);
                    consume(EQUAL);
                    consume(EQUAL);
-                   readtypedconst(def);
+                   readtypedconst(def,ptypedconstsym(sym));
                    consume(SEMICOLON);
                    consume(SEMICOLON);
                 end;
                 end;
               else consume(EQUAL);
               else consume(EQUAL);
@@ -187,7 +189,7 @@ unit pdecl;
               do_firstpass(p);
               do_firstpass(p);
               if not is_constintnode(p) then
               if not is_constintnode(p) then
                 Message(cg_e_illegal_expression);
                 Message(cg_e_illegal_expression);
-{$ifndef UseLongString}
+{$ifndef UseAnsiString}
               if (p^.value<1) or (p^.value>255) then
               if (p^.value<1) or (p^.value>255) then
                 begin
                 begin
                    Message(parser_e_string_too_long);
                    Message(parser_e_string_too_long);
@@ -201,9 +203,9 @@ unit pdecl;
 {$else * GDB *}
 {$else * GDB *}
                  else d:=globaldef('SYSTEM.STRING');
                  else d:=globaldef('SYSTEM.STRING');
 {$endif * GDB *}
 {$endif * GDB *}
-{$else UseLongString}
+{$else UseAnsiString}
               if p^.value>255 then
               if p^.value>255 then
-                d:=new(pstringdef,longinit(p^.value)
+                d:=new(pstringdef,ansiinit(p^.value))
               else if p^.value<>255 then
               else if p^.value<>255 then
                 d:=new(pstringdef,init(p^.value))
                 d:=new(pstringdef,init(p^.value))
 {$ifndef GDB}
 {$ifndef GDB}
@@ -211,9 +213,12 @@ unit pdecl;
 {$else * GDB *}
 {$else * GDB *}
                  else d:=globaldef('SYSTEM.STRING');
                  else d:=globaldef('SYSTEM.STRING');
 {$endif * GDB *}
 {$endif * GDB *}
-{$endif UseLongString}
+              consume(RECKKLAMMER);
+{$endif UseAnsiString}
               disposetree(p);
               disposetree(p);
            end
            end
+           { should string bwithout suffix be an ansistring also
+             in ansistring mode ?? (PM) }
 {$ifndef GDB}
 {$ifndef GDB}
                  else d:=new(pstringdef,init(255));
                  else d:=new(pstringdef,init(255));
 {$else * GDB *}
 {$else * GDB *}
@@ -1753,7 +1758,15 @@ unit pdecl;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.11  1998-04-28 11:45:52  florian
+  Revision 1.12  1998-04-29 10:33:57  pierre
+    + added some code for ansistring (not complete nor working yet)
+    * corrected operator overloading
+    * corrected nasm output
+    + started inline procedures
+    + added starstarn : use ** for exponentiation (^ gave problems)
+    + started UseTokenInfo cond to get accurate positions
+
+  Revision 1.11  1998/04/28 11:45:52  florian
     * make it compilable with TP
     * make it compilable with TP
     + small COM problems solved to compile classes.pp
     + small COM problems solved to compile classes.pp
 
 

+ 12 - 4
compiler/pexpr.pas

@@ -913,7 +913,7 @@ unit pexpr;
                        if assigned(aktprocsym) and
                        if assigned(aktprocsym) and
                         ((srsym^.name=aktprocsym^.name) or
                         ((srsym^.name=aktprocsym^.name) or
                         ((pvarsym(srsym)=opsym) and
                         ((pvarsym(srsym)=opsym) and
-                        ((pprocdef(aktprocsym^.definition)^.options and pooperator)<>0))) and
+                        ((procinfo.flags and pi_operator)<>0))) and
                         (procinfo.retdef<>pdef(voiddef)) and
                         (procinfo.retdef<>pdef(voiddef)) and
                         (token<>LKLAMMER) and
                         (token<>LKLAMMER) and
                         (not ((cs_tp_compatible in aktswitches) and
                         (not ((cs_tp_compatible in aktswitches) and
@@ -1464,7 +1464,7 @@ unit pexpr;
     const   tok2node:array[PLUS.._XOR] of Ttreetyp=
     const   tok2node:array[PLUS.._XOR] of Ttreetyp=
                     (addn,subn,muln,slashn,equaln,gtn,ltn,gten,lten,
                     (addn,subn,muln,slashn,equaln,gtn,ltn,gten,lten,
                      isn,asn,inn,
                      isn,asn,inn,
-                     nothingn,caretn,nothingn,unequaln,nothingn,
+                     symdifn,starstarn,nothingn,caretn,unequaln,nothingn,
                      nothingn,nothingn,nothingn,nothingn,nothingn,
                      nothingn,nothingn,nothingn,nothingn,nothingn,
                      nothingn,nothingn,nothingn,nothingn,nothingn,
                      nothingn,nothingn,nothingn,nothingn,nothingn,
                      nothingn,nothingn,nothingn,nothingn,nothingn,
                      nothingn,nothingn,nothingn,nothingn,nothingn,
@@ -1484,7 +1484,7 @@ unit pexpr;
             operator_levels:array[Toperator_precedence] of set of Ttoken=
             operator_levels:array[Toperator_precedence] of set of Ttoken=
                     ([LT,LTE,GT,GTE,EQUAL,UNEQUAL,_IN,_IS],
                     ([LT,LTE,GT,GTE,EQUAL,UNEQUAL,_IN,_IS],
                      [PLUS,MINUS,_OR,_XOR],
                      [PLUS,MINUS,_OR,_XOR],
-                     [CARET,SYMDIF,STAR,SLASH,_DIV,_MOD,_AND,_SHL,_SHR,_AS]);
+                     [CARET,SYMDIF,STARSTAR,STAR,SLASH,_DIV,_MOD,_AND,_SHL,_SHR,_AS]);
 
 
     function sub_expr(pred_level:Toperator_precedence;accept_equal : boolean):Ptree;
     function sub_expr(pred_level:Toperator_precedence;accept_equal : boolean):Ptree;
 
 
@@ -1640,7 +1640,15 @@ unit pexpr;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.8  1998-04-14 23:27:03  florian
+  Revision 1.9  1998-04-29 10:33:58  pierre
+    + added some code for ansistring (not complete nor working yet)
+    * corrected operator overloading
+    * corrected nasm output
+    + started inline procedures
+    + added starstarn : use ** for exponentiation (^ gave problems)
+    + started UseTokenInfo cond to get accurate positions
+
+  Revision 1.8  1998/04/14 23:27:03  florian
     + exclude/include with constant second parameter added
     + exclude/include with constant second parameter added
 
 
   Revision 1.7  1998/04/09 23:02:15  florian
   Revision 1.7  1998/04/09 23:02:15  florian

+ 127 - 86
compiler/pmodules.pas

@@ -60,6 +60,8 @@ unit pmodules;
 
 
     {$I innr.inc}
     {$I innr.inc}
 
 
+    { all intern procedures for system unit }
+
     procedure insertinternsyms(p : psymtable);
     procedure insertinternsyms(p : psymtable);
 
 
       begin
       begin
@@ -87,6 +89,102 @@ unit pmodules;
          p^.insert(new(psyssym,init('STR',in_str_x_string)));
          p^.insert(new(psyssym,init('STR',in_str_x_string)));
       end;
       end;
 
 
+    { all the types inserted into the system unit }
+    procedure insert_intern_types(p : psymtable);
+{$ifdef GDB}
+      var
+         { several defs to simulate more or less C++ objects for GDB }
+         vmtdef : precdef;
+         pvmtdef : ppointerdef;
+         vmtarraydef : parraydef;
+         vmtsymtable : psymtable;
+{$endif GDB}
+
+      begin
+         p^.insert(new(ptypesym,init('longint',s32bitdef)));
+         p^.insert(new(ptypesym,init('ulong',u32bitdef)));
+         p^.insert(new(ptypesym,init('void',voiddef)));
+         p^.insert(new(ptypesym,init('char',cchardef)));
+{$ifdef i386}
+         p^.insert(new(ptypesym,init('s64real',c64floatdef)));
+{$endif i386}
+         p^.insert(new(ptypesym,init('s80real',s80floatdef)));
+         p^.insert(new(ptypesym,init('cs32fixed',s32fixeddef)));
+         p^.insert(new(ptypesym,init('byte',u8bitdef)));
+         p^.insert(new(ptypesym,init('string',cstringdef)));
+{$ifdef UseLongString}
+         p^.insert(new(ptypesym,init('longstring',clongstringdef)));
+{$endif UseLongString}
+{$ifdef UseAnsiString}
+         p^.insert(new(ptypesym,init('ansistring',cansistringdef)));
+{$endif UseAnsiString}
+         p^.insert(new(ptypesym,init('word',u16bitdef)));
+         p^.insert(new(ptypesym,init('boolean',booldef)));
+         p^.insert(new(ptypesym,init('void_pointer',voidpointerdef)));
+         p^.insert(new(ptypesym,init('file',cfiledef)));
+{$ifdef i386}
+         p^.insert(new(ptypesym,init('REAL',new(pfloatdef,init(s64real)))));
+         p^.insert(new(ptypesym,init('COMP',new(pfloatdef,init(s64bit)))));
+         p^.insert(new(ptypesym,init('EXTENDED',new(pfloatdef,init(s80real)))));
+{$endif}
+{$ifdef m68k}
+         { internal definitions }
+         p^.insert(new(ptypesym,init('s32real',c64floatdef)));
+         { mappings... }
+         p^.insert(new(ptypesym,init('REAL',new(pfloatdef,init(s32real)))));
+         if (cs_fp_emulation) in aktswitches then
+              p^.insert(new(ptypesym,init('DOUBLE',new(pfloatdef,init(s32real)))))
+         else
+              p^.insert(new(ptypesym,init('DOUBLE',new(pfloatdef,init(s64real)))));
+{              p^.insert(new(ptypesym,init('COMP',new(pfloatdef,init(s32real)))));}
+         if (cs_fp_emulation) in aktswitches then
+              p^.insert(new(ptypesym,init('EXTENDED',new(pfloatdef,init(s32real)))))
+         else
+              p^.insert(new(ptypesym,init('EXTENDED',new(pfloatdef,init(s80real)))));
+{$endif}
+         p^.insert(new(ptypesym,init('SINGLE',new(pfloatdef,init(s32real)))));
+         p^.insert(new(ptypesym,init('POINTER',new(ppointerdef,init(voiddef)))));
+         p^.insert(new(ptypesym,init('STRING',cstringdef)));
+{$ifdef UseLongString}
+         p^.insert(new(ptypesym,init('LONGSTRING',clongstringdef)));
+{$endif UseLongString}
+{$ifdef UseAnsiString}
+         p^.insert(new(ptypesym,init('ANSISTRING',cansistringdef)));
+{$endif UseAnsiString}
+         p^.insert(new(ptypesym,init('BOOLEAN',new(porddef,init(bool8bit,0,1)))));
+         p^.insert(new(ptypesym,init('CHAR',new(porddef,init(uchar,0,255)))));
+         p^.insert(new(ptypesym,init('TEXT',new(pfiledef,init(ft_text,nil)))));
+         p^.insert(new(ptypesym,init('CARDINAL',new(porddef,init(u32bit,0,$ffffffff)))));
+         p^.insert(new(ptypesym,init('FIXED',new(pfloatdef,init(f32bit)))));
+         p^.insert(new(ptypesym,init('FIXED16',new(pfloatdef,init(f16bit)))));
+         p^.insert(new(ptypesym,init('TYPEDFILE',new(pfiledef,init(ft_typed,voiddef)))));
+         { !!!!!
+         p^.insert(new(ptypesym,init('COMP',new(porddef,init(s64bit,0,0)))));
+         p^.insert(new(ptypesym,init('SINGLE',new(porddef,init(s32real,0,0)))));
+         p^.insert(new(ptypesym,init('EXTENDED',new(porddef,init(s80real,0,0)))));
+         p^.insert(new(ptypesym,init('FILE',new(pfiledef,init(ft_untyped,nil)))));
+         }
+         { Add a type for virtual method tables in lowercase }
+         { so it isn't reachable!                            }
+{$ifdef GDB}
+         vmtsymtable:=new(psymtable,init(recordsymtable));
+         vmtdef:=new(precdef,init(vmtsymtable));
+         pvmtdef:=new(ppointerdef,init(vmtdef));
+         vmtsymtable^.insert(new(pvarsym,init('parent',pvmtdef)));
+         vmtsymtable^.insert(new(pvarsym,init('length',globaldef('longint'))));
+         vmtsymtable^.insert(new(pvarsym,init('mlength',globaldef('longint'))));
+         vmtarraydef:=new(parraydef,init(0,1,s32bitdef));
+         vmtarraydef^.definition := voidpointerdef;
+         vmtsymtable^.insert(new(pvarsym,init('__pfn',vmtarraydef)));
+         p^.insert(new(ptypesym,init('__vtbl_ptr_type',vmtdef)));
+         p^.insert(new(ptypesym,init('pvmt',pvmtdef)));
+         vmtarraydef:=new(parraydef,init(0,1,s32bitdef));
+         vmtarraydef^.definition := pvmtdef;
+         p^.insert(new(ptypesym,init('vtblarray',vmtarraydef)));
+{$endif GDB}
+         insertinternsyms(p);
+      end;
+
     procedure load_ppu(hp : pmodule;compile_system : boolean);
     procedure load_ppu(hp : pmodule;compile_system : boolean);
 
 
       var
       var
@@ -115,8 +213,7 @@ unit pmodules;
               { if the crc of a used unit is the same as }
               { if the crc of a used unit is the same as }
               { written to the PPU file, we needn't to   }
               { written to the PPU file, we needn't to   }
               { recompile the current unit               }
               { recompile the current unit               }
-              if (loaded_unit^.crc<>checksum) or
-                 (do_build and loaded_unit^.sources_avail) then
+              if (loaded_unit^.crc<>checksum) then
                 begin
                 begin
                    { we have to compile the current unit }
                    { we have to compile the current unit }
                    { remove stuff which isn't needed     }
                    { remove stuff which isn't needed     }
@@ -126,7 +223,10 @@ unit pmodules;
                    hp^.ppufile^.close;
                    hp^.ppufile^.close;
                    dispose(hp^.ppufile,done);
                    dispose(hp^.ppufile,done);
                    hp^.ppufile:=nil;
                    hp^.ppufile:=nil;
-                   compile(hp^.mainsource^,compile_system);
+                   if not(hp^.sources_avail) then
+                    Message1(unit_f_cant_compile_unit,hp^.unitname^)
+                   else
+                    compile(hp^.mainsource^,compile_system);
                    exit;
                    exit;
                 end;
                 end;
               { setup the map entry for deref }
               { setup the map entry for deref }
@@ -167,7 +267,7 @@ unit pmodules;
               { but for the implementation part          }
               { but for the implementation part          }
               { the written crc is false, because        }
               { the written crc is false, because        }
               { not defined when writing the ppufile !!  }
               { not defined when writing the ppufile !!  }
-              if {(loaded_unit^.crc<>checksum) or}
+              (* if {(loaded_unit^.crc<>checksum) or}
                 (do_build and loaded_unit^.sources_avail) then
                 (do_build and loaded_unit^.sources_avail) then
                 begin
                 begin
                    { we have to compile the current unit }
                    { we have to compile the current unit }
@@ -178,9 +278,12 @@ unit pmodules;
                    hp^.ppufile^.close;
                    hp^.ppufile^.close;
                    dispose(hp^.ppufile,done);
                    dispose(hp^.ppufile,done);
                    hp^.ppufile:=nil;
                    hp^.ppufile:=nil;
-                   compile(hp^.mainsource^,compile_system);
+                   if not(hp^.sources_avail) then
+                    Message1(unit_f_cant_compile_unit,hp^.unitname^)
+                   else
+                     compile(hp^.mainsource^,compile_system);
                    exit;
                    exit;
-                end;
+                end; *)
               { read until ibend }
               { read until ibend }
               hp^.ppufile^.read_data(b,1,count);
               hp^.ppufile^.read_data(b,1,count);
            end;
            end;
@@ -411,15 +514,9 @@ unit pmodules;
     procedure proc_unit;
     procedure proc_unit;
 
 
       var
       var
-{$ifdef GDB}
-         { several defs to simulate more or less C++ objects for GDB }
-         vmtdef      : precdef;
-         pvmtdef     : ppointerdef;
-         vmtarraydef : parraydef;
-         vmtsymtable : psymtable;
-{$endif GDB}
-         names  : Tstringcontainer;
-         p      : psymtable;
+         { unitname : stringid; }
+         names:Tstringcontainer;
+         p : psymtable;
          unitst : punitsymtable;
          unitst : punitsymtable;
          pu     : pused_unit;
          pu     : pused_unit;
          s1,s2  : ^string; {Saves stack space}
          s1,s2  : ^string; {Saves stack space}
@@ -474,6 +571,11 @@ unit pmodules;
          refsymtable:=p;
          refsymtable:=p;
          unitst:=punitsymtable(p);
          unitst:=punitsymtable(p);
 
 
+         { the unit name must be usable as a unit specifier }
+         { inside the unit itself (PM)                      }
+         { this also forbids to have another symbol         }
+         { with the same name as the unit                   }
+         refsymtable^.insert(new(punitsym,init(current_module^.unitname^,unitst)));
          { set the symbol table for the current unit }
          { set the symbol table for the current unit }
          { this must be set later for interdependency }
          { this must be set later for interdependency }
          { current_module^.symtable:=psymtable(p); }
          { current_module^.symtable:=psymtable(p); }
@@ -519,76 +621,7 @@ unit pmodules;
            begin
            begin
               p^.next:=symtablestack;
               p^.next:=symtablestack;
               symtablestack:=p;
               symtablestack:=p;
-              p^.insert(new(ptypesym,init('longint',s32bitdef)));
-              p^.insert(new(ptypesym,init('ulong',u32bitdef)));
-              p^.insert(new(ptypesym,init('void',voiddef)));
-              p^.insert(new(ptypesym,init('char',cchardef)));
-{$ifdef i386}
-              p^.insert(new(ptypesym,init('s64real',c64floatdef)));
-{$endif i386}
-              p^.insert(new(ptypesym,init('s80real',s80floatdef)));
-              p^.insert(new(ptypesym,init('cs32fixed',s32fixeddef)));
-              p^.insert(new(ptypesym,init('byte',u8bitdef)));
-              p^.insert(new(ptypesym,init('string',cstringdef)));
-              p^.insert(new(ptypesym,init('word',u16bitdef)));
-              p^.insert(new(ptypesym,init('boolean',booldef)));
-              p^.insert(new(ptypesym,init('void_pointer',voidpointerdef)));
-              p^.insert(new(ptypesym,init('file',cfiledef)));
-{$ifdef i386}
-              p^.insert(new(ptypesym,init('REAL',new(pfloatdef,init(s64real)))));
-              p^.insert(new(ptypesym,init('COMP',new(pfloatdef,init(s64bit)))));
-              p^.insert(new(ptypesym,init('EXTENDED',new(pfloatdef,init(s80real)))));
-{$endif}
-{$ifdef m68k}
-              { internal definitions }
-              p^.insert(new(ptypesym,init('s32real',c64floatdef)));
-              { mappings... }
-              p^.insert(new(ptypesym,init('REAL',new(pfloatdef,init(s32real)))));
-              if (cs_fp_emulation) in aktswitches then
-                   p^.insert(new(ptypesym,init('DOUBLE',new(pfloatdef,init(s32real)))))
-              else
-                   p^.insert(new(ptypesym,init('DOUBLE',new(pfloatdef,init(s64real)))));
-{              p^.insert(new(ptypesym,init('COMP',new(pfloatdef,init(s32real)))));}
-              if (cs_fp_emulation) in aktswitches then
-                   p^.insert(new(ptypesym,init('EXTENDED',new(pfloatdef,init(s32real)))))
-              else
-                   p^.insert(new(ptypesym,init('EXTENDED',new(pfloatdef,init(s80real)))));
-{$endif}
-              p^.insert(new(ptypesym,init('SINGLE',new(pfloatdef,init(s32real)))));
-              p^.insert(new(ptypesym,init('POINTER',new(ppointerdef,init(voiddef)))));
-              p^.insert(new(ptypesym,init('STRING',cstringdef)));
-              p^.insert(new(ptypesym,init('BOOLEAN',new(porddef,init(bool8bit,0,1)))));
-              p^.insert(new(ptypesym,init('CHAR',new(porddef,init(uchar,0,255)))));
-              p^.insert(new(ptypesym,init('TEXT',new(pfiledef,init(ft_text,nil)))));
-              p^.insert(new(ptypesym,init('CARDINAL',new(porddef,init(u32bit,0,$ffffffff)))));
-              p^.insert(new(ptypesym,init('FIXED',new(pfloatdef,init(f32bit)))));
-              p^.insert(new(ptypesym,init('FIXED16',new(pfloatdef,init(f16bit)))));
-              p^.insert(new(ptypesym,init('TYPEDFILE',new(pfiledef,init(ft_typed,voiddef)))));
-              { !!!!!
-              p^.insert(new(ptypesym,init('COMP',new(porddef,init(s64bit,0,0)))));
-              p^.insert(new(ptypesym,init('SINGLE',new(porddef,init(s32real,0,0)))));
-              p^.insert(new(ptypesym,init('EXTENDED',new(porddef,init(s80real,0,0)))));
-              p^.insert(new(ptypesym,init('FILE',new(pfiledef,init(ft_untyped,nil)))));
-              }
-              { Add a type for virtual method tables in lowercase }
-              { so it isn't reachable!                            }
-{$ifdef GDB}
-              vmtsymtable:=new(psymtable,init(recordsymtable));
-              vmtdef:=new(precdef,init(vmtsymtable));
-              pvmtdef:=new(ppointerdef,init(vmtdef));
-              vmtsymtable^.insert(new(pvarsym,init('parent',pvmtdef)));
-              vmtsymtable^.insert(new(pvarsym,init('length',globaldef('longint'))));
-              vmtsymtable^.insert(new(pvarsym,init('mlength',globaldef('longint'))));
-              vmtarraydef:=new(parraydef,init(0,1,s32bitdef));
-              vmtarraydef^.definition := voidpointerdef;
-              vmtsymtable^.insert(new(pvarsym,init('__pfn',vmtarraydef)));
-              p^.insert(new(ptypesym,init('__vtbl_ptr_type',vmtdef)));
-              p^.insert(new(ptypesym,init('pvmt',pvmtdef)));
-              vmtarraydef:=new(parraydef,init(0,1,s32bitdef));
-              vmtarraydef^.definition := pvmtdef;
-              p^.insert(new(ptypesym,init('vtblarray',vmtarraydef)));
-              insertinternsyms(p);
-{$endif GDB}
+              insert_intern_types(p);
            end;
            end;
 
 
          { displaced for inter-dependency considerations }
          { displaced for inter-dependency considerations }
@@ -917,7 +950,15 @@ unit pmodules;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.6  1998-04-27 23:10:28  peter
+  Revision 1.7  1998-04-29 10:33:59  pierre
+    + added some code for ansistring (not complete nor working yet)
+    * corrected operator overloading
+    * corrected nasm output
+    + started inline procedures
+    + added starstarn : use ** for exponentiation (^ gave problems)
+    + started UseTokenInfo cond to get accurate positions
+
+  Revision 1.6  1998/04/27 23:10:28  peter
     + new scanner
     + new scanner
     * $makelib -> if smartlink
     * $makelib -> if smartlink
     * small filename fixes pmodule.setfilename
     * small filename fixes pmodule.setfilename

+ 9 - 9
compiler/pp.pas

@@ -41,14 +41,11 @@
   Required switches for a i386 compiler be compiled by Free Pascal Compiler:
   Required switches for a i386 compiler be compiled by Free Pascal Compiler:
   GDB;I386
   GDB;I386
 
 
-  Required switches for a 68000 compiler be compiled by Free Pascal Compiler:
-  GDB;M68K
-
   Required switches for a i386 compiler be compiled by Turbo Pascal:
   Required switches for a i386 compiler be compiled by Turbo Pascal:
   GDB;I386;TP
   GDB;I386;TP
 
 
   Required switches for a 68000 compiler be compiled by Turbo Pascal:
   Required switches for a 68000 compiler be compiled by Turbo Pascal:
-  GDB;M68K;TP
+  GDB;M68k;TP
 }
 }
 
 
 {$ifdef FPC}
 {$ifdef FPC}
@@ -129,7 +126,7 @@ uses
   catch,
   catch,
 {$endif LINUX}
 {$endif LINUX}
 {$IfDef PMD}
 {$IfDef PMD}
-     OpenFiles,
+     OpenFile,
      BBError,
      BBError,
      ObjMemory,
      ObjMemory,
      PMD, MemCheck,
      PMD, MemCheck,
@@ -376,10 +373,13 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.4  1998-04-21 15:22:46  pierre
-    * typing error in secondadd for mmx corrected
-    * USE_RHIDE sets usestderr to true
-      replacing gpc by fpc in RHIDE should be a lot easier
+  Revision 1.5  1998-04-29 10:33:59  pierre
+    + added some code for ansistring (not complete nor working yet)
+    * corrected operator overloading
+    * corrected nasm output
+    + started inline procedures
+    + added starstarn : use ** for exponentiation (^ gave problems)
+    + started UseTokenInfo cond to get accurate positions
 
 
   Revision 1.3  1998/04/21 10:16:48  peter
   Revision 1.3  1998/04/21 10:16:48  peter
     * patches from strasbourg
     * patches from strasbourg

+ 20 - 3
compiler/pstatmnt.pas

@@ -827,11 +827,17 @@ unit pstatmnt;
          p : ptree;
          p : ptree;
          code : ptree;
          code : ptree;
          labelnr : plabel;
          labelnr : plabel;
+{$ifdef UseTokenInfo}
+         filepos : tfilepos;
+{$endif UseTokenInfo}
 
 
       label
       label
          ready;
          ready;
 
 
       begin
       begin
+{$ifdef UseTokenInfo}
+         filepos:=tokeninfo^.filepos;
+{$endif UseTokenInfo}
          case token of
          case token of
             _GOTO : begin
             _GOTO : begin
                        if not(cs_support_goto in aktswitches)then
                        if not(cs_support_goto in aktswitches)then
@@ -930,6 +936,9 @@ unit pstatmnt;
            end;
            end;
          end;
          end;
          ready:
          ready:
+{$ifdef UseTokenInfo}
+         set_tree_filepos(code,filepos);
+{$endif UseTokenInfo}
          statement:=code;
          statement:=code;
       end;
       end;
 
 
@@ -986,9 +995,9 @@ unit pstatmnt;
                    procinfo.retoffset:=procinfo.firsttemp-procinfo.retdef^.size;
                    procinfo.retoffset:=procinfo.firsttemp-procinfo.retdef^.size;
                    procinfo.firsttemp:=procinfo.retoffset;
                    procinfo.firsttemp:=procinfo.retoffset;
 {$endif TEST_FUNCRET }
 {$endif TEST_FUNCRET }
-                   if (procinfo.flags and pooperator)<>0 then
+                   if (procinfo.flags and pi_operator)<>0 then
                      {opsym^.address:=procinfo.call_offset; is wrong PM }
                      {opsym^.address:=procinfo.call_offset; is wrong PM }
-                     opsym^.address:=procinfo.retoffset;
+                     opsym^.address:=-procinfo.retoffset;
                    { eax is modified by a function }
                    { eax is modified by a function }
 {$ifdef i386}
 {$ifdef i386}
                    usedinproc:=usedinproc or ($80 shr byte(R_EAX))
                    usedinproc:=usedinproc or ($80 shr byte(R_EAX))
@@ -1067,7 +1076,15 @@ unit pstatmnt;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.4  1998-04-08 16:58:05  pierre
+  Revision 1.5  1998-04-29 10:33:59  pierre
+    + added some code for ansistring (not complete nor working yet)
+    * corrected operator overloading
+    * corrected nasm output
+    + started inline procedures
+    + added starstarn : use ** for exponentiation (^ gave problems)
+    + started UseTokenInfo cond to get accurate positions
+
+  Revision 1.4  1998/04/08 16:58:05  pierre
     * several bugfixes
     * several bugfixes
       ADD ADC and AND are also sign extended
       ADD ADC and AND are also sign extended
       nasm output OK (program still crashes at end
       nasm output OK (program still crashes at end

+ 74 - 53
compiler/ptconst.pas

@@ -27,7 +27,9 @@ unit ptconst;
    uses symtable;
    uses symtable;
 
 
     { this procedure reads typed constants }
     { this procedure reads typed constants }
-    procedure readtypedconst(def : pdef);
+    { sym is only needed for ansi strings  }
+    { the assembler label is in the middle (PM) }
+    procedure readtypedconst(def : pdef;sym : ptypedconstsym);
 
 
   implementation
   implementation
 
 
@@ -46,11 +48,11 @@ unit ptconst;
        ;
        ;
 
 
     { this procedure reads typed constants }
     { this procedure reads typed constants }
-    procedure readtypedconst(def : pdef);
+    procedure readtypedconst(def : pdef;sym : ptypedconstsym);
 
 
       var
       var
          p : ptree;
          p : ptree;
-         i,l : longint;
+         i,l,strlength : longint;
          ll : plabel;
          ll : plabel;
          s : string;
          s : string;
          ca : pchar;
          ca : pchar;
@@ -243,57 +245,68 @@ unit ptconst;
            begin
            begin
               p:=expr;
               p:=expr;
               do_firstpass(p);
               do_firstpass(p);
-              if pstringdef(def)^.string_typ=shortstring then
+              { first take care of prefixes for long and ansi strings }
+{$ifdef UseLongString}
+              if pstringdef(def)^.string_typ=longstring then
                 begin
                 begin
-                   if p^.treetype=stringconstn then
-                     begin
-                        s:=p^.values^;
-                        if length(s)+1>def^.size then
-                          s[0]:=char(def^.size-1);
-                        generate_ascii(char(length(s))+s);
-                     end
-                   else if is_constcharnode(p) then
-                     begin
-                        datasegment^.concat(new(pai_string,init(#1+char(byte(p^.value)))));
-                        s:=char(byte(p^.value));
-                     end
-                   else Message(cg_e_illegal_expression);
-                   if def^.size>length(s) then
-                     begin
-                        getmem(ca,def^.size-length(s));
-                        fillchar(ca[0],def^.size-length(s)-1,' ');
-                        ca[def^.size-length(s)-1]:=#0;
-                        datasegment^.concat(new(pai_string,init_pchar(ca)));
-                        disposetree(p);
-                     end;
-                end
-              else if pstringdef(def)^.string_typ=longstring then
+                  { first write the maximum size }
+                  datasegment^.concat(new(pai_const,init_32bit(p^.length)))));
+                end else
+{$endif UseLongString}
+{$ifdef UseAnsiString}
+              if pstringdef(def)^.string_typ=ansistring then
                 begin
                 begin
-                   if p^.treetype=stringconstn then
-                     begin
-                        s:=p^.values^;
-                        if length(s)+1>def^.size then
-                          s[0]:=char(def^.size-1);
-                        generate_ascii(char(length(s))+s);
-                     end
-                   else if is_constcharnode(p) then
-                     begin
-                        datasegment^.concat(new(pai_string,init(#1+char(byte(p^.value)))));
-                        s:=char(byte(p^.value));
-                     end
-                   else Message(cg_e_illegal_expression);
-                   if def^.size>length(s) then
-                     begin
-                        getmem(ca,def^.size-length(s));
-                        fillchar(ca[0],def^.size-length(s)-1,' ');
-                        ca[def^.size-length(s)-1]:=#0;
-                        datasegment^.concat(new(pai_string,init_pchar(ca)));
-                        disposetree(p);
-                     end;
+{$ifdef debug}
+                  datasegment^.concat(new(pai_asm_comment,init('Header of ansistring')));
+{$endif debug}
+                  { first write the maximum size }
+                  datasegment^.concat(new(pai_const,init_32bit(pstringdef(def)^.len)));
+                  { second write the real length }
+                  datasegment^.concat(new(pai_const,init_32bit(p^.length)));
+                  { redondent with maxlength but who knows ... (PM) }
+                  { third write use count (set to -1 for safety ) }
+                  datasegment^.concat(new(pai_const,init_32bit(-1)));
+                  if assigned(sym) then
+                    sym^.really_insert_in_data;
+                end;
+{$endif UseAnsiString}
+              { the actual write is independent of the string_typ }
+              if p^.treetype=stringconstn then
+                begin
+{$ifdef UseAnsiString}
+                   if p^.length>=def^.size then
+                     strlength:=def^.size-1
+                   else
+                     strlength:=p^.length;
+                   { this can also handle longer strings }
+                   generate_pascii(p^.values,strlength);
+{$else UseAnsiString}
+                   if length(p^.values^)>=def^.size then
+                     strlength:=def^.size-1
+                   else
+                     strlength:=length(p^.values^);
+                   generate_ascii(char(strlength)+p^.values^);
+{$endif UseAnsiString}
                 end
                 end
-              else if pstringdef(def)^.string_typ=ansistring then
+              else if is_constcharnode(p) then
                 begin
                 begin
+                   datasegment^.concat(new(pai_string,init(#1+char(byte(p^.value)))));
+                   strlength:=1;
                 end
                 end
+              else Message(cg_e_illegal_expression);
+              if def^.size>strlength then
+                begin
+                   getmem(ca,def^.size-strlength);
+                   fillchar(ca[0],def^.size-strlength-1,' ');
+                   ca[def^.size-strlength-1]:=#0;
+{$ifdef UseAnsiString}
+                   { this can also handle longer strings }
+                   generate_pascii(ca,def^.size-strlength);
+{$else UseAnsiString}
+                   datasegment^.concat(new(pai_string,init_pchar(ca)));
+{$endif UseAnsiString}
+                   disposetree(p);
+                end;
            end;
            end;
          arraydef:
          arraydef:
            begin
            begin
@@ -302,10 +315,10 @@ unit ptconst;
                     consume(LKLAMMER);
                     consume(LKLAMMER);
                     for l:=parraydef(def)^.lowrange to parraydef(def)^.highrange-1 do
                     for l:=parraydef(def)^.lowrange to parraydef(def)^.highrange-1 do
                       begin
                       begin
-                         readtypedconst(parraydef(def)^.definition);
+                         readtypedconst(parraydef(def)^.definition,nil);
                          consume(COMMA);
                          consume(COMMA);
                       end;
                       end;
-                    readtypedconst(parraydef(def)^.definition);
+                    readtypedconst(parraydef(def)^.definition,nil);
                     consume(RKLAMMER);
                     consume(RKLAMMER);
                  end
                  end
               else
               else
@@ -419,7 +432,7 @@ unit ptconst;
                         aktpos:=pvarsym(srsym)^.address+pvarsym(srsym)^.definition^.size;
                         aktpos:=pvarsym(srsym)^.address+pvarsym(srsym)^.definition^.size;
 
 
                         { read the data }
                         { read the data }
-                        readtypedconst(pvarsym(srsym)^.definition);
+                        readtypedconst(pvarsym(srsym)^.definition,nil);
 
 
                         if token=SEMICOLON then
                         if token=SEMICOLON then
                           consume(SEMICOLON)
                           consume(SEMICOLON)
@@ -437,7 +450,15 @@ unit ptconst;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.2  1998-04-07 13:19:48  pierre
+  Revision 1.3  1998-04-29 10:34:00  pierre
+    + added some code for ansistring (not complete nor working yet)
+    * corrected operator overloading
+    * corrected nasm output
+    + started inline procedures
+    + added starstarn : use ** for exponentiation (^ gave problems)
+    + started UseTokenInfo cond to get accurate positions
+
+  Revision 1.2  1998/04/07 13:19:48  pierre
     * bugfixes for reset_gdb_info
     * bugfixes for reset_gdb_info
       in MEM parsing for go32v2
       in MEM parsing for go32v2
       better external symbol creation
       better external symbol creation

+ 13 - 5
compiler/ra68k.pas

@@ -610,9 +610,9 @@ var
        'B': instr.stropsize := S_B;
        'B': instr.stropsize := S_B;
        'W': instr.stropsize := S_W;
        'W': instr.stropsize := S_W;
        'L': instr.stropsize := S_L;
        'L': instr.stropsize := S_L;
-       'S': instr.stropsize := S_S;
-       'D': instr.stropsize := S_Q;
-       'X': instr.stropsize := S_X;
+       'S': instr.stropsize := S_FS;
+       'D': instr.stropsize := S_FL;
+       'X': instr.stropsize := S_FX;
        else
        else
         Message1(assem_e_invalid_opcode,s);
         Message1(assem_e_invalid_opcode,s);
        end;
        end;
@@ -2169,8 +2169,16 @@ Begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.1  1998-03-25 11:18:15  root
-  Initial revision
+  Revision 1.2  1998-04-29 10:34:01  pierre
+    + added some code for ansistring (not complete nor working yet)
+    * corrected operator overloading
+    * corrected nasm output
+    + started inline procedures
+    + added starstarn : use ** for exponentiation (^ gave problems)
+    + started UseTokenInfo cond to get accurate positions
+
+  Revision 1.1.1.1  1998/03/25 11:18:15  root
+  * Restored version
 
 
   Revision 1.14  1998/03/22 12:45:38  florian
   Revision 1.14  1998/03/22 12:45:38  florian
     * changes of Carl-Eric to m68k target commit:
     * changes of Carl-Eric to m68k target commit:

+ 24 - 12
compiler/rai386.pas

@@ -170,10 +170,12 @@ const
         { segment register }
         { segment register }
         S_W,S_W,S_W,S_W,S_W,S_W,S_W,
         S_W,S_W,S_W,S_W,S_W,S_W,S_W,
         { can also be S_S or S_T - must be checked at run-time }
         { can also be S_S or S_T - must be checked at run-time }
-        S_Q,S_Q,S_Q,S_Q,S_Q,S_Q,S_Q,S_Q,S_Q);
+        S_FL,S_FL,S_FL,S_FL,S_FL,S_FL,S_FL,S_FL,S_FL);
 
 
-       _constsizes: array[S_NO..S_S] of longint =
-       (0,ao_imm8,ao_imm16,ao_imm32,0,0,0,0,ao_imm32);
+       {topsize = (S_NO,S_B,S_W,S_L,S_BW,S_BL,S_WL,
+                  S_IS,S_IL,S_IQ,S_FS,S_FL,S_FX,S_D);}
+       _constsizes: array[S_NO..S_FS] of longint =
+       (0,ao_imm8,ao_imm16,ao_imm32,0,0,0,ao_imm16,ao_imm32,0,ao_imm32);
 
 
 
 
 
 
@@ -1570,19 +1572,21 @@ var
                         OPR_REFERENCE:
                         OPR_REFERENCE:
                            Begin
                            Begin
                               if (operands[1].val <= $ff) and
                               if (operands[1].val <= $ff) and
-                               (operands[2].size in [S_B,S_W,S_L,S_Q,S_S]) then
+                               (operands[2].size in [S_B,S_W,S_L,
+                                 S_IS,S_IL,S_IQ,S_FS,S_FL,S_FX]) then
                                  p^.concat(new(pai386,op_const_ref(instruc,
                                  p^.concat(new(pai386,op_const_ref(instruc,
                                  operands[2].size,operands[1].val,
                                  operands[2].size,operands[1].val,
                                  newreference(operands[2].ref))))
                                  newreference(operands[2].ref))))
                               else
                               else
                               if (operands[1].val <= $ffff) and
                               if (operands[1].val <= $ffff) and
-                               (operands[2].size in [S_W,S_L,S_Q,S_S]) then
+                               (operands[2].size in [S_W,S_L,
+                               S_IS,S_IL,S_IQ,S_FS,S_FL,S_FX]) then
                                  p^.concat(new(pai386,op_const_ref(instruc,
                                  p^.concat(new(pai386,op_const_ref(instruc,
                                  operands[2].size,operands[1].val,
                                  operands[2].size,operands[1].val,
                                  newreference(operands[2].ref))))
                                  newreference(operands[2].ref))))
                               else
                               else
                               if (operands[1].val <= $7fffffff) and
                               if (operands[1].val <= $7fffffff) and
-                               (operands[2].size in [S_L,S_Q,S_S]) then
+                               (operands[2].size in [S_L,S_IL,S_IQ,S_FS,S_FL,S_FX]) then
                                  p^.concat(new(pai386,op_const_ref(instruc,
                                  p^.concat(new(pai386,op_const_ref(instruc,
                                  operands[2].size,operands[1].val,
                                  operands[2].size,operands[1].val,
                                  newreference(operands[2].ref))))
                                  newreference(operands[2].ref))))
@@ -1593,19 +1597,19 @@ var
                            Begin
                            Begin
                               { size of opcode determined by register }
                               { size of opcode determined by register }
                               if (operands[1].val <= $ff) and
                               if (operands[1].val <= $ff) and
-                               (operands[2].size in [S_B,S_W,S_L,S_Q,S_S]) then
+                               (operands[2].size in [S_B,S_W,S_L,S_IS,S_IL,S_IQ,S_FS,S_FL,S_FX]) then
                                  p^.concat(new(pai386,op_const_reg(instruc,
                                  p^.concat(new(pai386,op_const_reg(instruc,
                                  operands[2].size,operands[1].val,
                                  operands[2].size,operands[1].val,
                                  operands[2].reg)))
                                  operands[2].reg)))
                               else
                               else
                               if (operands[1].val <= $ffff) and
                               if (operands[1].val <= $ffff) and
-                               (operands[2].size in [S_W,S_L,S_Q,S_S]) then
+                               (operands[2].size in [S_W,S_L,S_IS,S_IL,S_IQ,S_FS,S_FL,S_FX]) then
                                  p^.concat(new(pai386,op_const_reg(instruc,
                                  p^.concat(new(pai386,op_const_reg(instruc,
                                  operands[2].size,operands[1].val,
                                  operands[2].size,operands[1].val,
                                  operands[2].reg)))
                                  operands[2].reg)))
                               else
                               else
                               if (operands[1].val <= $7fffffff) and
                               if (operands[1].val <= $7fffffff) and
-                               (operands[2].size in [S_L,S_Q,S_S]) then
+                               (operands[2].size in [S_L,S_IL,S_IQ,S_FS,S_FL,S_FX]) then
                                  p^.concat(new(pai386,op_const_reg(instruc,
                                  p^.concat(new(pai386,op_const_reg(instruc,
                                  operands[2].size,operands[1].val,
                                  operands[2].size,operands[1].val,
                                  operands[2].reg)))
                                  operands[2].reg)))
@@ -3161,8 +3165,8 @@ var
                                    AS_DWORD: instr.operands[operandnum].size := S_L;
                                    AS_DWORD: instr.operands[operandnum].size := S_L;
                                    AS_WORD:  instr.operands[operandnum].size := S_W;
                                    AS_WORD:  instr.operands[operandnum].size := S_W;
                                    AS_BYTE:  instr.operands[operandnum].size := S_B;
                                    AS_BYTE:  instr.operands[operandnum].size := S_B;
-                                   AS_QWORD: instr.operands[operandnum].size := S_Q;
-                                   AS_TBYTE: instr.operands[operandnum].size := S_X;
+                                   AS_QWORD: instr.operands[operandnum].size := S_IQ;
+                                   AS_TBYTE: instr.operands[operandnum].size := S_FX;
                                   end;
                                   end;
                                   Consume(actasmtoken);
                                   Consume(actasmtoken);
                                   Case actasmtoken of
                                   Case actasmtoken of
@@ -3362,7 +3366,15 @@ Begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.3  1998-04-08 16:58:06  pierre
+  Revision 1.4  1998-04-29 10:34:03  pierre
+    + added some code for ansistring (not complete nor working yet)
+    * corrected operator overloading
+    * corrected nasm output
+    + started inline procedures
+    + added starstarn : use ** for exponentiation (^ gave problems)
+    + started UseTokenInfo cond to get accurate positions
+
+  Revision 1.3  1998/04/08 16:58:06  pierre
     * several bugfixes
     * several bugfixes
       ADD ADC and AND are also sign extended
       ADD ADC and AND are also sign extended
       nasm output OK (program still crashes at end
       nasm output OK (program still crashes at end

+ 44 - 30
compiler/ratti386.pas

@@ -143,29 +143,31 @@ const
         { segment register }
         { segment register }
         S_W,S_W,S_W,S_W,S_W,S_W,S_W,
         S_W,S_W,S_W,S_W,S_W,S_W,S_W,
         { can also be S_S or S_T - must be checked at run-time }
         { can also be S_S or S_T - must be checked at run-time }
-        S_Q,S_Q,S_Q,S_Q,S_Q,S_Q,S_Q,S_Q,S_Q);
-
-       _constsizes: array[S_NO..S_S] of longint =
-       (0,ao_imm8,ao_imm16,ao_imm32,0,0,0,0,ao_imm32);
+        S_FL,S_FL,S_FL,S_FL,S_FL,S_FL,S_FL,S_FL,S_FL);
 
 
+       {topsize = (S_NO,S_B,S_W,S_L,S_BW,S_BL,S_WL,
+                  S_IS,S_IL,S_IQ,S_FS,S_FL,S_FX,S_D);}
+       _constsizes: array[S_NO..S_FS] of longint =
+       (0,ao_imm8,ao_imm16,ao_imm32,0,0,0,ao_imm16,ao_imm32,0,ao_imm32);
 
 
        { converts from AT&T style to non-specific style... }
        { converts from AT&T style to non-specific style... }
-      {'fildq','filds',
-     'fildl','fldl','fldt','fistq','fists','fistl','fstl','fsts',
-      'fstps','fistpl','fstpl','fistps','fistpq','fstpt','fcomps',
-      'ficompl','fcompl','ficomps','fcoms','ficoml','fcoml','ficoms',
-      'fiaddl','faddl','fiadds','fisubl','fsubl','fisubs','fsubs',
-      'fsubr','fsubrs','fisubrl','fsubrl','fisubrs','fmuls','fimull',
-      'fmull','fimuls','fdivs','fidivl','fdivl','fidivs','fdivrs',
-      'fidivrl','fdivrl','fidivrs','repe','repne','fadds','popfl', }
        _fpusizes:array[A_FILDQ..A_FIDIVRS] of topsize = (
        _fpusizes:array[A_FILDQ..A_FIDIVRS] of topsize = (
-                 S_Q,S_S,S_L,S_L,S_X,S_Q,S_S,S_L,S_L,S_S,
-                 S_S,S_L,S_L,S_S,S_Q,S_X,
-                 S_S,S_L,S_L,S_S,
-                 S_S,S_L,S_L,S_S,S_L,S_L,S_S,
-                 S_L,S_L,S_S,S_S,S_NO,S_S,S_L,
-                 S_L,S_S,S_S,S_L,S_L,S_S,S_S,S_L,
-                 S_L,S_S,S_S,S_L,S_L,S_S);
+                 {'fildq','filds',}
+                 S_IQ,S_IS,
+                 {'fildl','fldl','fldt','fistq','fists','fistl','fstl','fsts',}
+                 S_IL,S_FL,S_FX,S_IQ,S_IS,S_IL,S_FL,S_FS,
+                 {'fstps','fistpl','fstpl','fistps','fistpq','fstpt','fcomps',}
+                 S_FS,S_IL,S_FL,S_IS,S_IQ,S_FX,S_FS,
+                 {'ficompl','fcompl','ficomps','fcoms','ficoml','fcoml','ficoms',}
+                 S_IL,S_FL,S_IS,S_FS,S_IL,S_FL,S_IS,
+                 {'fiaddl','faddl','fiadds','fisubl','fsubl','fisubs','fsubs',}
+                 S_IL,S_FL,S_IS,S_IL,S_FL,S_FS,S_IS,S_FS,
+                 {'fsubr','fsubrs','fisubrl','fsubrl','fisubrs','fmuls','fimull',}
+                 S_NO,S_FS,S_IL,S_FL,S_IS,S_FS,S_IL,
+                 {'fmull','fimuls','fdivs','fidivl','fdivl','fidivs','fdivrs',}
+                 S_FL,S_IL,S_FS,S_IL,S_FL,S_IS,S_FS,
+                 {'fidivrl','fdivrl',}
+                 S_IL,S_FL);
        _fpuopcodes:array[A_FILDQ..A_FIDIVRS] of tasmop = (
        _fpuopcodes:array[A_FILDQ..A_FIDIVRS] of tasmop = (
        A_FILD,A_FILD,A_FILD,A_FLD,A_FLD,A_FIST,A_FIST,A_FIST,A_FST,A_FST,
        A_FILD,A_FILD,A_FILD,A_FLD,A_FLD,A_FIST,A_FIST,A_FIST,A_FST,A_FST,
        A_FSTP,A_FISTP,A_FSTP,A_FISTP,A_FISTP,A_FSTP,
        A_FSTP,A_FISTP,A_FSTP,A_FISTP,A_FISTP,A_FSTP,
@@ -396,7 +398,11 @@ const
 
 
       if c = ':' then
       if c = ':' then
       begin
       begin
-           uppervar(actasmpattern);
+           { uppervar(actasmpattern);
+           Carl, you cannot change the label to upper
+           if you want to be able to read in system unit
+           don't forget that ATT syntax is case sensitive
+           for labels !! (PM) }
            token := AS_LABEL;
            token := AS_LABEL;
            { let us point to the next character }
            { let us point to the next character }
            c := asmgetchar;
            c := asmgetchar;
@@ -886,8 +892,8 @@ const
              EXT_WORD   : instr.operands[operandnum].size := S_W;
              EXT_WORD   : instr.operands[operandnum].size := S_W;
              EXT_NEAR,EXT_FAR,EXT_PROC,EXT_DWORD,EXT_CODEPTR,EXT_DATAPTR:
              EXT_NEAR,EXT_FAR,EXT_PROC,EXT_DWORD,EXT_CODEPTR,EXT_DATAPTR:
              instr.operands[operandnum].size := S_L;
              instr.operands[operandnum].size := S_L;
-             EXT_QWORD  : instr.operands[operandnum].size := S_Q;
-             EXT_TBYTE  : instr.operands[operandnum].size := S_X;
+             EXT_QWORD  : instr.operands[operandnum].size := S_FL;
+             EXT_TBYTE  : instr.operands[operandnum].size := S_FX;
            else
            else
              { this is in the case where the instruction is LEA }
              { this is in the case where the instruction is LEA }
              { or something like that, in that case size is not }
              { or something like that, in that case size is not }
@@ -1831,19 +1837,19 @@ const
                               else
                               else
                            { resort to intel styled checking ... }
                            { resort to intel styled checking ... }
                               if (operands[1].val <= $ff) and
                               if (operands[1].val <= $ff) and
-                               (operands[2].size in [S_B,S_W,S_L,S_Q,S_S]) then
+                               (operands[2].size in [S_B,S_W,S_L]) then
                                  p^.concat(new(pai386,op_const_ref(instruc,
                                  p^.concat(new(pai386,op_const_ref(instruc,
                                  operands[2].size,operands[1].val,
                                  operands[2].size,operands[1].val,
                                  newreference(operands[2].ref))))
                                  newreference(operands[2].ref))))
                               else
                               else
                               if (operands[1].val <= $ffff) and
                               if (operands[1].val <= $ffff) and
-                               (operands[2].size in [S_W,S_L,S_Q,S_S]) then
+                               (operands[2].size in [S_W,S_L]) then
                                  p^.concat(new(pai386,op_const_ref(instruc,
                                  p^.concat(new(pai386,op_const_ref(instruc,
                                  operands[2].size,operands[1].val,
                                  operands[2].size,operands[1].val,
                                  newreference(operands[2].ref))))
                                  newreference(operands[2].ref))))
                               else
                               else
                               if (operands[1].val <= $7fffffff) and
                               if (operands[1].val <= $7fffffff) and
-                               (operands[2].size in [S_L,S_Q,S_S]) then
+                               (operands[2].size in [S_L]) then
                                  p^.concat(new(pai386,op_const_ref(instruc,
                                  p^.concat(new(pai386,op_const_ref(instruc,
                                  operands[2].size,operands[1].val,
                                  operands[2].size,operands[1].val,
                                  newreference(operands[2].ref))))
                                  newreference(operands[2].ref))))
@@ -1854,19 +1860,19 @@ const
                            Begin
                            Begin
                               { size of opcode determined by register }
                               { size of opcode determined by register }
                               if (operands[1].val <= $ff) and
                               if (operands[1].val <= $ff) and
-                               (operands[2].size in [S_B,S_W,S_L,S_Q,S_S]) then
+                               (operands[2].size in [S_B,S_W,S_L]) then
                                  p^.concat(new(pai386,op_const_reg(instruc,
                                  p^.concat(new(pai386,op_const_reg(instruc,
                                  operands[2].size,operands[1].val,
                                  operands[2].size,operands[1].val,
                                  operands[2].reg)))
                                  operands[2].reg)))
                               else
                               else
                               if (operands[1].val <= $ffff) and
                               if (operands[1].val <= $ffff) and
-                               (operands[2].size in [S_W,S_L,S_Q,S_S]) then
+                               (operands[2].size in [S_W,S_L]) then
                                  p^.concat(new(pai386,op_const_reg(instruc,
                                  p^.concat(new(pai386,op_const_reg(instruc,
                                  operands[2].size,operands[1].val,
                                  operands[2].size,operands[1].val,
                                  operands[2].reg)))
                                  operands[2].reg)))
                               else
                               else
                               if (operands[1].val <= $7fffffff) and
                               if (operands[1].val <= $7fffffff) and
-                               (operands[2].size in [S_L,S_Q,S_S]) then
+                               (operands[2].size in [S_L]) then
                                  p^.concat(new(pai386,op_const_reg(instruc,
                                  p^.concat(new(pai386,op_const_reg(instruc,
                                  operands[2].size,operands[1].val,
                                  operands[2].size,operands[1].val,
                                  operands[2].reg)))
                                  operands[2].reg)))
@@ -3578,7 +3584,7 @@ const
                  { -- add.                                               -- }
                  { -- add.                                               -- }
                    if (cs_compilesystem in aktswitches) then
                    if (cs_compilesystem in aktswitches) then
                    begin
                    begin
-                     Consume(AS_LCOMM);
+                     Consume(AS_COMM);
                       if actasmtoken <> AS_ID then
                       if actasmtoken <> AS_ID then
                         begin
                         begin
                            Message(assem_e_invalid_comm_def);
                            Message(assem_e_invalid_comm_def);
@@ -3675,7 +3681,15 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.3  1998-04-08 16:58:07  pierre
+  Revision 1.4  1998-04-29 10:34:04  pierre
+    + added some code for ansistring (not complete nor working yet)
+    * corrected operator overloading
+    * corrected nasm output
+    + started inline procedures
+    + added starstarn : use ** for exponentiation (^ gave problems)
+    + started UseTokenInfo cond to get accurate positions
+
+  Revision 1.3  1998/04/08 16:58:07  pierre
     * several bugfixes
     * several bugfixes
       ADD ADC and AND are also sign extended
       ADD ADC and AND are also sign extended
       nasm output OK (program still crashes at end
       nasm output OK (program still crashes at end

+ 274 - 9
compiler/scanner.pas

@@ -28,7 +28,7 @@ unit scanner;
   interface
   interface
 
 
     uses
     uses
-       globals;
+       globals,files;
 
 
     const
     const
 {$ifdef TP}
 {$ifdef TP}
@@ -135,6 +135,15 @@ unit scanner;
          destructor done;
          destructor done;
       end;
       end;
 
 
+{$ifdef UseTokenInfo}
+
+      ttokeninfo = record
+                 token : ttoken;
+                 fi : tfileposinfo;
+                 end;
+      ptokeninfo = ^ttokeninfo;
+{$endif UseTokenInfo}
+
     var
     var
         c              : char;
         c              : char;
         orgpattern,
         orgpattern,
@@ -152,9 +161,14 @@ unit scanner;
         lastasmgetchar : char;
         lastasmgetchar : char;
         preprocstack   : ppreprocstack;
         preprocstack   : ppreprocstack;
 
 
+
       {public}
       {public}
         procedure syntaxerror(const s : string);
         procedure syntaxerror(const s : string);
+{$ifndef UseTokenInfo}
         function yylex : ttoken;
         function yylex : ttoken;
+{$else UseTokenInfo}
+        function yylex : ptokeninfo;
+{$endif UseTokenInfo}
         function asmgetchar : char;
         function asmgetchar : char;
 
 
         procedure InitScanner(const fn: string);
         procedure InitScanner(const fn: string);
@@ -165,7 +179,7 @@ unit scanner;
 
 
      uses
      uses
        dos,cobjects,verbose,pbase,
        dos,cobjects,verbose,pbase,
-       files,symtable,switches,link;
+       symtable,switches,link;
 
 
      var
      var
     { this is usefull to get the write filename
     { this is usefull to get the write filename
@@ -348,8 +362,17 @@ unit scanner;
     procedure linebreak;
     procedure linebreak;
       var
       var
          status : tcompilestatus;
          status : tcompilestatus;
+         cur : char;
       begin
       begin
-      { Fix linebreak to be only newline (=#10) for all types of linebreaks }
+        cur:=c;
+        if byte(inputpointer^)=0 then
+          begin
+             reload;
+             if byte(cur)+byte(c)<>23 then
+               dec(longint(inputpointer));
+          end
+        else
+        { Fix linebreak to be only newline (=#10) for all types of linebreaks }
         if (byte(inputpointer^)+byte(c)=23) then
         if (byte(inputpointer^)+byte(c)=23) then
           inc(longint(inputpointer));
           inc(longint(inputpointer));
         c:=newline;
         c:=newline;
@@ -644,14 +667,25 @@ unit scanner;
       end;
       end;
 
 
 
 
-   function yylex : ttoken;
+{$ifndef UseTokenInfo}
+        function yylex : ttoken;
+{$else UseTokenInfo}
+        function yylex : ptokeninfo;
+{$endif UseTokenInfo}
      var
      var
         y    : ttoken;
         y    : ttoken;
+{$ifdef UseTokenInfo}
+        newyylex : ptokeninfo;
+{$endif UseTokenInfo}
         code : word;
         code : word;
         l    : longint;
         l    : longint;
         mac  : pmacrosym;
         mac  : pmacrosym;
         hp   : pinputfile;
         hp   : pinputfile;
         hp2  : pchar;
         hp2  : pchar;
+{$ifdef UseTokenInfo}
+      label
+         exit_label;
+{$endif UseTokenInfo}
      begin
      begin
         { was the last character a point ? }
         { was the last character a point ? }
         { this code is needed because the scanner if there is a 1. found if  }
         { this code is needed because the scanner if there is a 1. found if  }
@@ -662,11 +696,19 @@ unit scanner;
              if c='.' then
              if c='.' then
                begin
                begin
                   readchar;
                   readchar;
+{$ifndef UseTokenInfo}
                   yylex:=POINTPOINT;
                   yylex:=POINTPOINT;
                   exit;
                   exit;
                end;
                end;
              yylex:=POINT;
              yylex:=POINT;
              exit;
              exit;
+{$else UseTokenInfo}
+                  y:=POINTPOINT;
+                  goto exit_label;
+               end;
+             y:=POINT;
+             goto exit_label;
+{$endif UseTokenInfo}
           end;
           end;
 
 
         repeat
         repeat
@@ -685,7 +727,9 @@ unit scanner;
                         orgpattern:=readstring;
                         orgpattern:=readstring;
                         pattern:=upper(orgpattern);
                         pattern:=upper(orgpattern);
                         if (length(pattern) in [2..id_len]) and is_keyword(y) then
                         if (length(pattern) in [2..id_len]) and is_keyword(y) then
+{$ifndef UseTokenInfo}
                          yylex:=y
                          yylex:=y
+{$endif UseTokenInfo}
                         else
                         else
                          begin
                          begin
                          { this takes some time ... }
                          { this takes some time ... }
@@ -730,19 +774,35 @@ unit scanner;
                                  exit;
                                  exit;
                                end;
                                end;
                             end;
                             end;
+{$ifndef UseTokenInfo}
                            yylex:=ID;
                            yylex:=ID;
                          end;
                          end;
                         exit;
                         exit;
+{$else UseTokenInfo}
+                           y:=ID;
+                         end;
+                        goto exit_label;
+{$endif UseTokenInfo}
                       end;
                       end;
                 '$' : begin
                 '$' : begin
                          pattern:=readnumber;
                          pattern:=readnumber;
+{$ifndef UseTokenInfo}
                          yylex:=INTCONST;
                          yylex:=INTCONST;
                          exit;
                          exit;
+{$else UseTokenInfo}
+                         y:=INTCONST;
+                         goto exit_label;
+{$endif UseTokenInfo}
                       end;
                       end;
                 '%' : begin
                 '%' : begin
                          pattern:=readnumber;
                          pattern:=readnumber;
+{$ifndef UseTokenInfo}
                          yylex:=INTCONST;
                          yylex:=INTCONST;
                          exit;
                          exit;
+{$else UseTokenInfo}
+                         y:=INTCONST;
+                         goto exit_label;
+{$endif UseTokenInfo}
                       end;
                       end;
            '0'..'9' : begin
            '0'..'9' : begin
                         pattern:=readnumber;
                         pattern:=readnumber;
@@ -752,8 +812,13 @@ unit scanner;
                                  if not(c in ['0'..'9']) then
                                  if not(c in ['0'..'9']) then
                                   begin
                                   begin
                                     s_point:=true;
                                     s_point:=true;
+{$ifndef UseTokenInfo}
                                     yylex:=INTCONST;
                                     yylex:=INTCONST;
                                     exit;
                                     exit;
+{$else UseTokenInfo}
+                                    y:=INTCONST;
+                                    goto exit_label;
+{$endif UseTokenInfo}
                                   end;
                                   end;
                                  pattern:=pattern+'.';
                                  pattern:=pattern+'.';
                                  while c in ['0'..'9'] do
                                  while c in ['0'..'9'] do
@@ -761,8 +826,13 @@ unit scanner;
                                     pattern:=pattern+c;
                                     pattern:=pattern+c;
                                     readchar;
                                     readchar;
                                   end;
                                   end;
+{$ifndef UseTokenInfo}
                                  yylex:=REALNUMBER;
                                  yylex:=REALNUMBER;
                                  exit;
                                  exit;
+{$else UseTokenInfo}
+                                 y:=REALNUMBER;
+                                 goto exit_label;
+{$endif UseTokenInfo}
                                end;
                                end;
                      'e','E' : begin
                      'e','E' : begin
                                  pattern:=pattern+'E';
                                  pattern:=pattern+'E';
@@ -779,27 +849,52 @@ unit scanner;
                                     pattern:=pattern+c;
                                     pattern:=pattern+c;
                                     readchar;
                                     readchar;
                                   end;
                                   end;
+{$ifndef UseTokenInfo}
                                  yylex:=REALNUMBER;
                                  yylex:=REALNUMBER;
                                  exit;
                                  exit;
+{$else UseTokenInfo}
+                                 y:=REALNUMBER;
+                                 goto exit_label;
+{$endif UseTokenInfo}
                                end;
                                end;
                         end;
                         end;
+{$ifndef UseTokenInfo}
                         yylex:=INTCONST;
                         yylex:=INTCONST;
                         exit;
                         exit;
+{$else UseTokenInfo}
+                        y:=INTCONST;
+                        goto exit_label;
+{$endif UseTokenInfo}
                       end;
                       end;
                 ';' : begin
                 ';' : begin
                         readchar;
                         readchar;
+{$ifndef UseTokenInfo}
                         yylex:=SEMICOLON;
                         yylex:=SEMICOLON;
                         exit;
                         exit;
+{$else UseTokenInfo}
+                        y:=SEMICOLON;
+                        goto exit_label;
+{$endif UseTokenInfo}
                       end;
                       end;
                 '[' : begin
                 '[' : begin
                         readchar;
                         readchar;
+{$ifndef UseTokenInfo}
                         yylex:=LECKKLAMMER;
                         yylex:=LECKKLAMMER;
                         exit;
                         exit;
+{$else UseTokenInfo}
+                        y:=LECKKLAMMER;
+                        goto exit_label;
+{$endif UseTokenInfo}
                       end;
                       end;
                 ']' : begin
                 ']' : begin
                         readchar;
                         readchar;
+{$ifndef UseTokenInfo}
                         yylex:=RECKKLAMMER;
                         yylex:=RECKKLAMMER;
                         exit;
                         exit;
+{$else UseTokenInfo}
+                        y:=RECKKLAMMER;
+                        goto exit_label;
+{$endif UseTokenInfo}
                       end;
                       end;
                 '(' : begin
                 '(' : begin
                         readchar;
                         readchar;
@@ -813,57 +908,114 @@ unit scanner;
 {$endif TP}
 {$endif TP}
                            exit;
                            exit;
                          end;
                          end;
+{$ifndef UseTokenInfo}
                         yylex:=LKLAMMER;
                         yylex:=LKLAMMER;
                         exit;
                         exit;
+{$else UseTokenInfo}
+                        y:=LKLAMMER;
+                        goto exit_label;
+{$endif UseTokenInfo}
                       end;
                       end;
                 ')' : begin
                 ')' : begin
                         readchar;
                         readchar;
+{$ifndef UseTokenInfo}
                         yylex:=RKLAMMER;
                         yylex:=RKLAMMER;
                         exit;
                         exit;
+{$else UseTokenInfo}
+                        y:=RKLAMMER;
+                        goto exit_label;
+{$endif UseTokenInfo}
                       end;
                       end;
                 '+' : begin
                 '+' : begin
                         readchar;
                         readchar;
                         if (c='=') and c_like_operators then
                         if (c='=') and c_like_operators then
                          begin
                          begin
                            readchar;
                            readchar;
+{$ifndef UseTokenInfo}
                            yylex:=_PLUSASN;
                            yylex:=_PLUSASN;
                            exit;
                            exit;
+{$else UseTokenInfo}
+                           y:=_PLUSASN;
+                           goto exit_label;
+{$endif UseTokenInfo}
                          end;
                          end;
+{$ifndef UseTokenInfo}
                         yylex:=PLUS;
                         yylex:=PLUS;
                         exit;
                         exit;
+{$else UseTokenInfo}
+                        y:=PLUS;
+                        goto exit_label;
+{$endif UseTokenInfo}
                       end;
                       end;
                 '-' : begin
                 '-' : begin
                         readchar;
                         readchar;
                         if (c='=') and c_like_operators then
                         if (c='=') and c_like_operators then
                          begin
                          begin
                            readchar;
                            readchar;
+{$ifndef UseTokenInfo}
                            yylex:=_MINUSASN;
                            yylex:=_MINUSASN;
                            exit;
                            exit;
+{$else UseTokenInfo}
+                           y:=_MINUSASN;
+                           goto exit_label;
+{$endif UseTokenInfo}
                          end;
                          end;
+{$ifndef UseTokenInfo}
                         yylex:=MINUS;
                         yylex:=MINUS;
                         exit;
                         exit;
+{$else UseTokenInfo}
+                        y:=MINUS;
+                        goto exit_label;
+{$endif UseTokenInfo}
                       end;
                       end;
                 ':' : begin
                 ':' : begin
                         readchar;
                         readchar;
                         if c='=' then
                         if c='=' then
                          begin
                          begin
                            readchar;
                            readchar;
+{$ifndef UseTokenInfo}
                            yylex:=ASSIGNMENT;
                            yylex:=ASSIGNMENT;
                            exit;
                            exit;
+{$else UseTokenInfo}
+                           y:=ASSIGNMENT;
+                           goto exit_label;
+{$endif UseTokenInfo}
                          end;
                          end;
+{$ifndef UseTokenInfo}
                         yylex:=COLON;
                         yylex:=COLON;
                         exit;
                         exit;
+{$else UseTokenInfo}
+                        y:=COLON;
+                        goto exit_label;
+{$endif UseTokenInfo}
                       end;
                       end;
                 '*' : begin
                 '*' : begin
                         readchar;
                         readchar;
                         if (c='=') and c_like_operators then
                         if (c='=') and c_like_operators then
                          begin
                          begin
                            readchar;
                            readchar;
+{$ifndef UseTokenInfo}
                            yylex:=_STARASN;
                            yylex:=_STARASN;
-                           exit;
-                         end;
-                        yylex:=STAR;
+{$else UseTokenInfo}
+                           y:=_STARASN;
+{$endif UseTokenInfo}
+                         end else if c='*' then
+                         begin
+                           readchar;
+{$ifndef UseTokenInfo}
+                           yylex:=STARSTAR;
+{$else UseTokenInfo}
+                           y:=STARSTAR;
+{$endif UseTokenInfo}
+                         end
+                        else
+{$ifndef UseTokenInfo}
+                          yylex:=STAR;
                         exit;
                         exit;
+{$else UseTokenInfo}
+                          y:=STAR;
+                        goto exit_label;
+{$endif UseTokenInfo}
                       end;
                       end;
                 '/' : begin
                 '/' : begin
                         readchar;
                         readchar;
@@ -872,8 +1024,13 @@ unit scanner;
                                  if c_like_operators then
                                  if c_like_operators then
                                   begin
                                   begin
                                     readchar;
                                     readchar;
+{$ifndef UseTokenInfo}
                                     yylex:=_SLASHASN;
                                     yylex:=_SLASHASN;
                                     exit;
                                     exit;
+{$else UseTokenInfo}
+                                    y:=_SLASHASN;
+                                    goto exit_label;
+{$endif UseTokenInfo}
                                   end;
                                   end;
                                end;
                                end;
                          '/' : begin
                          '/' : begin
@@ -886,41 +1043,75 @@ unit scanner;
                                  exit;
                                  exit;
                                end;
                                end;
                         end;
                         end;
+{$ifndef UseTokenInfo}
                         yylex:=SLASH;
                         yylex:=SLASH;
                         exit;
                         exit;
+{$else UseTokenInfo}
+                        y:=SLASH;
+                        goto exit_label;
+{$endif UseTokenInfo}
                       end;
                       end;
            '='      : begin
            '='      : begin
                         readchar;
                         readchar;
+{$ifndef UseTokenInfo}
                         yylex:=EQUAL;
                         yylex:=EQUAL;
                         exit;
                         exit;
+{$else UseTokenInfo}
+                        y:=EQUAL;
+                        goto exit_label;
+{$endif UseTokenInfo}
                       end;
                       end;
            '.'      : begin
            '.'      : begin
                         readchar;
                         readchar;
                         if c='.' then
                         if c='.' then
                          begin
                          begin
                            readchar;
                            readchar;
+{$ifndef UseTokenInfo}
                            yylex:=POINTPOINT;
                            yylex:=POINTPOINT;
                            exit;
                            exit;
+{$else UseTokenInfo}
+                           y:=POINTPOINT;
+                           goto exit_label;
+{$endif UseTokenInfo}
                          end
                          end
                         else
                         else
+{$ifndef UseTokenInfo}
                          yylex:=POINT;
                          yylex:=POINT;
                         exit;
                         exit;
+{$else UseTokenInfo}
+                         y:=POINT;
+                        goto exit_label;
+{$endif UseTokenInfo}
                       end;
                       end;
                 '@' : begin
                 '@' : begin
                         readchar;
                         readchar;
                         if c='@' then
                         if c='@' then
                          begin
                          begin
                            readchar;
                            readchar;
+{$ifndef UseTokenInfo}
+                           yylex:=DOUBLEADDR;
+{$else UseTokenInfo}
                            yylex:=DOUBLEADDR;
                            yylex:=DOUBLEADDR;
+{$endif UseTokenInfo}
                          end
                          end
                         else
                         else
+{$ifndef UseTokenInfo}
                          yylex:=KLAMMERAFFE;
                          yylex:=KLAMMERAFFE;
                         exit;
                         exit;
+{$else UseTokenInfo}
+                         y:=KLAMMERAFFE;
+                        goto exit_label;
+{$endif UseTokenInfo}
                       end;
                       end;
                 ',' : begin
                 ',' : begin
                         readchar;
                         readchar;
+{$ifndef UseTokenInfo}
                         yylex:=COMMA;
                         yylex:=COMMA;
                         exit;
                         exit;
+{$else UseTokenInfo}
+                        y:=COMMA;
+                        goto exit_label;
+{$endif UseTokenInfo}
                       end;
                       end;
       '''','#','^' :  begin
       '''','#','^' :  begin
                         if c='^' then
                         if c='^' then
@@ -935,8 +1126,13 @@ unit scanner;
                             end
                             end
                            else
                            else
                             begin
                             begin
+{$ifndef UseTokenInfo}
                               yylex:=CARET;
                               yylex:=CARET;
                               exit;
                               exit;
+{$else UseTokenInfo}
+                              y:=CARET;
+                              goto exit_label;
+{$endif UseTokenInfo}
                             end;
                             end;
                          end
                          end
                         else
                         else
@@ -979,65 +1175,126 @@ unit scanner;
                           end;
                           end;
                         until false;
                         until false;
                       { strings with length 1 become const chars }
                       { strings with length 1 become const chars }
+{$ifndef UseTokenInfo}
                         if length(pattern)=1 then
                         if length(pattern)=1 then
                          yylex:=CCHAR
                          yylex:=CCHAR
                         else
                         else
                          yylex:=CSTRING;
                          yylex:=CSTRING;
                         exit;
                         exit;
+{$else UseTokenInfo}
+                        if length(pattern)=1 then
+                         y:=CCHAR
+                        else
+                         y:=CSTRING;
+                        goto exit_label;
+{$endif UseTokenInfo}
                       end;
                       end;
                 '>' : begin
                 '>' : begin
                         readchar;
                         readchar;
                         case c of
                         case c of
                          '=' : begin
                          '=' : begin
                                  readchar;
                                  readchar;
+{$ifndef UseTokenInfo}
                                  yylex:=GTE;
                                  yylex:=GTE;
                                  exit;
                                  exit;
+{$else UseTokenInfo}
+                                 y:=GTE;
+                                 goto exit_label;
+{$endif UseTokenInfo}
                                end;
                                end;
                          '>' : begin
                          '>' : begin
                                  readchar;
                                  readchar;
+{$ifndef UseTokenInfo}
                                  yylex:=_SHR;
                                  yylex:=_SHR;
                                  exit;
                                  exit;
+{$else UseTokenInfo}
+                                 y:=_SHR;
+                                 goto exit_label;
+{$endif UseTokenInfo}
                                end;
                                end;
                          '<' : begin { >< is for a symetric diff for sets }
                          '<' : begin { >< is for a symetric diff for sets }
                                  readchar;
                                  readchar;
+{$ifndef UseTokenInfo}
                                  yylex:=SYMDIF;
                                  yylex:=SYMDIF;
                                  exit;
                                  exit;
+{$else UseTokenInfo}
+                                 y:=SYMDIF;
+                                 goto exit_label;
+{$endif UseTokenInfo}
                                end;
                                end;
                         end;
                         end;
+{$ifndef UseTokenInfo}
                         yylex:=GT;
                         yylex:=GT;
                         exit;
                         exit;
+{$else UseTokenInfo}
+                        y:=GT;
+                        goto exit_label;
+{$endif UseTokenInfo}
                       end;
                       end;
                 '<' : begin
                 '<' : begin
                         readchar;
                         readchar;
                         case c of
                         case c of
                          '>' : begin
                          '>' : begin
                                  readchar;
                                  readchar;
+{$ifndef UseTokenInfo}
                                  yylex:=UNEQUAL;
                                  yylex:=UNEQUAL;
                                  exit;
                                  exit;
+{$else UseTokenInfo}
+                                 y:=UNEQUAL;
+                                 goto exit_label;
+{$endif UseTokenInfo}
                                end;
                                end;
                          '=' : begin
                          '=' : begin
                                  readchar;
                                  readchar;
+{$ifndef UseTokenInfo}
                                  yylex:=LTE;
                                  yylex:=LTE;
                                  exit;
                                  exit;
+{$else UseTokenInfo}
+                                 y:=LTE;
+                                 goto exit_label;
+{$endif UseTokenInfo}
                                end;
                                end;
                          '<' : begin
                          '<' : begin
                                  readchar;
                                  readchar;
+{$ifndef UseTokenInfo}
                                  yylex:=_SHL;
                                  yylex:=_SHL;
                                  exit;
                                  exit;
+{$else UseTokenInfo}
+                                 y:=_SHL;
+                                 goto exit_label;
+{$endif UseTokenInfo}
                                end;
                                end;
                         end;
                         end;
+{$ifndef UseTokenInfo}
                         yylex:=LT;
                         yylex:=LT;
                         exit;
                         exit;
+{$else UseTokenInfo}
+                        y:=LT;
+                        goto exit_label;
+{$endif UseTokenInfo}
                       end;
                       end;
                 #26 : begin
                 #26 : begin
+{$ifndef UseTokenInfo}
                         yylex:=_EOF;
                         yylex:=_EOF;
                         exit;
                         exit;
+{$else UseTokenInfo}
+                        y:=_EOF;
+                        goto exit_label;
+{$endif UseTokenInfo}
                       end;
                       end;
            else
            else
             begin
             begin
               Message(scan_f_illegal_char);
               Message(scan_f_illegal_char);
             end;
             end;
            end;
            end;
+{$ifdef UseTokenInfo}
+      exit_label:
+        new(newyylex);
+        newyylex^.token:=y;
+        newyylex^.fi.infile:=current_module^.current_inputfile;
+        newyylex^.fi.line:=current_module^.current_inputfile^.line_no;
+        yylex:=newyylex;
+{$endif UseTokenInfo}
      end;
      end;
 
 
 
 
@@ -1076,7 +1333,7 @@ unit scanner;
                   readchar;
                   readchar;
                   if c='*' then
                   if c='*' then
                    begin
                    begin
-                     skipdelphicomment;
+                     skipoldtpcomment;
                      asmgetchar:=';';
                      asmgetchar:=';';
                    end
                    end
                   else
                   else
@@ -1135,7 +1392,15 @@ unit scanner;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.11  1998-04-27 23:10:29  peter
+  Revision 1.12  1998-04-29 10:34:04  pierre
+    + added some code for ansistring (not complete nor working yet)
+    * corrected operator overloading
+    * corrected nasm output
+    + started inline procedures
+    + added starstarn : use ** for exponentiation (^ gave problems)
+    + started UseTokenInfo cond to get accurate positions
+
+  Revision 1.11  1998/04/27 23:10:29  peter
     + new scanner
     + new scanner
     * $makelib -> if smartlink
     * $makelib -> if smartlink
     * small filename fixes pmodule.setfilename
     * small filename fixes pmodule.setfilename

+ 18 - 1
compiler/systems.pas

@@ -165,12 +165,21 @@ unit systems;
             unit_env : 'GO32V2UNITS';
             unit_env : 'GO32V2UNITS';
             system_unit : 'SYSTEM';
             system_unit : 'SYSTEM';
             exeext : '.EXE';
             exeext : '.EXE';
+{$ifndef UseAnsiString}
             objext : '.O';
             objext : '.O';
             dllext : '.DLL';
             dllext : '.DLL';
             arext : '.A';
             arext : '.A';
             unitext : '.PPU';
             unitext : '.PPU';
             libext : '.PPL';
             libext : '.PPL';
             asmext : '.S';
             asmext : '.S';
+{$else UseAnsiString}
+   { just for tests }
+            objext : '.OA';
+            dllext : '.DLL';
+            unitext : '.PAU';
+            libext : '.PPL';
+            asmext : '.SA';
+{$endif UseAnsiString}
             sourceext : '.PP';
             sourceext : '.PP';
             pasext : '.PAS';
             pasext : '.PAS';
             newline : #13#10;
             newline : #13#10;
@@ -366,7 +375,15 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.4  1998-04-27 15:45:20  peter
+  Revision 1.5  1998-04-29 10:34:06  pierre
+    + added some code for ansistring (not complete nor working yet)
+    * corrected operator overloading
+    * corrected nasm output
+    + started inline procedures
+    + added starstarn : use ** for exponentiation (^ gave problems)
+    + started UseTokenInfo cond to get accurate positions
+
+  Revision 1.4  1998/04/27 15:45:20  peter
     + -Xl for smartlink
     + -Xl for smartlink
     + target_info.arext = .a
     + target_info.arext = .a
 
 

+ 14 - 12
compiler/tgeni386.pas

@@ -58,6 +58,7 @@ unit tgeni386;
     procedure setfirsttemp(l : longint);
     procedure setfirsttemp(l : longint);
     function gettempsize : longint;
     function gettempsize : longint;
     function gettempofsize(size : longint) : longint;
     function gettempofsize(size : longint) : longint;
+    procedure ungettemp(pos : longint;size : longint);
     procedure gettempofsizereference(l : longint;var ref : treference);
     procedure gettempofsizereference(l : longint;var ref : treference);
     function istemp(const ref : treference) : boolean;
     function istemp(const ref : treference) : boolean;
     procedure ungetiftemp(const ref : treference);
     procedure ungetiftemp(const ref : treference);
@@ -274,40 +275,33 @@ unit tgeni386;
 
 
     function getregister32 : tregister;
     function getregister32 : tregister;
 
 
-      var
-         r : tregister;
-
       begin
       begin
          dec(usablereg32);
          dec(usablereg32);
          if R_EAX in unused then
          if R_EAX in unused then
            begin
            begin
               unused:=unused-[R_EAX];
               unused:=unused-[R_EAX];
               usedinproc:=usedinproc or ($80 shr byte(R_EAX));
               usedinproc:=usedinproc or ($80 shr byte(R_EAX));
-              r:=R_EAX;
+              getregister32:=R_EAX;
            end
            end
          else if R_EDX in unused then
          else if R_EDX in unused then
            begin
            begin
               unused:=unused-[R_EDX];
               unused:=unused-[R_EDX];
               usedinproc:=usedinproc or ($80 shr byte(R_EDX));
               usedinproc:=usedinproc or ($80 shr byte(R_EDX));
-              r:=R_EDX;
+              getregister32:=R_EDX;
            end
            end
          else if R_EBX in unused then
          else if R_EBX in unused then
            begin
            begin
               unused:=unused-[R_EBX];
               unused:=unused-[R_EBX];
               usedinproc:=usedinproc or ($80 shr byte(R_EBX));
               usedinproc:=usedinproc or ($80 shr byte(R_EBX));
-              r:=R_EBX;
+              getregister32:=R_EBX;
            end
            end
          else if R_ECX in unused then
          else if R_ECX in unused then
            begin
            begin
               unused:=unused-[R_ECX];
               unused:=unused-[R_ECX];
               usedinproc:=usedinproc or ($80 shr byte(R_ECX));
               usedinproc:=usedinproc or ($80 shr byte(R_ECX));
-              r:=R_ECX;
+              getregister32:=R_ECX;
            end
            end
          else internalerror(10);
          else internalerror(10);
-{$ifdef REGALLOC}
-         exprasmlist^.concat(new(pairegalloc,init(r)));
-{$endif REGALLOC}
-         getregister32:=r;
       end;
       end;
 
 
     procedure cleartempgen;
     procedure cleartempgen;
@@ -601,7 +595,15 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.3  1998-04-09 22:16:36  florian
+  Revision 1.4  1998-04-29 10:34:08  pierre
+    + added some code for ansistring (not complete nor working yet)
+    * corrected operator overloading
+    * corrected nasm output
+    + started inline procedures
+    + added starstarn : use ** for exponentiation (^ gave problems)
+    + started UseTokenInfo cond to get accurate positions
+
+  Revision 1.3  1998/04/09 22:16:36  florian
     * problem with previous REGALLOC solved
     * problem with previous REGALLOC solved
     * improved property support
     * improved property support
 
 

+ 119 - 18
compiler/tree.pas

@@ -119,6 +119,8 @@ unit tree;
                    asn,             {Represents the as typecast.}
                    asn,             {Represents the as typecast.}
                    caretn,          {Represents the ^ operator.}
                    caretn,          {Represents the ^ operator.}
                    failn,           {Represents the fail statement.}
                    failn,           {Represents the fail statement.}
+                   starstarn,       {Represents the ** operator exponentiation }
+                   procinlinen,      {Procedures that can be inlined }
                    { added for optimizations where we cannot suppress }
                    { added for optimizations where we cannot suppress }
                    nothingn,
                    nothingn,
                    loadvmtn);       {???.}
                    loadvmtn);       {???.}
@@ -202,14 +204,15 @@ unit tree;
         firstpasscount : longint;
         firstpasscount : longint;
 {$endif extdebug}
 {$endif extdebug}
           case treetype : ttreetyp of
           case treetype : ttreetyp of
+             addn : (use_strconcat : boolean;string_typ : stringtype);
              callparan : (is_colon_para : boolean;exact_match_found : boolean);
              callparan : (is_colon_para : boolean;exact_match_found : boolean);
-             assignn : (assigntyp : tassigntyp);
+             assignn : (assigntyp : tassigntyp;concat_string : boolean);
              loadn : (symtableentry : psym;symtable : psymtable;
              loadn : (symtableentry : psym;symtable : psymtable;
                       is_absolute,is_first : boolean);
                       is_absolute,is_first : boolean);
              calln : (symtableprocentry : pprocsym;
              calln : (symtableprocentry : pprocsym;
                       symtableproc : psymtable;procdefinition : pprocdef;
                       symtableproc : psymtable;procdefinition : pprocdef;
                       methodpointer : ptree;
                       methodpointer : ptree;
-                      unit_specific : boolean);
+                      no_check,unit_specific : boolean);
              ordconstn : (value : longint);
              ordconstn : (value : longint);
              realconstn : (valued : bestreal;labnumber : longint;realtyp : tait);
              realconstn : (valued : bestreal;labnumber : longint;realtyp : tait);
              fixconstn : (valuef: longint);
              fixconstn : (valuef: longint);
@@ -218,10 +221,16 @@ unit tree;
 {$endif TEST_FUNCRET}
 {$endif TEST_FUNCRET}
              subscriptn : (vs : pvarsym);
              subscriptn : (vs : pvarsym);
              vecn : (memindex,memseg:boolean);
              vecn : (memindex,memseg:boolean);
-             stringconstn : (values : pstring;labstrnumber : longint);
+             { stringconstn : (length : longint; values : pstring;labstrnumber : longint); }
+             { string const can be longer then 255 with ansistring !! }
+{$ifdef UseAnsiString}
+             stringconstn : (values : pchar;length : longint; labstrnumber : longint);
+{$else UseAnsiString}
+             stringconstn : (values : pstring; labstrnumber : longint);
+{$endif UseAnsiString}
              typeconvn : (convtyp : tconverttype;explizit : boolean);
              typeconvn : (convtyp : tconverttype;explizit : boolean);
              inlinen : (inlinenumber : longint);
              inlinen : (inlinenumber : longint);
-             { procinlinen : (proc : pprocsym); }
+             procinlinen : (inlineprocdef : pprocdef);
              setconstrn : (constset : pconstset);
              setconstrn : (constset : pconstset);
              loopn : (t1,t2 : ptree;backward : boolean);
              loopn : (t1,t2 : ptree;backward : boolean);
              asmn : (p_asm : paasmoutput);
              asmn : (p_asm : paasmoutput);
@@ -243,12 +252,19 @@ unit tree;
     function genrealconstnode(v : bestreal) : ptree;
     function genrealconstnode(v : bestreal) : ptree;
     function gencallnode(v : pprocsym;st : psymtable) : ptree;
     function gencallnode(v : pprocsym;st : psymtable) : ptree;
     function genmethodcallnode(v : pprocsym;st : psymtable;mp : ptree) : ptree;
     function genmethodcallnode(v : pprocsym;st : psymtable;mp : ptree) : ptree;
+
+    { allow pchar or string for defining a pchar node }
     function genstringconstnode(const s : string) : ptree;
     function genstringconstnode(const s : string) : ptree;
+{$ifdef UseAnsiString}
+    { length is required for ansistrings }
+    function genpcharconstnode(s : pchar;length : longint) : ptree;
+    { helper routine for conststring node }
+    function getpcharcopy(p : ptree) : pchar;
+{$endif UseAnsiString}
+
     function genzeronode(t : ttreetyp) : ptree;
     function genzeronode(t : ttreetyp) : ptree;
     function geninlinenode(number : longint;l : ptree) : ptree;
     function geninlinenode(number : longint;l : ptree) : ptree;
-   {
-   function genprocinlinenode(code : ptree;procsym : pprocsym) : ptree;
-   }
+    function genprocinlinenode(callp,code : ptree) : ptree;
     function gentypedconstloadnode(sym : ptypedconstsym;st : psymtable) : ptree;
     function gentypedconstloadnode(sym : ptypedconstsym;st : psymtable) : ptree;
     function genenumnode(v : penumsym) : ptree;
     function genenumnode(v : penumsym) : ptree;
     function genselfnode(_class : pdef) : ptree;
     function genselfnode(_class : pdef) : ptree;
@@ -269,6 +285,7 @@ unit tree;
     procedure set_location(var destloc,sourceloc : tlocation);
     procedure set_location(var destloc,sourceloc : tlocation);
     procedure swap_location(var destloc,sourceloc : tlocation);
     procedure swap_location(var destloc,sourceloc : tlocation);
     procedure set_file_line(from,_to : ptree);
     procedure set_file_line(from,_to : ptree);
+    procedure set_tree_filepos(p : ptree;const filepos : tfileposinfo);
 
 
 {$ifdef extdebug}
 {$ifdef extdebug}
     const
     const
@@ -354,8 +371,13 @@ unit tree;
            assigned(p^.location.reference.symbol) then
            assigned(p^.location.reference.symbol) then
            stringdispose(p^.location.reference.symbol);
            stringdispose(p^.location.reference.symbol);
 
 
+{$ifndef UseAnsiString}
          if p^.disposetyp=dt_string then
          if p^.disposetyp=dt_string then
            stringdispose(p^.values);
            stringdispose(p^.values);
+{$else UseAnsiString}
+         if p^.disposetyp=dt_string then
+           ansistringdispose(p^.values,p^.length);
+{$endif UseAnsiString}
 {$ifdef extdebug}
 {$ifdef extdebug}
          if p^.firstpasscount>maxfirstpasscount then
          if p^.firstpasscount>maxfirstpasscount then
             maxfirstpasscount:=p^.firstpasscount;
             maxfirstpasscount:=p^.firstpasscount;
@@ -408,7 +430,14 @@ unit tree;
                  if assigned(p^.t2) then
                  if assigned(p^.t2) then
                    hp^.t2:=getcopy(p^.t2);
                    hp^.t2:=getcopy(p^.t2);
               end;
               end;
+{$ifdef UseAnsiString}
+            dt_string : begin
+                           hp^.values:=getpcharcopy(p);
+                           hp^.length:=p^.length;
+                        end;
+{$else UseAnsiString}
             dt_string : hp^.values:=stringdup(p^.values^);
             dt_string : hp^.values:=stringdup(p^.values^);
+{$endif UseAnsiString}
             dt_typeconv : hp^.left:=getcopy(p^.left);
             dt_typeconv : hp^.left:=getcopy(p^.left);
             dt_inlinen :
             dt_inlinen :
               if assigned(p^.left) then
               if assigned(p^.left) then
@@ -464,7 +493,11 @@ unit tree;
                  if assigned(p^.left) then disposetree(p^.left);
                  if assigned(p^.left) then disposetree(p^.left);
                  disposetree(p^.methodpointer);
                  disposetree(p^.methodpointer);
               end;
               end;
+{$ifdef UseAnsiString}
+            dt_string : ansistringdispose(p^.values,p^.length);
+{$else UseAnsiString}
             dt_string : stringdispose(p^.values);
             dt_string : stringdispose(p^.values);
+{$endif UseAnsiString}
             dt_constset :
             dt_constset :
               begin
               begin
                  if assigned(p^.constset) then
                  if assigned(p^.constset) then
@@ -514,6 +547,12 @@ unit tree;
            end;
            end;
       end;
       end;
 
 
+   procedure set_tree_filepos(p : ptree;const filepos : tfileposinfo);
+     begin
+        p^.line:=filepos.line;
+        p^.inputfile:=filepos.infile;
+     end;
+
    function genwithnode(symtable : psymtable;l,r : ptree;count : longint) : ptree;
    function genwithnode(symtable : psymtable;l,r : ptree;count : longint) : ptree;
 
 
       var
       var
@@ -733,7 +772,9 @@ unit tree;
 
 
       var
       var
          p : ptree;
          p : ptree;
-
+{$ifdef UseAnsiString}
+         l : longint;
+{$endif UseAnsiString}
       begin
       begin
          p:=getnode;
          p:=getnode;
          p^.disposetyp:=dt_string;
          p^.disposetyp:=dt_string;
@@ -746,11 +787,60 @@ unit tree;
          p^.registersmmx:=0;
          p^.registersmmx:=0;
 {$endif SUPPORT_MMX}
 {$endif SUPPORT_MMX}
          p^.resulttype:=cstringdef;
          p^.resulttype:=cstringdef;
+{$ifdef UseAnsiString}
+         l:=length(s);
+         p^.length:=l;
+         { stringdup write even past a #0 }
+         getmem(p^.values,l+1);
+         move(s[1],p^.values^,l);
+         p^.values[l]:=#0;
+{$else UseAnsiString}
          p^.values:=stringdup(s);
          p^.values:=stringdup(s);
+{$endif UseAnsiString}
          p^.labstrnumber:=-1;
          p^.labstrnumber:=-1;
          genstringconstnode:=p;
          genstringconstnode:=p;
       end;
       end;
 
 
+{$ifdef UseAnsiString}
+    function getpcharcopy(p : ptree) : pchar;
+
+      var
+         pc : pchar;
+
+      begin
+         pc:=nil;
+         getmem(pc,p^.length+1);
+         { Peter can you change that ? }
+         if pc=nil then
+           comment(V_fatal,'No memory left');
+         move(p^.values^,pc^,p^.length+1);
+         getpcharcopy:=pc;
+      end;
+
+    function genpcharconstnode(s : pchar;length : longint) : ptree;
+
+      var
+         p : ptree;
+
+      begin
+         p:=getnode;
+         p^.disposetyp:=dt_string;
+         p^.treetype:=stringconstn;
+         p^.registers32:=0;
+{         p^.registers16:=0;
+         p^.registers8:=0; }
+         p^.registersfpu:=0;
+{$ifdef SUPPORT_MMX}
+         p^.registersmmx:=0;
+{$endif SUPPORT_MMX}
+         p^.resulttype:=cstringdef;
+         p^.length:=length;
+         p^.values:=s;
+         p^.labstrnumber:=-1;
+         genpcharconstnode:=p;
+      end;
+{$endif UseAnsiString}
+
     function gensinglenode(t : ttreetyp;l : ptree) : ptree;
     function gensinglenode(t : ttreetyp;l : ptree) : ptree;
 
 
       var
       var
@@ -881,6 +971,7 @@ unit tree;
          p^.symtableprocentry:=v;
          p^.symtableprocentry:=v;
          p^.symtableproc:=st;
          p^.symtableproc:=st;
          p^.unit_specific:=false;
          p^.unit_specific:=false;
+         p^.no_check:=false;
          p^.disposetyp := dt_leftright;
          p^.disposetyp := dt_leftright;
          p^.methodpointer:=nil;
          p^.methodpointer:=nil;
          p^.left:=nil;
          p^.left:=nil;
@@ -1023,25 +1114,27 @@ unit tree;
       end;
       end;
 
 
 
 
-{    function genprocinlinenode(code : ptree;proc : pprocsym) : ptree;
+      { uses the callnode to create the new procinline node }
+    function genprocinlinenode(callp,code : ptree) : ptree;
 
 
       var
       var
          p : ptree;
          p : ptree;
 
 
       begin
       begin
          p:=getnode;
          p:=getnode;
-         p^.disposetyp:=dt_inlinen;
-         p^.treetype:=inlinen;
-         p^.inlineproc:=proc;
-         p^.left:=code;
+         p^.disposetyp:=dt_left;
+         p^.treetype:=procinlinen;
+         p^.inlineprocdef:=callp^.procdefinition;
+         { copy args }
+         p^.left:=getcopy(code);
          p^.registers32:=code^.registers32;
          p^.registers32:=code^.registers32;
          p^.registersfpu:=code^.registersfpu;
          p^.registersfpu:=code^.registersfpu;
-$ifdef SUPPORT_MMX
+{$ifdef SUPPORT_MMX}
          p^.registersmmx:=0;
          p^.registersmmx:=0;
-$endif SUPPORT_MMX
-         p^.resulttype:=proc^.definition^.returntype;
+{$endif SUPPORT_MMX}
+         p^.resulttype:=p^.inlineprocdef^.retdef;
          genprocinlinenode:=p;
          genprocinlinenode:=p;
-      end; }
+      end;
 
 
    function gensetconstruktnode(s : pconstset;settype : psetdef) : ptree;
    function gensetconstruktnode(s : pconstset;settype : psetdef) : ptree;
 
 
@@ -1160,7 +1253,15 @@ $endif SUPPORT_MMX
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.3  1998-04-21 10:16:49  peter
+  Revision 1.4  1998-04-29 10:34:08  pierre
+    + added some code for ansistring (not complete nor working yet)
+    * corrected operator overloading
+    * corrected nasm output
+    + started inline procedures
+    + added starstarn : use ** for exponentiation (^ gave problems)
+    + started UseTokenInfo cond to get accurate positions
+
+  Revision 1.3  1998/04/21 10:16:49  peter
     * patches from strasbourg
     * patches from strasbourg
     * objects is not used anymore in the fpc compiled version
     * objects is not used anymore in the fpc compiled version
 
 

+ 19 - 1
compiler/types.pas

@@ -37,6 +37,9 @@ unit types;
     { true if p points to an open array def }
     { true if p points to an open array def }
     function is_open_array(p : pdef) : boolean;
     function is_open_array(p : pdef) : boolean;
 
 
+    { true if o is an ansi string def }
+    function is_ansistring(p : pdef) : boolean;
+
     { returns true, if def defines a signed data type (only for ordinal types) }
     { returns true, if def defines a signed data type (only for ordinal types) }
     function is_signed(def : pdef) : boolean;
     function is_signed(def : pdef) : boolean;
 
 
@@ -218,6 +221,13 @@ unit types;
                  (parraydef(p)^.highrange=-1);
                  (parraydef(p)^.highrange=-1);
       end;
       end;
 
 
+    { true if o is an ansi string def }
+    function is_ansistring(p : pdef) : boolean;
+      begin
+         is_ansistring:=(p^.deftype=stringdef) and
+                 (pstringdef(p)^.string_typ=ansistring);
+      end;
+
     { true if the return value is in accumulator (EAX for i386), D0 for 68k }
     { true if the return value is in accumulator (EAX for i386), D0 for 68k }
     function ret_in_acc(def : pdef) : boolean;
     function ret_in_acc(def : pdef) : boolean;
 
 
@@ -925,7 +935,15 @@ unit types;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.9  1998-04-21 10:16:49  peter
+  Revision 1.10  1998-04-29 10:34:08  pierre
+    + added some code for ansistring (not complete nor working yet)
+    * corrected operator overloading
+    * corrected nasm output
+    + started inline procedures
+    + added starstarn : use ** for exponentiation (^ gave problems)
+    + started UseTokenInfo cond to get accurate positions
+
+  Revision 1.9  1998/04/21 10:16:49  peter
     * patches from strasbourg
     * patches from strasbourg
     * objects is not used anymore in the fpc compiled version
     * objects is not used anymore in the fpc compiled version
 
 

+ 7 - 4
compiler/verb_def.pas

@@ -242,10 +242,13 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.3  1998-04-21 15:22:46  pierre
-    * typing error in secondadd for mmx corrected
-    * USE_RHIDE sets usestderr to true
-      replacing gpc by fpc in RHIDE should be a lot easier
+  Revision 1.4  1998-04-29 10:34:09  pierre
+    + added some code for ansistring (not complete nor working yet)
+    * corrected operator overloading
+    * corrected nasm output
+    + started inline procedures
+    + added starstarn : use ** for exponentiation (^ gave problems)
+    + started UseTokenInfo cond to get accurate positions
 
 
   Revision 1.2  1998/03/28 23:09:57  florian
   Revision 1.2  1998/03/28 23:09:57  florian
     * secondin bugfix (m68k and i386)
     * secondin bugfix (m68k and i386)