瀏覽代碼

+ 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 年之前
父節點
當前提交
5cdd60cac8

+ 71 - 9
compiler/aasm.pas

@@ -29,6 +29,11 @@ unit aasm;
 
 {$I version.inc}
     type
+{$ifdef klaempfl}
+{$ifdef ver0_9_2}
+       extended = double;
+{$endif ver0_9_2}
+{$endif klaempfl}
        tait = (
           ait_string,
           ait_label,
@@ -84,6 +89,7 @@ unit aasm;
           len : longint;
           constructor init(const _str : string);
           constructor init_pchar(_str : pchar);
+          constructor init_length_pchar(_str : pchar;length : longint);
           destructor done;virtual;
        end;
 
@@ -141,6 +147,15 @@ unit aasm;
           destructor done; virtual;
        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 }
        pai_align = ^tai_align;
@@ -193,6 +208,16 @@ unit aasm;
           constructor init(_value : double);
        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;
 
        { generates a single (32 bit real) }
@@ -241,14 +266,6 @@ type
        tai_bestreal = tai_single;
 {$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;
        taasmoutput = tlinkedlist;
 
@@ -542,6 +559,14 @@ type
          value:=_value;
       end;
 
+    constructor tai_comp.init_comp(_value : comp);
+
+      begin
+         inherited init;
+         typ:=ait_comp;
+         value:=_value;
+      end;
+
 {****************************************************************************
                                TAI_STRING
  ****************************************************************************}
@@ -565,6 +590,15 @@ type
           len:=strlen(_str);
        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;
 
       begin
@@ -619,6 +653,26 @@ type
          inherited done;
       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
  ****************************************************************************}
@@ -667,7 +721,15 @@ type
 end.
 {
   $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
     * $makelib -> if smartlink
     * small filename fixes pmodule.setfilename

+ 40 - 15
compiler/ag386int.pas

@@ -179,12 +179,12 @@ unit ag386int;
                          S_B : hs:='byte '+hs;
                          S_W : hs:='word '+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
                              hs:='word '+hs
                            else
@@ -210,6 +210,12 @@ unit ag386int;
                S_B : hs:='byte ptr '+hs;
                S_W : hs:='word 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
                    hs:='word ptr '+hs
                  else
@@ -316,7 +322,12 @@ unit ag386int;
       while assigned(hp) do
        begin
          case hp^.typ of
-       ait_comment : ;
+           ait_comment :
+             Begin
+                AsmWrite(As_comment);
+                AsmWritePChar(pai_asm_comment(hp)^.str);
+                AsmLn;
+             End;
          ait_align : begin
                      { align not supported at all with nasm v095  }
                      { align with specific value not supported by }
@@ -324,8 +335,8 @@ unit ag386int;
                      { CAUSES PROBLEMS WITH THE SEGMENT DEFINITION   }
                      { SEGMENT DEFINITION SHOULD MATCH TYPE OF ALIGN }
                      { 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;
       ait_external : begin
                        if current_module^.output_format in [of_nasm,of_obj] then
@@ -541,8 +552,12 @@ ait_labeled_instruction :
                            begin
                              if output_format=of_nasm then
                               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
-                              s:='near ptr '+getopstr_jmp(pai386(hp)^.op1t,pai386(hp)^.op1);
+                                s:='near ptr '+getopstr_jmp(pai386(hp)^.op1t,pai386(hp)^.op1);
                            end
                           else
                            begin
@@ -602,6 +617,7 @@ ait_stab_function_name : ;
 
 
     procedure ti386intasmlist.WriteAsmList;
+
     begin
 {$ifdef EXTDEBUG}
       if assigned(current_module^.mainsource) then
@@ -635,21 +651,22 @@ ait_stab_function_name : ;
        end
       else
        begin
-         AsmWriteLn('.386p');
+         AsmWriteLn(#9'.386p');
+         AsmWriteLn(#9'LOCALS '+target_info.labelprefix);
 
          WriteTree(externals);
          { INTEL ASM doesn't support stabs
          WriteTree(debuglist);}
 
          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');
          AsmLn;
          WriteTree(codesegment);
          AsmWriteLn('_TEXT'#9#9'ENDS');
 
          AsmLn;
-         AsmWriteLn('_DATA'#9#9'SEGMENT'#9'DWORD PUBLIC USE32 ''DATA''');
+         AsmWriteLn('_DATA'#9#9'SEGMENT'#9'PARA PUBLIC USE32 ''DATA''');
 {$ifdef EXTDEBUG}
          AsmWriteLn(#9#9'DB'#9'"compiled by FPC '+version_string+'\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');
 
          AsmLn;
-         AsmWriteLn('_BSS'#9#9'SEGMENT'#9'DWORD PUBLIC USE32 ''BSS''');
+         AsmWriteLn('_BSS'#9#9'SEGMENT'#9'PARA PUBLIC USE32 ''BSS''');
          WriteTree(bsssegment);
          AsmWriteLn('_BSS'#9#9'ENDS');
 
@@ -675,7 +692,15 @@ ait_stab_function_name : ;
 end.
 {
   $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
       ADD ADC and AND are also sign extended
       nasm output OK (program still crashes at end

+ 16 - 3
compiler/ag68kgas.pas

@@ -243,7 +243,12 @@ unit ag68kgas;
 {$endif GDB}
 
          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_align : AsmWriteLn(#9'.align '+tostr(pai_align(hp)^.aligntype));
      ait_datablock : begin
@@ -548,8 +553,16 @@ ait_stab_function_name : funcname:=pai_stab_function_name(hp)^.str;
 end.
 {
   $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
     * changes of Carl-Eric to m68k target commit:

+ 16 - 3
compiler/ag68kmit.pas

@@ -279,7 +279,12 @@ unit ag68kmit;
           end;
 {$endif GDB}
          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_align : AsmWriteLn(#9'.align '+tostr(pai_align(hp)^.aligntype));
      ait_datablock : begin
@@ -588,8 +593,16 @@ ait_stab_function_name : funcname:=pai_stab_function_name(hp)^.str;
 end.
 {
   $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
     * changes of Carl-Eric to m68k target commit:

+ 16 - 3
compiler/ag68kmot.pas

@@ -226,7 +226,12 @@ unit ag68kmot;
       while assigned(hp) do
        begin
          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_external : AsmWriteLn(#9'XREF'#9+StrPas(pai_external(hp)^.name));
  ait_real_extended : Message(assem_e_extended_not_supported);
@@ -493,8 +498,16 @@ ait_labeled_instruction :
 end.
 {
   $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
     * 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
           Begin
             RegsNotYetChecked := RegsNotYetChecked - [Reg32(TRegister(Pai386(oldp)^.op1))];
-            If Assigned(newp^.Last)
+            If Assigned(newp^.previous)
               Then
                 Begin
-                  TmpP := Pai(newp^.last);
-                  While Assigned (TmpP^.Last) And
+                  TmpP := Pai(newp^.previous);
+                  While Assigned (TmpP^.previous) And
                         PPaiProp(TmpP^.Line)^.CanBeRemoved Do
-                    TmpP := Pai(TmpP^.Last);
+                    TmpP := Pai(TmpP^.previous);
                   TmpResult := Assigned(TmpP) And
                                RegsSameContent(oldp, TmpP, Reg32(TRegister(Pai386(oldp)^.op1)))
                 End
@@ -656,13 +656,13 @@ Begin
                (Base <> R_NO) Then
               Begin
                 RegsNotYetChecked := RegsNotYetChecked - [Base];
-                If Assigned(newp^.Last)
+                If Assigned(newp^.previous)
                   Then
                     Begin
-                      TmpP := Pai(newp^.last);
-                      While Assigned (TmpP^.Last) And
+                      TmpP := Pai(newp^.previous);
+                      While Assigned (TmpP^.previous) And
                             PPaiProp(TmpP^.Line)^.CanBeRemoved Do
-                        TmpP := Pai(TmpP^.Last);
+                        TmpP := Pai(TmpP^.previous);
                       TmpResult := Assigned(TmpP) And
                                    RegsSameContent(oldp, TmpP, Base)
                     End
@@ -673,13 +673,13 @@ Begin
                (Index in RegsNotYetChecked) Then
               Begin
                 RegsNotYetChecked := RegsNotYetChecked - [Index];
-                If Assigned(newp^.Last)
+                If Assigned(newp^.previous)
                   Then
                     Begin
-                      TmpP := Pai(newp^.last);
-                      While Assigned (TmpP^.Last) And
+                      TmpP := Pai(newp^.previous);
+                      While Assigned (TmpP^.previous) And
                             PPaiProp(TmpP^.Line)^.CanBeRemoved Do
-                        TmpP := Pai(TmpP^.Last);
+                        TmpP := Pai(TmpP^.previous);
                       TmpResult := Assigned(TmpP) And
                                    RegsSameContent(oldp, TmpP, Index)
                     End
@@ -693,13 +693,13 @@ End;
 Begin {CheckSequence}
   Reg := Reg32(Reg);
   Found := 0;
-  hp2 := PPaiProp(Pai(p^.last)^.line)^.Regs[Reg].StartMod;
+  hp2 := PPaiProp(Pai(p^.previous)^.line)^.Regs[Reg].StartMod;
   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];
-  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);
-  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
          NoChangedRegInRef(EndMod, hp3) Do
     Begin
@@ -707,10 +707,10 @@ Begin {CheckSequence}
       hp3 := Pai(hp3^.next);
       Inc(Found)
     End;
-  If (Found <> PPaiProp(Pai(p^.last)^.line)^.Regs[Reg].NrOfMods)
+  If (Found <> PPaiProp(Pai(p^.previous)^.line)^.Regs[Reg].NrOfMods)
      Then
        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
            (Pai(hp2)^.typ = ait_instruction) And
            (Pai386(hp2)^._operator In [A_MOV, A_MOVZX]) And
@@ -821,7 +821,7 @@ Begin
         Then TmpProp := @PaiPropBlock^[InstrCnt]
         Else New(TmpProp);
       If (p <> First)
-        Then TmpProp^ := PPaiProp(Pai(p^.last)^.line)^
+        Then TmpProp^ := PPaiProp(Pai(p^.previous)^.line)^
         Else FillChar(TmpProp^, SizeOf(TmpProp^), 0);
       TmpProp^.LineSave := p^.line;
       PPaiProp(p^.line) := TmpProp;
@@ -993,8 +993,8 @@ Begin
         ait_instruction:
           Begin
             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;
 {$IfDef OptimizeMovs}
               A_MOV, A_MOVZX, A_MOVSX:
@@ -1009,8 +1009,8 @@ Begin
                       Begin {destination is always a register in this case}
                         With PPaiProp(p^.line)^.Regs[Reg32(Tregister(Pai386(p)^.op2))] Do
                           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}
                                If CheckSequence(p, TRegister(Pai386(p)^.op2), Cnt) And
                                   (Cnt > 0)
@@ -1067,8 +1067,8 @@ Begin
                         Case Pai386(p)^.op2t Of
                           Top_Reg:
                             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
                                      (StartMod = Pai386(p)^.op1) Then
                                     PPaiProp(p^.line)^.CanBeRemoved := True;
@@ -1079,17 +1079,17 @@ Begin
                   End;
                 End;
 {$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;
               A_XOR:
                 Begin
                   If (Pai386(p)^.op1t = top_reg) And
                      (Pai386(p)^.op2t = top_reg) 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
                 End
             End
@@ -1148,7 +1148,7 @@ Var p: Pai;
 Begin
   P := Pai(AsmL^.First);
   NrOfPaiObjs := 1;
-  While (P <> Pai(AsmL^.Last)) Do
+  While (P <> Pai(AsmL^.last)) Do
     Begin
       Inc(NrOfPaiObjs);
       P := Pai(P^.next)
@@ -1191,7 +1191,15 @@ End;
 
 {
  $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
 
  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}
   Begin
     GetLastInstruction := False;
-    Current := Pai(Current^.Last);
+    Current := Pai(Current^.previous);
     While Assigned(Current) And
           (Pai(Current)^.typ In SkipInstr) Do
-      Current := Pai(Current^.Last);
+      Current := Pai(Current^.previous);
     If Assigned(Current)
       Then
         Begin
@@ -222,10 +222,10 @@ End;
               Begin
                 If Assigned(new_one) Then
                   Begin
-                    new_one^.last := prev;
+                    new_one^.previous := prev;
                     new_one^.next := foll;
                     prev^.next := new_one;
-                    foll^.last := new_one;
+                    foll^.previous := new_one;
                   End;
               End
             Else AsmL^.Concat(new_one)
@@ -517,7 +517,7 @@ End;
                                    Else hp1 := New(Pai386, op_ref_reg(A_LEA, S_L, TmpRef,
                                     TRegister(twowords(Pai386(p)^.op2).word2)));
                                  hp1^.line := p^.line;
-                                 InsertLLItem(p^.last, p^.next, hp1);
+                                 InsertLLItem(p^.previous, p^.next, hp1);
                                  Dispose(p, Done);
                                  p := hp1;
                               End;
@@ -534,7 +534,7 @@ End;
                                   Else hp1 := New(Pai386, op_ref_reg(A_LEA, S_L, TmpRef,
                                    TRegister(twowords(Pai386(p)^.op2).word2)));
                                 hp1^.line:= p^.line;
-                                InsertLLItem(p^.last, p^.next, hp1);
+                                InsertLLItem(p^.previous, p^.next, hp1);
                                 Dispose(p, Done);
                                 p := hp1;
                               End;
@@ -585,7 +585,7 @@ End;
                                             hp1 :=  New(Pai386, op_ref_reg(A_LEA, S_L, TmpRef, TRegister(Pai386(p)^.op2)));
                                           End;
                                       hp1^.line := p^.line;
-                                      InsertLLItem(p^.last, p^.next, hp1);
+                                      InsertLLItem(p^.previous, p^.next, hp1);
                                       Dispose(p, Done);
                                       p := Pai(hp1^.next);
                                     End
@@ -604,7 +604,7 @@ End;
                                      Else hp1 := New(Pai386, op_ref_reg(A_LEA, S_L, TmpRef,
                                       TRegister(twowords(Pai386(p)^.op2).word2)));
                                    hp1^.line := p^.line;
-                                   InsertLLItem(p^.last, p^.next, hp1);
+                                   InsertLLItem(p^.previous, p^.next, hp1);
                                    Dispose(p, Done);
                                    p := hp1;
                                  End;
@@ -637,7 +637,7 @@ End;
                                            hp1 :=  New(Pai386, op_ref_reg(A_LEA, S_L, TmpRef,
                                              TRegister(Pai386(p)^.op2)));
                                      hp1^.line := p^.line;
-                                     InsertLLItem(p^.last, p^.next, hp1);
+                                     InsertLLItem(p^.previous, p^.next, hp1);
                                      Dispose(p, Done);
                                      p := Pai(hp1^.next);
                                    End
@@ -693,7 +693,7 @@ End;
                                                TRegister(Pai386(p)^.op2)));
                                            End;
                                        hp1^.line := p^.line;
-                                       InsertLLItem(p^.last, p^.next, hp1);
+                                       InsertLLItem(p^.previous, p^.next, hp1);
                                        Dispose(p, Done);
                                        p := Pai(hp1^.next);
                                      End
@@ -715,7 +715,7 @@ End;
                          hp1 := New(Pai386, op_reg_reg(A_MOV, S_L,PReference(Pai386(p)^.op1)^.Base,
                            TRegister(Pai386(p)^.op2)));
                          hp1^.line := p^.line;
-                         InsertLLItem(p^.last,p^.next, hp1);
+                         InsertLLItem(p^.previous,p^.next, hp1);
                          Dispose(p, Done);
                          p := hp1;
                          Continue;
@@ -1113,7 +1113,7 @@ End;
                                                              TRegister(Pai386(p)^.op2),
                                                              TRegister(Pai386(p)^.op2)));
                                                   hp1^.line := p^.line;
-                                                  InsertLLItem(p^.last, p, hp1);
+                                                  InsertLLItem(p^.previous, p, hp1);
                                                   Pai386(p)^._operator := A_MOV;
                                                   Pai386(p)^.size := S_B;
                                                   Pai386(p)^.op2 :=
@@ -1172,7 +1172,7 @@ End;
                                       Pai386(p)^._operator := A_MOV;
                                       Pai386(p)^.size := S_B;
                                       Pai386(p)^.op2 := Pointer(Reg32ToReg8(TRegister(Pai386(p)^.op2)));
-                                      InsertLLItem(p^.last, p, hp1);
+                                      InsertLLItem(p^.previous, p, hp1);
                                     End
                                   Else
                                     If {Assigned(p^.next) And}
@@ -1331,7 +1331,7 @@ End;
                                          Else hp1 := New(Pai386, op_ref_reg(A_LEA, S_L, TmpRef,
                                                          TRegister(Pai386(p)^.op2)));
                                        hp1^.line := p^.line;
-                                       InsertLLItem(p^.last, p^.next, hp1);
+                                       InsertLLItem(p^.previous, p^.next, hp1);
                                        Dispose(p, Done);
                                        p := hp1;
                                      End;
@@ -1349,7 +1349,7 @@ End;
                                      hp1 := new(Pai386,op_reg_reg(A_ADD,Pai386(p)^.Size,
                                                 TRegister(Pai386(p)^.op2), TRegister(Pai386(p)^.op2)));
                                      hp1^.line := p^.line;
-                                     InsertLLItem(p^.last, p^.next, hp1);
+                                     InsertLLItem(p^.previous, p^.next, hp1);
                                      Dispose(p, done);
                                      p := hp1;
                                    End
@@ -1368,7 +1368,7 @@ End;
                                             TmpRef^.offset := 0;
                                             hp1 := new(Pai386,op_ref_reg(A_LEA,S_L,TmpRef, TRegister(Pai386(p)^.op2)));
                                             hp1^.line := p^.line;
-                                            InsertLLItem(p^.last, p^.next, hp1);
+                                            InsertLLItem(p^.previous, p^.next, hp1);
                                             Dispose(p, done);
                                             p := hp1;
                                           End
@@ -1460,7 +1460,7 @@ End;
                                  Continue
                                End
                              Else
-                               If {Assigned(p^.last) And}
+                               If {Assigned(p^.previous) And}
                                   GetLastInstruction(p, hp1) And
                                   (Pai(hp1)^.typ = ait_instruction) And
                                   (Pai386(hp1)^._operator = A_SUB) And
@@ -1469,7 +1469,7 @@ End;
                                   (TRegister(Pai386(hp1)^.Op2) = R_ESP)
                                  Then
                                    Begin
-{                                   hp1 := Pai(p^.last);}
+{                                   hp1 := Pai(p^.previous);}
                                     Inc(Longint(Pai386(p)^.op1), Longint(Pai386(hp1)^.op1));
                                     AsmL^.Remove(hp1);
                                     Dispose(hp1, Done);
@@ -1485,7 +1485,7 @@ End;
                     as the first instruction already adjusts the ZF}
                     Begin
                       If (Pai386(p)^.op1 = Pai386(p)^.op2) And
-{                        (assigned(p^.last)) And}
+{                        (assigned(p^.previous)) And}
                          GetLastInstruction(p, hp1) And
                          (pai(hp1)^.typ = ait_instruction) Then
                          Case Pai386(hp1)^._operator Of
@@ -1615,7 +1615,15 @@ end;
 End.
 {
   $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
 
   Revision 1.6  1998/04/21 11:30:14  peter

+ 21 - 13
compiler/asmutils.pas

@@ -1236,10 +1236,10 @@ end;
            Begin
              case pvarsym(sym)^.getsize of
               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
                { this is in the case where the instruction is LEA }
                { or something like that, in that case size is not }
@@ -1277,8 +1277,8 @@ end;
               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;
+              8: instr.operands[operandnum].size := S_IQ;
+              extended_size: instr.operands[operandnum].size := S_FX;
              else}
                {* this is in the case where the instruction is LEA *}
                {* or something like that, in that case size is not *}
@@ -1317,8 +1317,8 @@ end;
                  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;
+                 8: instr.operands[operandnum].size := S_IQ;
+                 extended_size: instr.operands[operandnum].size := S_FX;
                else
                { this is in the case where the instruction is LEA }
                { or something like that, in that case size is not }
@@ -1354,7 +1354,7 @@ end;
              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;
+             8: instr.operands[operandnum].size := S_IQ;
            else
            { this is in the case where the instruction is LEA }
            { or something like that, in that case size is not }
@@ -1371,7 +1371,7 @@ end;
               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;
+              8: instr.operands[operandnum].size := S_IQ;
             else
             { this is in the case where the instruction is LEA }
             { or something like that, in that case size is not }
@@ -1459,7 +1459,7 @@ end;
    pc: PChar;
   Begin
      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;
 
   Procedure ConcatPasString(p : paasmoutput;s:string);
@@ -1626,8 +1626,16 @@ end;
 end.
 {
   $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
     * all files have the same header

+ 24 - 7
compiler/assemble.pas

@@ -37,11 +37,17 @@ const
 
 {$ifdef i386}
 { 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}
 {$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}
 
 
@@ -218,12 +224,15 @@ begin
             end;
 {$endif}
 {$ifdef m68k}
-     of_o,
    of_mot,
-   of_mit,
-   of_gas : begin
+   of_mit : begin
             { !! Nothing yet !! }
             end;
+   of_o,of_gas : begin
+              if CallAssembler(FindAssembler(of_gas),'  --register-prefix-optional'+
+              ' -o '+objfile+' '+asmfile) then
+               RemoveAsm;
+            end;
 {$endif}
   else
    internalerror(30000);
@@ -464,7 +473,15 @@ end;
 end.
 {
   $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
     * $makelib -> if smartlink
     * small filename fixes pmodule.setfilename

+ 14 - 5
compiler/cg68k.pas

@@ -594,6 +594,7 @@ implementation
 
       begin
          { an fix comma const. behaves as a memory reference }
+
          p^.location.loc:=LOC_MEM;
          p^.location.reference.isintvalue:=true;
          p^.location.reference.offset:=p^.valuef;
@@ -717,7 +718,7 @@ implementation
                                        exprasmlist^.concat(new(pai68k,op_const_reg(A_BCHG,S_L,31,
                                           p^.location.fpureg)))
                                    else
-                                       exprasmlist^.concat(new(pai68k,op_reg(A_FNEG,S_X,
+                                       exprasmlist^.concat(new(pai68k,op_reg(A_FNEG,S_FX,
                                           p^.location.fpureg)));
                                 end
                               else
@@ -735,7 +736,7 @@ implementation
                               if (cs_fp_emulation) in aktswitches then
                                   exprasmlist^.concat(new(pai68k,op_const_reg(A_BCHG,S_L,31,p^.location.fpureg)))
                               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;
 {         emitoverflowcheck;}
@@ -1934,7 +1935,7 @@ implementation
 {           for u32bit a solution would be to push $0 and to load a
 +          comp
 +           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}
           p^.location.loc := LOC_FPU;
           { get floating point register. }
@@ -4286,7 +4287,7 @@ implementation
                           emit_reg_reg(A_MOVE,S_L,p^.left^.location.fpureg,R_D0)
                         else
                           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
@@ -5098,7 +5099,15 @@ end.
 
 {
   $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
     + packed object/class/array
 

+ 13 - 5
compiler/cg68k2.pas

@@ -771,15 +771,15 @@ Implementation
                                       R_FP1)))
                                   else
                                     { 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 }
-                                  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)));
 
                                   { cmpop does not change any floating point register!! }
                                   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,
                                        getfloatsize(pfloatdef(p^.left^.resulttype)^.typ),
                                        R_FP1,p^.left^.location.fpureg)))}
@@ -835,7 +835,7 @@ Implementation
                                emit_reg_reg(A_FMOVE,getfloatsize(pfloatdef(p^.left^.resulttype)^.typ),
                                  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
                                  processcc(p);
@@ -1921,7 +1921,15 @@ Implementation
 end.
 {
   $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)
     * overflow checking bugfix (m68k and i386) -- pretty useless in
       secondadd, since everything is done using 32-bit

+ 22 - 17
compiler/cga68k.pas

@@ -269,9 +269,9 @@ unit cga68k;
     function getfloatsize(t: tfloattype): topsize;
     begin
       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}
     else {else case }
       begin
@@ -624,9 +624,6 @@ begin
 {$endif GDB}
     { Alignment required for Motorola }
     procinfo.aktentrycode^.insert(new(pai_align,init(2)));
-{$ifdef extdebug}
-    procinfo.aktentrycode^.insert(new(pai_direct,init(strpnew(target_info.newline))));
-{$endif extdebug}
 end;
 
 {Generate the exit code for a procedure.}
@@ -1072,9 +1069,9 @@ end;
       begin
         { no emulation }
         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
            begin
              Message(cg_f_unknown_float_type);
@@ -1106,19 +1103,19 @@ end;
          case t of
             s32real : begin
                          op:=A_FSTP;
-                         s:=S_S;
+                         s:=S_FS;
                       end;
             s64real : begin
                          op:=A_FSTP;
-                         s:=S_L;
+                         s:=S_FL;
                       end;
             s80real : begin
                          op:=A_FSTP;
-                         s:=S_Q;
+                         s:=S_FX;
                       end;
             s64bit : begin
                          op:=A_FISTP;
-                         s:=S_Q;
+                         s:=S_IQ;
                       end;
             else internalerror(17);
          end;
@@ -1139,9 +1136,9 @@ end;
          InternalError(34);
         { no emulation }
         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
            begin
              Message(cg_f_unknown_float_type);
@@ -1257,7 +1254,15 @@ end;
   end.
 {
   $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)
     * overflow checking bugfix (m68k and i386) -- pretty useless in
       secondadd, since everything is done using 32-bit

+ 209 - 53
compiler/cgi386.pas

@@ -222,7 +222,12 @@ implementation
                     else
                       begin
                          { 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
                               p^.location.reference.base:=procinfo.framepointer;
                               p^.location.reference.offset:=pvarsym(p^.symtableentry)^.address;
@@ -230,6 +235,14 @@ implementation
                                 p^.location.reference.offset:=-p^.location.reference.offset;
                               if (symtabletype=parasymtable) then
                                 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
                                 begin
                                    hregister:=getregister32;
@@ -637,7 +650,7 @@ implementation
                    hp1:=pai(hp1^.next);
                 end;
               { :-(, we must generate a new entry }
-                 if p^.labnumber=-1 then
+              if p^.labnumber=-1 then
                 begin
                    getlabel(lastlabel);
                    p^.labnumber:=lastlabel^.nb;
@@ -654,9 +667,11 @@ implementation
                         +'$real_const'+tostr(p^.labnumber))));
                       consts^.insert(new(pai_cut,init));
                     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
-                    consts^.insert(new(pai_label,init(lastlabel)));
-               end;
+                     consts^.insert(new(pai_label,init(lastlabel)));
+                end;
            end;
          stringdispose(p^.location.reference.symbol);
          if smartlink then
@@ -664,8 +679,10 @@ implementation
             p^.location.reference.symbol:=stringdup('_$'+current_module^.unitname^
                 +'$real_const'+tostr(p^.labnumber));
           end
+         else if current_module^.output_format in [of_nasm,of_obj] then
+           p^.location.reference.symbol:=stringdup('$real_const'+tostr(p^.labnumber))
          else
-          p^.location.reference.symbol:=stringdup(lab2str(lastlabel));
+           p^.location.reference.symbol:=stringdup(lab2str(lastlabel));
       end;
 
     procedure secondfixconst(var p : ptree);
@@ -721,8 +738,13 @@ implementation
                           (pai_string(hp1)^.len=length(p^.values^)+2) then
                           begin
                              same_string:=true;
+{$ifndef UseAnsiString}
                              for i:=1 to length(p^.values^) do
                                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
                                     same_string:=false;
                                     break;
@@ -743,14 +765,22 @@ implementation
                 begin
                    getlabel(lastlabel);
                    p^.labstrnumber:=lastlabel^.nb;
+{$ifndef UseAnsiString}
                    getmem(pc,length(p^.values^)+3);
                    move(p^.values^,pc^,length(p^.values^)+1);
                    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 }
-                   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 }
                    { 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
                     begin
                       consts^.insert(new(pai_symbol,init_global('_$'+current_module^.unitname^
@@ -758,13 +788,27 @@ implementation
                       consts^.insert(new(pai_cut,init));
                     end
                    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;
          stringdispose(p^.location.reference.symbol);
          if smartlink then
            p^.location.reference.symbol:=stringdup('_$'+current_module^.unitname^
                      +'$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
            p^.location.reference.symbol:=stringdup(lab2str(lastlabel));
          p^.location.loc := LOC_MEM;
@@ -1141,6 +1185,9 @@ implementation
          secondpass(p^.left);
          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 }
          if p^.left^.resulttype^.deftype=arraydef then
            dec(p^.location.reference.offset,
@@ -1571,11 +1618,35 @@ implementation
          pushedregs : tpushed;
 
       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;
 
     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
          comp }
           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
-            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 }
          if porddef(p^.left^.resulttype)^.typ=u32bit then
@@ -1744,13 +1815,13 @@ implementation
       begin
          { real must be on fpu stack }
          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(65536);
          reset_reference(ref);
          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;
          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))));
 
          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;
          exprasmlist^.concat(new(pai386,op_ref(A_FLDCW,S_L,newreference(ref))));
@@ -1853,7 +1924,7 @@ implementation
 
          reset_reference(r);
          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)));
          if popedx then
            exprasmlist^.concat(new(pai386,op_reg(A_POP,S_L,R_EDX)));
@@ -2134,6 +2205,7 @@ implementation
          opsize : topsize;
          otlabel,hlabel,oflabel : plabel;
          hregister : tregister;
+         use_strconcat : boolean;
          loc : tloc;
 
       begin
@@ -2142,7 +2214,8 @@ implementation
          getlabel(truelabel);
          getlabel(falselabel);
          { calculate left sides }
-         secondpass(p^.left);
+         if not(p^.concat_string) then
+           secondpass(p^.left);
 
          if codegenerror then
            exit;
@@ -2220,12 +2293,32 @@ implementation
 {$endif test_dest_loc}
          if p^.left^.resulttype^.deftype=stringdef 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);
+{$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
         else case p^.right^.location.loc of
             LOC_REFERENCE,
@@ -2663,7 +2756,7 @@ implementation
          { help reference pointer }
          r : preference;
          pp,params : ptree;
-
+         inlinecode : ptree;
          { instruction for alignement correction }
          corr : pai386;
          { we must pop this size also after !! }
@@ -2676,11 +2769,18 @@ implementation
       begin
          extended_new:=false;
          iolabel:=nil;
+         inlinecode:=nil;
          loadesi:=true;
          no_virtual_call:=false;
          unusedregisters:=unused;
+
          if not assigned(p^.procdefinition) then
           exit;
+         if (p^.procdefinition^.options and poinline)<>0 then
+           begin
+              inlinecode:=p^.right;
+              p^.right:=nil;
+           end;
          { only if no proc var }
          if not(assigned(p^.right)) then
            is_con_or_destructor:=((p^.procdefinition^.options and poconstructor)<>0)
@@ -3089,11 +3189,14 @@ implementation
                      end;
                    exprasmlist^.concat(new(pai386,op_ref(A_CALL,S_NO,r)));
                 end
-              else
+              else if (p^.procdefinition^.options and poinline)=0 then
                 emitcall(p^.procdefinition^.mangledname,
                   (p^.symtableproc^.symtabletype=unitsymtable) or
                   ((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
                 begin
                    { consider the alignment with the rest (PM) }
@@ -3866,6 +3969,11 @@ implementation
               begin
                  secondpass(p^.left);
                  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;
             in_pred_x,
             in_succ_x:
@@ -4242,9 +4350,17 @@ implementation
          href.symbol := Nil;
          clear_reference(href);
          getlabel(l);
-         href.symbol:=stringdup(lab2str(l));
          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
            begin
               smallsetvalue:=(p^.constset^[3]*256)+p^.constset^[2];
@@ -4313,7 +4429,8 @@ implementation
 
        var
            pushed,ranges : boolean;
-           hr : tregister;
+           hr,pleftreg : tregister;
+           opsize : topsize;
            setparts:array[1..8] of Tsetpart;
            i,numparts:byte;
            href,href2:Treference;
@@ -4498,13 +4615,22 @@ implementation
                             {If register is used, use only lower 8 bits}
                             if p^.left^.location.loc in [LOC_REGISTER,LOC_CREGISTER] then
                              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
-
-                                 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;
                             {Get a label to jump to the end.}
                             p^.location.loc:=LOC_FLAGS;
@@ -4532,8 +4658,8 @@ implementation
                                         case p^.left^.location.loc of
                                            LOC_REGISTER,
                                            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
                                              exprasmlist^.concat(new(pai386,op_const_ref(A_CMP,S_B,
                                                setparts[i].start,newreference(p^.left^.location.reference))));
@@ -4546,8 +4672,8 @@ implementation
                                         case p^.left^.location.loc of
                                            LOC_REGISTER,
                                            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
                                              exprasmlist^.concat(new(pai386,op_const_ref(A_CMP,S_B,
                                                setparts[i].stop,newreference(p^.left^.location.reference))));
@@ -4567,8 +4693,8 @@ implementation
                                              case p^.left^.location.loc of
                                                LOC_REGISTER,
                                                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
                                                  exprasmlist^.concat(new(pai386,op_const_ref(A_CMP,S_B,
                                                setparts[i].start,newreference(p^.left^.location.reference))));
@@ -4583,8 +4709,8 @@ implementation
                                              case p^.left^.location.loc of
                                                LOC_REGISTER,
                                                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
                                                  exprasmlist^.concat(new(pai386,op_const_ref(A_CMP,S_B,
                                                    setparts[i].stop+1,newreference(p^.left^.location.reference))));
@@ -4602,8 +4728,8 @@ implementation
                                    case p^.left^.location.loc of
                                       LOC_REGISTER,
                                       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
                                         exprasmlist^.concat(new(pai386,op_const_ref(A_CMP,S_B,
                                           setparts[i].stop,newreference(p^.left^.location.reference))));
@@ -4623,7 +4749,7 @@ implementation
                             case p^.left^.location.loc of
                                LOC_REGISTER,
                                LOC_CREGISTER:
-                                 ungetregister32(p^.left^.location.register);
+                                 ungetregister32(pleftreg);
                                else
                                  del_reference(p^.left^.location.reference);
                             end;
@@ -5569,6 +5695,28 @@ do_jmp:
             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);
 
        const
@@ -5592,7 +5740,7 @@ do_jmp:
              secondexitn,secondwith,secondcase,secondlabel,
              secondgoto,secondsimplenewdispose,secondtryexcept,secondraise,
              secondnothing,secondtryfinally,secondis,secondas,seconderror,
-             secondfail,
+             secondfail,secondadd,secondprocinline,
              secondnothing,secondloadvmt);
       var
          oldcodegenerror : boolean;
@@ -5740,7 +5888,7 @@ do_jmp:
                    if assigned(aktprocsym) then
                      begin
                        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
                        begin
                          { use ESP as frame pointer }
@@ -5877,7 +6025,15 @@ do_jmp:
 end.
 {
   $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
     * $makelib -> if smartlink
     * small filename fixes pmodule.setfilename

+ 45 - 6
compiler/cgi386ad.inc

@@ -213,13 +213,46 @@
             { because of jump being produced at comparison below: }
             p^.swaped:=not(p^.swaped);
          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
           addn :
             begin
                cmpop:=false;
                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
+
                     { can only reference be }
                     { string in register would be funny    }
                     { therefore produce a temporary string }
@@ -275,7 +308,10 @@
                 end
                else }
                 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^.right^.location.reference);
                   emitcall('STRCONCAT',true);
@@ -1234,10 +1270,13 @@
 
 {
      $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
        * nasm works (linux only tested)

+ 32 - 14
compiler/cobjects.pas

@@ -54,7 +54,7 @@ unit cobjects;
        plinkedlist_item = ^tlinkedlist_item;
 
        tlinkedlist_item = object
-          next,last : plinkedlist_item;
+          next,previous : plinkedlist_item;
           { does nothing }
           constructor init;
           destructor done;virtual;
@@ -223,6 +223,9 @@ unit cobjects;
     { if p=nil then freemem isn't called          }
     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 }
     { a pointer to this mem                                           }
     function stringdup(const s : string) : pstring;
@@ -306,6 +309,13 @@ unit cobjects;
          p:=nil;
       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;
 
       var
@@ -489,7 +499,7 @@ end;
     constructor tlinkedlist_item.init;
 
       begin
-         last:=nil;
+         previous:=nil;
          next:=nil;
       end;
 
@@ -558,7 +568,7 @@ end;
 
          { we have a double linked list }
          if assigned(first) then
-           first^.last:=p^.last;
+           first^.previous:=p^.last;
 
          first:=p^.first;
 
@@ -573,14 +583,14 @@ end;
     procedure tlinkedlist.concat(p : plinkedlist_item);
 
       begin
-         p^.last:=nil;
+         p^.previous:=nil;
          p^.next:=nil;
          if not(assigned(first)) then
            first:=p
            else
              begin
                 last^.next:=p;
-                p^.last:=last;
+                p^.previous:=last;
              end;
          last:=p;
       end;
@@ -588,13 +598,13 @@ end;
     procedure tlinkedlist.insert(p : plinkedlist_item);
 
       begin
-         p^.last:=nil;
+         p^.previous:=nil;
          p^.next:=nil;
          if not(assigned(first)) then
            last:=p
          else
            begin
-              first^.last:=p;
+              first^.previous:=p;
               p^.next:=first;
               first:=p;
            end;
@@ -615,21 +625,21 @@ end;
            begin
               first:=p^.next;
               if assigned(first) then
-                first^.last:=nil;
+                first^.previous:=nil;
            end
          else if last=p then
            begin
-              last:=last^.last;
+              last:=last^.previous;
               if assigned(last) then
                 last^.next:=nil;
            end
          else
            begin
-              p^.last^.next:=p^.next;
-              p^.next^.last:=p^.last;
+              p^.previous^.next:=p^.next;
+              p^.next^.previous:=p^.previous;
            end;
          p^.next:=nil;
-         p^.last:=nil;
+         p^.previous:=nil;
       end;
 
     procedure tlinkedlist.concatlist(p : plinkedlist);
@@ -643,7 +653,7 @@ end;
            else
              begin
                 last^.next:=p^.first;
-                p^.first^.last:=last;
+                p^.first^.previous:=last;
              end;
 
          last:=p^.last;
@@ -985,7 +995,15 @@ end;
 end.
 {
   $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
     * $makelib -> if smartlink
     * small filename fixes pmodule.setfilename

+ 15 - 1
compiler/files.pas

@@ -73,6 +73,12 @@ unit files;
           procedure register_file(f : pextfile);
        end;
 
+       tfileposinfo = record
+         infile : pinputfile;
+         line : longint; { could be changed to abspos }
+       end;
+       pfileposinfo = ^tfileposinfo;
+
     type
        tunitmap = array[0..maxunits-1] of pointer;
        punitmap = ^tunitmap;
@@ -618,7 +624,15 @@ unit files;
 end.
 {
   $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
     * $makelib -> if smartlink
     * small filename fixes pmodule.setfilename

+ 91 - 4
compiler/hcodegen.pas

@@ -138,12 +138,22 @@ unit hcodegen;
     { searches the lowest label }
     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);
 
-    { inserts the ASCII string to the const segment }
+    { inserts the ASCII string to the data segment }
     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_exit;
 
@@ -218,15 +228,84 @@ unit hcodegen;
 
     procedure generate_ascii_insert(hs : string);
 
+
       begin
          while length(hs)>32 do
            begin
               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));
            end;
          datasegment^.insert(new(pai_string,init(hs)));
       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;
 
       var
@@ -276,8 +355,16 @@ end.
 
 {
   $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
     * 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_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;
 
@@ -959,8 +984,11 @@ unit i386;
         'psubusb','psubusw','psubw','punpckhbw','punpckhdq',
         '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] =
-       ('','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] =
        ('','%eax','%ecx','%edx','%ebx','%esp','%ebp','%esi','%edi',
@@ -1079,17 +1107,11 @@ unit i386;
            lab2str:='ILLEGAL'
          else
          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;
 {$else EXTDEBUG}
            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}
          { was missed: }
          inc(l^.refcount);
@@ -1460,15 +1482,19 @@ unit i386;
          inherited init;
          typ:=ait_instruction;
          _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
             ((_op2<R_AL) or (_op2>R_DH)) and
             (_op1>127) then
            begin
 {$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}
-              _size:=S_L;
+              if _size=S_BW then
+                _size:=S_W
+              else
+                _size:=S_L;
            end;
          opxt:=Top_const+Top_reg shl 4;
          size:=_size;
@@ -1754,7 +1780,15 @@ unit i386;
 end.
 {
   $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
 
   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_WL = Word to long       }
        { 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;
 
@@ -823,7 +827,11 @@ type
        '');
 
      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] =
       ('', 'd0','d1','d2','d3','d4','d5','d6','d7',
@@ -834,7 +842,8 @@ type
        'sfc','vbr','fpsr');
 
      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] =
       ('', 'd0','d1','d2','d3','d4','d5','d6','d7',
@@ -845,7 +854,8 @@ type
        'sfc','vbr','fpsr');
 
      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] =
       ('', 'd0','d1','d2','d3','d4','d5','d6','d7',
@@ -1632,8 +1642,16 @@ type
 end.
 {
   $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
     * 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_ill_type_decl_set,
 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_expected,
 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','_',
   '$','1',' ','l','i','n','e','s',' ','$','2',' ','k','B',' ',
   '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',
   ' ','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',
-  ' ','$','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',' ',
-  '-',' ','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',
-  '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',
-  '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',
-  '.','.','.',#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','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',
-  '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',
   'u','t','f','i','l','e','>',' ','[','o','p','t','i','o','n',
   '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',
   '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',
-  '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',
   ' ','(','c',')',' ','1','9','9','3','-','9','8',' ','b','y',
   ' ','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',' ',
   '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',
   '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',
@@ -278,41 +278,36 @@ const optiontxt : array[1..04755] of char=(
   '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',
   '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
 
 uses
-  globals;
+  systems,globals;
 
 procedure toption386.interpret_proc_specific_options(const opt:string);
 var
@@ -67,16 +67,22 @@ begin
                assem_need_external_list:=false;
              end
            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
              begin
                output_format:=of_obj;
                assem_need_external_list:=true;
+               { target_info.labelprefix:='?L'; }
              end
            else
             if copy(opt,3,length(opt)-2)='nasm' then
              begin
                output_format:=of_nasm;
                assem_need_external_list:=true;
+               { target_info.labelprefix:='?L'; }
              end
            else
             IllegalPara(opt);
@@ -95,8 +101,6 @@ begin
             '4' : opt_processors:=i486;
             '5' : opt_processors:=pentium;
             '6' : opt_processors:=pentiumpro;
-            '7' : opt_processors:=cx6x86;
-            '8' : opt_processors:=amdk6;
             else IllegalPara(opt);
             end;
           end;
@@ -119,8 +123,13 @@ end;
 end.
 {
   $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
   * Restored version

+ 26 - 4
compiler/parser.pas

@@ -127,6 +127,9 @@ unit parser;
 
          { some variables to save the compiler state }
          oldtoken : ttoken;
+{$ifdef UseTokenInfo}
+         oldtokeninfo : ptokeninfo;
+{$endif UseTokenInfo}
          oldpattern : stringid;
 
          oldpreprocstack : ppreprocstack;
@@ -243,6 +246,9 @@ unit parser;
          oldmacros:=macros;
          oldpattern:=pattern;
          oldtoken:=token;
+{$ifdef UseTokenInfo}
+         oldtokeninfo:=tokeninfo;
+{$endif UseTokenInfo}
          oldorgpattern:=orgpattern;
          old_block_type:=block_type;
          oldpreprocstack:=preprocstack;
@@ -290,7 +296,12 @@ unit parser;
          define_macros;
 
          { startup scanner }
+{$ifndef UseTokenInfo}
          token:=yylex;
+{$else UseTokenInfo}
+         tokeninfo:=yylex;
+         token:=tokeninfo^.token;
+{$endif UseTokenInfo}
 
          { init asm writing }
          datasegment:=new(paasmoutput,init);
@@ -323,11 +334,11 @@ unit parser;
               readconstdefs;
               { we could try to overload caret by default }
               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);
               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
          else
            begin
@@ -471,6 +482,9 @@ done:
          { restore scanner state }
          pattern:=oldpattern;
          token:=oldtoken;
+{$ifdef UseTokenInfo}
+         tokeninfo:=oldtokeninfo;
+{$endif UseTokenInfo}
          orgpattern:=oldorgpattern;
          block_type:=old_block_type;
 
@@ -525,7 +539,15 @@ done:
 end.
 {
   $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
     * $makelib -> if smartlink
     * small filename fixes pmodule.setfilename

+ 269 - 56
compiler/pass_1.pas

@@ -590,7 +590,12 @@ unit pass_1;
          resultset : pconstset;
          i : longint;
          b : boolean;
+{$ifndef UseAnsiString}
          s1,s2:^string;
+{$else UseAnsiString}
+         s1,s2 : pchar;
+         l1,l2 : longint;
+{$endif UseAnsiString}
 
          { this totally forgets to set the pi_do_call flag !! }
       label
@@ -600,25 +605,27 @@ unit pass_1;
          { first do the two subtrees }
          firstpass(p^.left);
          firstpass(p^.right);
+         lt:=p^.left^.treetype;
+         rt:=p^.right^.treetype;
+         rd:=p^.right^.resulttype;
+         ld:=p^.left^.resulttype;
 
          if codegenerror then
            exit;
 
-         new(s1);
-         new(s2);
          { overloaded operator ? }
          if (p^.treetype=caretn) or
-            (p^.left^.resulttype^.deftype=recorddef) or
+            (ld^.deftype=recorddef) or
             { <> 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])
              )
             ) or
-            (p^.right^.resulttype^.deftype=recorddef) or
+            (rd^.deftype=recorddef) or
             { <> 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])
              )
             ) then
@@ -633,8 +640,8 @@ unit pass_1;
                    t:=gencallnode(overloaded_operators[minus],nil);
                  muln:
                    t:=gencallnode(overloaded_operators[star],nil);
-                 caretn:
-                   t:=gencallnode(overloaded_operators[caret],nil);
+                 starstarn:
+                   t:=gencallnode(overloaded_operators[starstar],nil);
                  slashn:
                    t:=gencallnode(overloaded_operators[slash],nil);
                  ltn:
@@ -657,8 +664,6 @@ unit pass_1;
                Message(parser_e_operator_not_overloaded);
               if p^.treetype=unequaln then
                t:=gensinglenode(notn,t);
-              dispose(s1);
-              dispose(s2);
               firstpass(t);
               putnode(p);
               p:=t;
@@ -666,8 +671,6 @@ unit pass_1;
            end;
          no_overload:
          { compact consts }
-         lt:=p^.left^.treetype;
-         rt:=p^.right^.treetype;
 
          { convert int consts to real consts, if the }
          { other operand is a real const             }
@@ -728,8 +731,6 @@ unit pass_1;
                    Message(sym_e_type_mismatch);
                 end;
               disposetree(p);
-              dispose(s1);
-              dispose(s2);
               p:=t;
               exit;
               end
@@ -767,48 +768,85 @@ unit pass_1;
               end;
               disposetree(p);
               p:=t;
-              dispose(s1);
-              dispose(s2);
               firstpass(p);
               exit;
            end;
          concatstrings:=false;
+{$ifdef UseAnsiString}
+         s1:=nil;
+         s2:=nil;
+{$else UseAnsiString}
+         new(s1);
+         new(s2);
+{$endif UseAnsiString}
          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
+{$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));
               s2^:=char(byte(p^.right^.value));
               concatstrings:=true;
+{$endif UseAnsiString}
            end
          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
-              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));
               concatstrings:=true;
+{$endif UseAnsiString}
            end
          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
+{$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));
-              s2^:=pstring(p^.right^.value)^;
+              s2^:=p^.right^.values^;
               concatstrings:=true;
+{$endif UseAnsiString}
            end
          else if (lt=stringconstn) and (rt=stringconstn) then
            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;
+{$endif UseAnsiString}
            end;
 
+         { I will need to translate all this to ansistrings !!! }
          if concatstrings then
            begin
               case p^.treetype of
+{$ifndef UseAnsiString}
                  addn : t:=genstringconstnode(s1^+s2^);
                  ltn : 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);
                  equaln : 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;
+{$ifdef UseAnsiString}
+              ansistringdispose(s1,l1);
+              ansistringdispose(s2,l2);
+{$else UseAnsiString}
               dispose(s1);
               dispose(s2);
+{$endif UseAnsiString}
               disposetree(p);
               p:=t;
               exit;
            end;
-         rd:=p^.right^.resulttype;
-         ld:=p^.left^.resulttype;
+{$ifdef UseAnsiString}
+         ansistringdispose(s1,l1);
+         ansistringdispose(s2,l2);
+{$else UseAnsiString}
          dispose(s1);
          dispose(s2);
+{$endif UseAnsiString}
 
          { we can set this globally but it not allways true }
          { procinfo.flags:=procinfo.flags or pi_do_call;    }
@@ -909,8 +971,9 @@ unit pass_1;
                 end;
                 if not(is_equal(rd,ld)) then
                  Message(sym_e_set_element_are_not_comp);
+                { why here its is alredy in entry of firstadd
                 firstpass(p^.left);
-                firstpass(p^.right);
+                firstpass(p^.right); }
                 { do constant evalution }
                 { set constructor ? }
                 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 }
                  if (p^.left^.resulttype^.deftype=stringdef) or
                     (p^.right^.resulttype^.deftype=stringdef) then
+                   begin
+{$ifndef UseAnsiString}
                    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
                    p^.resulttype:=p^.left^.resulttype;
               end;
@@ -1394,7 +1467,7 @@ unit pass_1;
            { nasm can not cope with negativ reals !! }
          if is_constrealnode(p^.left)
 {$ifdef i386}
-         and (current_module^.output_format<>of_nasm)
+         and not(current_module^.output_format in [of_nasm,of_obj])
 {$endif}
            then
            begin
@@ -1653,6 +1726,8 @@ unit pass_1;
          { assignements to open arrays aren't allowed }
          if is_open_array(p^.left^.resulttype) then
            Message(sym_e_type_mismatch);
+         { test if we can avoid copying string to temp
+           as in s:=s+...; (PM) }
 {$ifdef dummyi386}
          if ((p^.right^.treetype=addn) or (p^.right^.treetype=subn)) and
             equal_trees(p^.left,p^.right^.left) and
@@ -1686,7 +1761,8 @@ unit pass_1;
          if codegenerror then
            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
           begin
             if not (p^.right^.resulttype^.deftype in [stringdef,orddef]) then
@@ -1696,8 +1772,24 @@ unit pass_1;
                if codegenerror then
                 exit;
              end;
-          { we call STRCOPY }
+            { we call STRCOPY }
             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
          else
           begin
@@ -1902,15 +1994,16 @@ unit pass_1;
 
     procedure first_string_string(var p : ptree);
 
-      var l : longint;
-
            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;
 
     procedure first_char_to_string(var p : ptree);
@@ -2163,7 +2256,7 @@ unit pass_1;
          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_locmem,
+                           first_bigger_smaller,first_string_string,
                            first_cstring_charpointer,first_string_chararray,
                            first_array_to_pointer,first_pointer_to_array,
                            first_char_to_string,first_bigger_smaller,
@@ -2567,7 +2660,6 @@ unit pass_1;
          regi : tregister;
          store_valid, old_count_ref : boolean;
 
-
       { types.is_equal can't handle a formaldef ! }
       function is_equal(def1,def2 : pdef) : boolean;
 
@@ -2651,6 +2743,7 @@ unit pass_1;
               p^.procdefinition:=pprocdef(p^.right^.resulttype);
            end
          else
+         { not a procedure variable }
            begin
               { determine the type of the parameters }
               if assigned(p^.left) then
@@ -2669,7 +2762,7 @@ unit pass_1;
               { do we know the procedure to call ? }
               if not(assigned(p^.procdefinition)) then
                 begin
-
+                   actprocsym:=p^.symtableprocentry;
                    { determine length of parameter list }
                    pt:=p^.left;
                    paralength:=0;
@@ -2681,7 +2774,6 @@ unit pass_1;
 
                    { alle in Frage kommenden Prozeduren in eine }
                    { verkettete Liste einf�gen                  }
-                   actprocsym:=p^.symtableprocentry;
                    pd:=actprocsym^.definition;
                    while assigned(pd) do
                      begin
@@ -2977,8 +3069,10 @@ unit pass_1;
      {$ifdef UseBrowser}
                    add_new_ref(procs^.data^.lastref);
      {$endif UseBrowser}
+
                    p^.procdefinition:=procs^.data;
                    p^.resulttype:=procs^.data^.retdef;
+                   p^.symtableproc:=p^.procdefinition^.owner;
                    p^.location.loc:=LOC_MEM;
 {$ifdef CHAINPROCSYMS}
                    { object with method read;
@@ -3031,6 +3125,21 @@ unit pass_1;
                 end
               else
                 { 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;
 
               { calc the correture value for the register }
@@ -3121,6 +3230,7 @@ unit pass_1;
            end;
 
          { determine the registers of the procedure variable }
+         { is this OK for inlined procs also ?? (PM)         }
          if assigned(p^.right) then
            begin
               p^.registersfpu:=max(p^.right^.registersfpu,p^.registersfpu);
@@ -3326,7 +3436,12 @@ unit pass_1;
                end;
              in_length_string:
                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 }
                   if (p^.left^.treetype=typeconvn) and
                      (p^.left^.left^.resulttype^.deftype=stringdef) then
@@ -4520,19 +4635,98 @@ unit pass_1;
            end;
       end;
 
-{    procedure firstprocinline(var p : ptree);
-      var old_inline_proc_firsttemp : longint;
+    procedure firstprocinline(var p : ptree);
 
       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
        firstpassproc = procedure(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
          procedures : array[ttreetyp] of firstpassproc =
             (firstadd,firstadd,firstadd,firstmoddiv,firstadd,
@@ -4552,7 +4746,7 @@ unit pass_1;
              firstexitn,firstwith,firstcase,firstlabel,
              firstgoto,firstsimplenewdispose,firsttryexcept,firstraise,
              firstnothing,firsttryfinally,firstis,firstas,firstadd,
-             firstnothing,firstnothing,firstloadvmt);
+             firstnothing,firstadd,firstprocinline,firstnothing,firstloadvmt);
 
       var
          oldcodegenerror : boolean;
@@ -4597,10 +4791,29 @@ unit pass_1;
          do_firstpass:=codegenerror;
       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.
 {
   $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:
       - veryyyy slow firstcall fixed
 

+ 50 - 3
compiler/pbase.pas

@@ -45,6 +45,9 @@ unit pbase;
     var
        { contains the current token to be processes }
        token : ttoken;
+{$ifdef UseTokenInfo}
+       tokeninfo : ptokeninfo;
+{$endif UseTokenInfo}
 
        { size of data segment, set by proc_unit or proc_program }
        datasize : longint;
@@ -102,7 +105,8 @@ unit pbase;
 
       { This is changed since I changed the order of token
       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,
                  POINT,COMMA,LKLAMMER,RKLAMMER,COLON,SEMICOLON,
                  KLAMMERAFFE,UNEQUAL,POINTPOINT,
@@ -111,7 +115,7 @@ unit pbase;
 
       const tokens : array[PLUS..DOUBLEADDR] of string[12] = (
                  '+','-','*','/','=','>','<','>=','<=','is','as','in',
-                 '><','^',':=','<>','[',']','.',',','(',')',':',';',
+                 '><','**',':=','^','<>','[',']','.',',','(',')',':',';',
                  '@','..',
                  'identifier','const real.','end of file',
                  'ord const','const string','const char','@@');
@@ -120,6 +124,7 @@ unit pbase;
          j : integer;
 
       begin
+{$ifndef UseTokenInfo}
          if token<>i then
            begin
               if i<_AND then
@@ -139,16 +144,50 @@ unit pbase;
            end
          else
            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;
 
     procedure consume_all_until(atoken : ttoken);
 
       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
            consume(token);
          { this will create an error if the token is _EOF }
          if token<>atoken then
            consume(atoken);
+{$endif UseTokenInfo}
          { this error is fatal as we have read the whole file }
          Message(scan_f_end_of_file);
       end;
@@ -205,7 +244,15 @@ end.
 
 {
   $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
     + packed object/class/array
 

+ 20 - 7
compiler/pdecl.pas

@@ -80,6 +80,7 @@ unit pdecl;
          name : stringid;
          p : ptree;
          def : pdef;
+         sym : psym;
          ps : pconstset;
          pd : pdouble;
 
@@ -136,9 +137,10 @@ unit pdecl;
                    def:=read_type('');
                    block_type:=bt_general;
                    ignore_equal:=false;
-                   symtablestack^.insert(new(ptypedconstsym,init(name,def)));
+                   sym:=new(ptypedconstsym,init(name,def));
+                   symtablestack^.insert(sym);
                    consume(EQUAL);
-                   readtypedconst(def);
+                   readtypedconst(def,ptypedconstsym(sym));
                    consume(SEMICOLON);
                 end;
               else consume(EQUAL);
@@ -187,7 +189,7 @@ unit pdecl;
               do_firstpass(p);
               if not is_constintnode(p) then
                 Message(cg_e_illegal_expression);
-{$ifndef UseLongString}
+{$ifndef UseAnsiString}
               if (p^.value<1) or (p^.value>255) then
                 begin
                    Message(parser_e_string_too_long);
@@ -201,9 +203,9 @@ unit pdecl;
 {$else * GDB *}
                  else d:=globaldef('SYSTEM.STRING');
 {$endif * GDB *}
-{$else UseLongString}
+{$else UseAnsiString}
               if p^.value>255 then
-                d:=new(pstringdef,longinit(p^.value)
+                d:=new(pstringdef,ansiinit(p^.value))
               else if p^.value<>255 then
                 d:=new(pstringdef,init(p^.value))
 {$ifndef GDB}
@@ -211,9 +213,12 @@ unit pdecl;
 {$else * GDB *}
                  else d:=globaldef('SYSTEM.STRING');
 {$endif * GDB *}
-{$endif UseLongString}
+              consume(RECKKLAMMER);
+{$endif UseAnsiString}
               disposetree(p);
            end
+           { should string bwithout suffix be an ansistring also
+             in ansistring mode ?? (PM) }
 {$ifndef GDB}
                  else d:=new(pstringdef,init(255));
 {$else * GDB *}
@@ -1753,7 +1758,15 @@ unit pdecl;
 end.
 {
   $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
     + small COM problems solved to compile classes.pp
 

+ 12 - 4
compiler/pexpr.pas

@@ -913,7 +913,7 @@ unit pexpr;
                        if assigned(aktprocsym) and
                         ((srsym^.name=aktprocsym^.name) or
                         ((pvarsym(srsym)=opsym) and
-                        ((pprocdef(aktprocsym^.definition)^.options and pooperator)<>0))) and
+                        ((procinfo.flags and pi_operator)<>0))) and
                         (procinfo.retdef<>pdef(voiddef)) and
                         (token<>LKLAMMER) and
                         (not ((cs_tp_compatible in aktswitches) and
@@ -1464,7 +1464,7 @@ unit pexpr;
     const   tok2node:array[PLUS.._XOR] of Ttreetyp=
                     (addn,subn,muln,slashn,equaln,gtn,ltn,gten,lten,
                      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,
@@ -1484,7 +1484,7 @@ unit pexpr;
             operator_levels:array[Toperator_precedence] of set of Ttoken=
                     ([LT,LTE,GT,GTE,EQUAL,UNEQUAL,_IN,_IS],
                      [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;
 
@@ -1640,7 +1640,15 @@ unit pexpr;
 end.
 {
   $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
 
   Revision 1.7  1998/04/09 23:02:15  florian

+ 127 - 86
compiler/pmodules.pas

@@ -60,6 +60,8 @@ unit pmodules;
 
     {$I innr.inc}
 
+    { all intern procedures for system unit }
+
     procedure insertinternsyms(p : psymtable);
 
       begin
@@ -87,6 +89,102 @@ unit pmodules;
          p^.insert(new(psyssym,init('STR',in_str_x_string)));
       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);
 
       var
@@ -115,8 +213,7 @@ unit pmodules;
               { if the crc of a used unit is the same as }
               { written to the PPU file, we needn't to   }
               { 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
                    { we have to compile the current unit }
                    { remove stuff which isn't needed     }
@@ -126,7 +223,10 @@ unit pmodules;
                    hp^.ppufile^.close;
                    dispose(hp^.ppufile,done);
                    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;
                 end;
               { setup the map entry for deref }
@@ -167,7 +267,7 @@ unit pmodules;
               { but for the implementation part          }
               { the written crc is false, because        }
               { 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
                 begin
                    { we have to compile the current unit }
@@ -178,9 +278,12 @@ unit pmodules;
                    hp^.ppufile^.close;
                    dispose(hp^.ppufile,done);
                    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;
-                end;
+                end; *)
               { read until ibend }
               hp^.ppufile^.read_data(b,1,count);
            end;
@@ -411,15 +514,9 @@ unit pmodules;
     procedure proc_unit;
 
       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;
          pu     : pused_unit;
          s1,s2  : ^string; {Saves stack space}
@@ -474,6 +571,11 @@ unit pmodules;
          refsymtable:=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 }
          { this must be set later for interdependency }
          { current_module^.symtable:=psymtable(p); }
@@ -519,76 +621,7 @@ unit pmodules;
            begin
               p^.next:=symtablestack;
               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;
 
          { displaced for inter-dependency considerations }
@@ -917,7 +950,15 @@ unit pmodules;
 end.
 {
   $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
     * $makelib -> if smartlink
     * 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:
   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:
   GDB;I386;TP
 
   Required switches for a 68000 compiler be compiled by Turbo Pascal:
-  GDB;M68K;TP
+  GDB;M68k;TP
 }
 
 {$ifdef FPC}
@@ -129,7 +126,7 @@ uses
   catch,
 {$endif LINUX}
 {$IfDef PMD}
-     OpenFiles,
+     OpenFile,
      BBError,
      ObjMemory,
      PMD, MemCheck,
@@ -376,10 +373,13 @@ begin
 end.
 {
   $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
     * patches from strasbourg

+ 20 - 3
compiler/pstatmnt.pas

@@ -827,11 +827,17 @@ unit pstatmnt;
          p : ptree;
          code : ptree;
          labelnr : plabel;
+{$ifdef UseTokenInfo}
+         filepos : tfilepos;
+{$endif UseTokenInfo}
 
       label
          ready;
 
       begin
+{$ifdef UseTokenInfo}
+         filepos:=tokeninfo^.filepos;
+{$endif UseTokenInfo}
          case token of
             _GOTO : begin
                        if not(cs_support_goto in aktswitches)then
@@ -930,6 +936,9 @@ unit pstatmnt;
            end;
          end;
          ready:
+{$ifdef UseTokenInfo}
+         set_tree_filepos(code,filepos);
+{$endif UseTokenInfo}
          statement:=code;
       end;
 
@@ -986,9 +995,9 @@ unit pstatmnt;
                    procinfo.retoffset:=procinfo.firsttemp-procinfo.retdef^.size;
                    procinfo.firsttemp:=procinfo.retoffset;
 {$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.retoffset;
+                     opsym^.address:=-procinfo.retoffset;
                    { eax is modified by a function }
 {$ifdef i386}
                    usedinproc:=usedinproc or ($80 shr byte(R_EAX))
@@ -1067,7 +1076,15 @@ unit pstatmnt;
 end.
 {
   $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
       ADD ADC and AND are also sign extended
       nasm output OK (program still crashes at end

+ 74 - 53
compiler/ptconst.pas

@@ -27,7 +27,9 @@ unit ptconst;
    uses symtable;
 
     { 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
 
@@ -46,11 +48,11 @@ unit ptconst;
        ;
 
     { this procedure reads typed constants }
-    procedure readtypedconst(def : pdef);
+    procedure readtypedconst(def : pdef;sym : ptypedconstsym);
 
       var
          p : ptree;
-         i,l : longint;
+         i,l,strlength : longint;
          ll : plabel;
          s : string;
          ca : pchar;
@@ -243,57 +245,68 @@ unit ptconst;
            begin
               p:=expr;
               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
-                   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
-                   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
-              else if pstringdef(def)^.string_typ=ansistring then
+              else if is_constcharnode(p) then
                 begin
+                   datasegment^.concat(new(pai_string,init(#1+char(byte(p^.value)))));
+                   strlength:=1;
                 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;
          arraydef:
            begin
@@ -302,10 +315,10 @@ unit ptconst;
                     consume(LKLAMMER);
                     for l:=parraydef(def)^.lowrange to parraydef(def)^.highrange-1 do
                       begin
-                         readtypedconst(parraydef(def)^.definition);
+                         readtypedconst(parraydef(def)^.definition,nil);
                          consume(COMMA);
                       end;
-                    readtypedconst(parraydef(def)^.definition);
+                    readtypedconst(parraydef(def)^.definition,nil);
                     consume(RKLAMMER);
                  end
               else
@@ -419,7 +432,7 @@ unit ptconst;
                         aktpos:=pvarsym(srsym)^.address+pvarsym(srsym)^.definition^.size;
 
                         { read the data }
-                        readtypedconst(pvarsym(srsym)^.definition);
+                        readtypedconst(pvarsym(srsym)^.definition,nil);
 
                         if token=SEMICOLON then
                           consume(SEMICOLON)
@@ -437,7 +450,15 @@ unit ptconst;
 end.
 {
   $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
       in MEM parsing for go32v2
       better external symbol creation

+ 13 - 5
compiler/ra68k.pas

@@ -610,9 +610,9 @@ var
        'B': instr.stropsize := S_B;
        'W': instr.stropsize := S_W;
        '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
         Message1(assem_e_invalid_opcode,s);
        end;
@@ -2169,8 +2169,16 @@ Begin
 end.
 {
   $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
     * changes of Carl-Eric to m68k target commit:

+ 24 - 12
compiler/rai386.pas

@@ -170,10 +170,12 @@ const
         { segment register }
         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 }
-        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:
                            Begin
                               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,
                                  operands[2].size,operands[1].val,
                                  newreference(operands[2].ref))))
                               else
                               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,
                                  operands[2].size,operands[1].val,
                                  newreference(operands[2].ref))))
                               else
                               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,
                                  operands[2].size,operands[1].val,
                                  newreference(operands[2].ref))))
@@ -1593,19 +1597,19 @@ var
                            Begin
                               { size of opcode determined by register }
                               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,
                                  operands[2].size,operands[1].val,
                                  operands[2].reg)))
                               else
                               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,
                                  operands[2].size,operands[1].val,
                                  operands[2].reg)))
                               else
                               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,
                                  operands[2].size,operands[1].val,
                                  operands[2].reg)))
@@ -3161,8 +3165,8 @@ var
                                    AS_DWORD: instr.operands[operandnum].size := S_L;
                                    AS_WORD:  instr.operands[operandnum].size := S_W;
                                    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;
                                   Consume(actasmtoken);
                                   Case actasmtoken of
@@ -3362,7 +3366,15 @@ Begin
 end.
 {
   $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
       ADD ADC and AND are also sign extended
       nasm output OK (program still crashes at end

+ 44 - 30
compiler/ratti386.pas

@@ -143,29 +143,31 @@ const
         { segment register }
         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 }
-        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... }
-      {'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 = (
-                 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 = (
        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,
@@ -396,7 +398,11 @@ const
 
       if c = ':' then
       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;
            { let us point to the next character }
            c := asmgetchar;
@@ -886,8 +892,8 @@ const
              EXT_WORD   : instr.operands[operandnum].size := S_W;
              EXT_NEAR,EXT_FAR,EXT_PROC,EXT_DWORD,EXT_CODEPTR,EXT_DATAPTR:
              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
              { this is in the case where the instruction is LEA }
              { or something like that, in that case size is not }
@@ -1831,19 +1837,19 @@ const
                               else
                            { resort to intel styled checking ... }
                               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,
                                  operands[2].size,operands[1].val,
                                  newreference(operands[2].ref))))
                               else
                               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,
                                  operands[2].size,operands[1].val,
                                  newreference(operands[2].ref))))
                               else
                               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,
                                  operands[2].size,operands[1].val,
                                  newreference(operands[2].ref))))
@@ -1854,19 +1860,19 @@ const
                            Begin
                               { size of opcode determined by register }
                               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,
                                  operands[2].size,operands[1].val,
                                  operands[2].reg)))
                               else
                               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,
                                  operands[2].size,operands[1].val,
                                  operands[2].reg)))
                               else
                               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,
                                  operands[2].size,operands[1].val,
                                  operands[2].reg)))
@@ -3578,7 +3584,7 @@ const
                  { -- add.                                               -- }
                    if (cs_compilesystem in aktswitches) then
                    begin
-                     Consume(AS_LCOMM);
+                     Consume(AS_COMM);
                       if actasmtoken <> AS_ID then
                         begin
                            Message(assem_e_invalid_comm_def);
@@ -3675,7 +3681,15 @@ end.
 
 {
   $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
       ADD ADC and AND are also sign extended
       nasm output OK (program still crashes at end

+ 274 - 9
compiler/scanner.pas

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

+ 18 - 1
compiler/systems.pas

@@ -165,12 +165,21 @@ unit systems;
             unit_env : 'GO32V2UNITS';
             system_unit : 'SYSTEM';
             exeext : '.EXE';
+{$ifndef UseAnsiString}
             objext : '.O';
             dllext : '.DLL';
             arext : '.A';
             unitext : '.PPU';
             libext : '.PPL';
             asmext : '.S';
+{$else UseAnsiString}
+   { just for tests }
+            objext : '.OA';
+            dllext : '.DLL';
+            unitext : '.PAU';
+            libext : '.PPL';
+            asmext : '.SA';
+{$endif UseAnsiString}
             sourceext : '.PP';
             pasext : '.PAS';
             newline : #13#10;
@@ -366,7 +375,15 @@ begin
 end.
 {
   $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
     + target_info.arext = .a
 

+ 14 - 12
compiler/tgeni386.pas

@@ -58,6 +58,7 @@ unit tgeni386;
     procedure setfirsttemp(l : longint);
     function gettempsize : longint;
     function gettempofsize(size : longint) : longint;
+    procedure ungettemp(pos : longint;size : longint);
     procedure gettempofsizereference(l : longint;var ref : treference);
     function istemp(const ref : treference) : boolean;
     procedure ungetiftemp(const ref : treference);
@@ -274,40 +275,33 @@ unit tgeni386;
 
     function getregister32 : tregister;
 
-      var
-         r : tregister;
-
       begin
          dec(usablereg32);
          if R_EAX in unused then
            begin
               unused:=unused-[R_EAX];
               usedinproc:=usedinproc or ($80 shr byte(R_EAX));
-              r:=R_EAX;
+              getregister32:=R_EAX;
            end
          else if R_EDX in unused then
            begin
               unused:=unused-[R_EDX];
               usedinproc:=usedinproc or ($80 shr byte(R_EDX));
-              r:=R_EDX;
+              getregister32:=R_EDX;
            end
          else if R_EBX in unused then
            begin
               unused:=unused-[R_EBX];
               usedinproc:=usedinproc or ($80 shr byte(R_EBX));
-              r:=R_EBX;
+              getregister32:=R_EBX;
            end
          else if R_ECX in unused then
            begin
               unused:=unused-[R_ECX];
               usedinproc:=usedinproc or ($80 shr byte(R_ECX));
-              r:=R_ECX;
+              getregister32:=R_ECX;
            end
          else internalerror(10);
-{$ifdef REGALLOC}
-         exprasmlist^.concat(new(pairegalloc,init(r)));
-{$endif REGALLOC}
-         getregister32:=r;
       end;
 
     procedure cleartempgen;
@@ -601,7 +595,15 @@ begin
 end.
 {
   $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
     * improved property support
 

+ 119 - 18
compiler/tree.pas

@@ -119,6 +119,8 @@ unit tree;
                    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);       {???.}
@@ -202,14 +204,15 @@ unit tree;
         firstpasscount : longint;
 {$endif extdebug}
           case treetype : ttreetyp of
+             addn : (use_strconcat : boolean;string_typ : stringtype);
              callparan : (is_colon_para : boolean;exact_match_found : boolean);
-             assignn : (assigntyp : tassigntyp);
+             assignn : (assigntyp : tassigntyp;concat_string : boolean);
              loadn : (symtableentry : psym;symtable : psymtable;
                       is_absolute,is_first : boolean);
              calln : (symtableprocentry : pprocsym;
                       symtableproc : psymtable;procdefinition : pprocdef;
                       methodpointer : ptree;
-                      unit_specific : boolean);
+                      no_check,unit_specific : boolean);
              ordconstn : (value : longint);
              realconstn : (valued : bestreal;labnumber : longint;realtyp : tait);
              fixconstn : (valuef: longint);
@@ -218,10 +221,16 @@ unit tree;
 {$endif TEST_FUNCRET}
              subscriptn : (vs : pvarsym);
              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);
              inlinen : (inlinenumber : longint);
-             { procinlinen : (proc : pprocsym); }
+             procinlinen : (inlineprocdef : pprocdef);
              setconstrn : (constset : pconstset);
              loopn : (t1,t2 : ptree;backward : boolean);
              asmn : (p_asm : paasmoutput);
@@ -243,12 +252,19 @@ unit tree;
     function genrealconstnode(v : bestreal) : ptree;
     function gencallnode(v : pprocsym;st : psymtable) : 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;
+{$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 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 genenumnode(v : penumsym) : ptree;
     function genselfnode(_class : pdef) : ptree;
@@ -269,6 +285,7 @@ unit tree;
     procedure set_location(var destloc,sourceloc : tlocation);
     procedure swap_location(var destloc,sourceloc : tlocation);
     procedure set_file_line(from,_to : ptree);
+    procedure set_tree_filepos(p : ptree;const filepos : tfileposinfo);
 
 {$ifdef extdebug}
     const
@@ -354,8 +371,13 @@ unit tree;
            assigned(p^.location.reference.symbol) then
            stringdispose(p^.location.reference.symbol);
 
+{$ifndef UseAnsiString}
          if p^.disposetyp=dt_string then
            stringdispose(p^.values);
+{$else UseAnsiString}
+         if p^.disposetyp=dt_string then
+           ansistringdispose(p^.values,p^.length);
+{$endif UseAnsiString}
 {$ifdef extdebug}
          if p^.firstpasscount>maxfirstpasscount then
             maxfirstpasscount:=p^.firstpasscount;
@@ -408,7 +430,14 @@ unit tree;
                  if assigned(p^.t2) then
                    hp^.t2:=getcopy(p^.t2);
               end;
+{$ifdef UseAnsiString}
+            dt_string : begin
+                           hp^.values:=getpcharcopy(p);
+                           hp^.length:=p^.length;
+                        end;
+{$else UseAnsiString}
             dt_string : hp^.values:=stringdup(p^.values^);
+{$endif UseAnsiString}
             dt_typeconv : hp^.left:=getcopy(p^.left);
             dt_inlinen :
               if assigned(p^.left) then
@@ -464,7 +493,11 @@ unit tree;
                  if assigned(p^.left) then disposetree(p^.left);
                  disposetree(p^.methodpointer);
               end;
+{$ifdef UseAnsiString}
+            dt_string : ansistringdispose(p^.values,p^.length);
+{$else UseAnsiString}
             dt_string : stringdispose(p^.values);
+{$endif UseAnsiString}
             dt_constset :
               begin
                  if assigned(p^.constset) then
@@ -514,6 +547,12 @@ unit tree;
            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;
 
       var
@@ -733,7 +772,9 @@ unit tree;
 
       var
          p : ptree;
-
+{$ifdef UseAnsiString}
+         l : longint;
+{$endif UseAnsiString}
       begin
          p:=getnode;
          p^.disposetyp:=dt_string;
@@ -746,11 +787,60 @@ unit tree;
          p^.registersmmx:=0;
 {$endif SUPPORT_MMX}
          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);
+{$endif UseAnsiString}
          p^.labstrnumber:=-1;
          genstringconstnode:=p;
       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;
 
       var
@@ -881,6 +971,7 @@ unit tree;
          p^.symtableprocentry:=v;
          p^.symtableproc:=st;
          p^.unit_specific:=false;
+         p^.no_check:=false;
          p^.disposetyp := dt_leftright;
          p^.methodpointer:=nil;
          p^.left:=nil;
@@ -1023,25 +1114,27 @@ unit tree;
       end;
 
 
-{    function genprocinlinenode(code : ptree;proc : pprocsym) : ptree;
+      { uses the callnode to create the new procinline node }
+    function genprocinlinenode(callp,code : ptree) : ptree;
 
       var
          p : ptree;
 
       begin
          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^.registersfpu:=code^.registersfpu;
-$ifdef SUPPORT_MMX
+{$ifdef SUPPORT_MMX}
          p^.registersmmx:=0;
-$endif SUPPORT_MMX
-         p^.resulttype:=proc^.definition^.returntype;
+{$endif SUPPORT_MMX}
+         p^.resulttype:=p^.inlineprocdef^.retdef;
          genprocinlinenode:=p;
-      end; }
+      end;
 
    function gensetconstruktnode(s : pconstset;settype : psetdef) : ptree;
 
@@ -1160,7 +1253,15 @@ $endif SUPPORT_MMX
 end.
 {
   $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
     * 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 }
     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) }
     function is_signed(def : pdef) : boolean;
 
@@ -218,6 +221,13 @@ unit types;
                  (parraydef(p)^.highrange=-1);
       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 }
     function ret_in_acc(def : pdef) : boolean;
 
@@ -925,7 +935,15 @@ unit types;
 end.
 {
   $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
     * objects is not used anymore in the fpc compiled version
 

+ 7 - 4
compiler/verb_def.pas

@@ -242,10 +242,13 @@ begin
 end.
 {
   $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
     * secondin bugfix (m68k and i386)