Browse Source

* several bugfixes
ADD ADC and AND are also sign extended
nasm output OK (program still crashes at end
and creates wrong assembler files !!)
procsym types sym in tdef removed !!

pierre 27 năm trước cách đây
mục cha
commit
9b14f1f183

+ 23 - 2
compiler/ag386int.pas

@@ -520,7 +520,21 @@ ait_labeled_instruction :
                              AsmWriteLn(s);
                              break;
                            end;
-                        end;
+                          { nasm prefers prefix on a line alone }
+                          if (current_module^.output_format in [of_nasm,of_obj]) then
+                            begin
+                               AsmWriteln(#9#9+prefix);
+                               prefix:='';
+                            end;
+                        end
+                       else
+                        prefix:= '';
+                       { A_FNSTS need the w as suffix at least for nasm}
+                       if (current_module^.output_format in [of_nasm,of_obj]) then
+                         if (pai386(hp)^._operator = A_FNSTS) then
+                           pai386(hp)^._operator:=A_FNSTSW
+                         else if (pai386(hp)^._operator = A_FSTS) then
+                           pai386(hp)^._operator:=A_FSTSW;
                        if pai386(hp)^.op1t<>top_none then
                         begin
                           if pai386(hp)^._operator in [A_CALL] then
@@ -661,7 +675,14 @@ ait_stab_function_name : ;
 end.
 {
   $Log$
-  Revision 1.2  1998-04-08 11:34:17  peter
+  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
+      and creates wrong assembler files !!)
+      procsym types sym in tdef removed !!
+
+  Revision 1.2  1998/04/08 11:34:17  peter
     * nasm works (linux only tested)
 
   Revision 1.1.1.1  1998/03/25 11:18:16  root

+ 13 - 4
compiler/i386.pas

@@ -1419,11 +1419,13 @@ unit i386;
          inherited init;
          typ:=ait_instruction;
          _operator:=op;
-         if (op=A_CMP) and (_size=S_B) and
-            ((_op2<R_AL) or (_op2>R_DH)) then
+         if ((op=A_CMP) or (op=A_AND) or (op=A_ADD) or (op=A_ADC)) 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 due to implicit size extension !!');
+              comment(v_warning,'wrong size for A_CMP or A_AND due to implicit size extension !!');
 {$endif extdebug}
               _size:=S_L;
            end;
@@ -1711,7 +1713,14 @@ unit i386;
 end.
 {
   $Log$
-  Revision 1.2  1998-04-04 05:29:57  carl
+  Revision 1.3  1998-04-08 16:58:02  pierre
+    * several bugfixes
+      ADD ADC and AND are also sign extended
+      nasm output OK (program still crashes at end
+      and creates wrong assembler files !!)
+      procsym types sym in tdef removed !!
+
+  Revision 1.2  1998/04/04 05:29:57  carl
     * bugfix of crash with ins_cache and popfd
     * bugfix of pushfd typo mistake in att output
     + added setc, and setnc

+ 9 - 3
compiler/innr.inc

@@ -54,8 +54,15 @@ const
 
 {
   $Log$
-  Revision 1.1  1998-03-25 11:18:12  root
-  Initial revision
+  Revision 1.2  1998-04-08 16:58:02  pierre
+    * several bugfixes
+      ADD ADC and AND are also sign extended
+      nasm output OK (program still crashes at end
+      and creates wrong assembler files !!)
+      procsym types sym in tdef removed !!
+
+  Revision 1.1.1.1  1998/03/25 11:18:12  root
+  * Restored version
 
   Revision 1.2  1998/02/24 16:50:03  peter
     * stackframe ommiting generated 'ret $-4'
@@ -76,6 +83,5 @@ const
   revision 1.1.1.1
   date: 1997/11/27 08:33:46;  author: michael;  state: Exp;  lines: +0 -0
   FPC RTL CVS start
-  =============================================================================
 }
 

+ 1 - 0
compiler/optione.msg

@@ -81,6 +81,7 @@ Report bugs,suggestions etc to:
 **1S_syntax options
 **2S2_switch some Delphi 2 extension on
 **2Sc_supports operators like C (*=,+=,/= and -=)
+**2Sd_compiler disposes asm lists (uses less memory but much slower)
 **2Se_compiler stops after the first error
 **2Sg_allows LABEL and GOTO
 **2Si_support C++ stlyed INLINE

+ 169 - 165
compiler/optmsg.inc

@@ -1,4 +1,4 @@
-const optiontxt : array[1..04607] 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',
@@ -142,168 +142,172 @@ const optiontxt : array[1..04607] of char=(
   ' ','o','n',#000,'*','*','2','S','c','_','s','u','p','p','o',
   'r','t','s',' ','o','p','e','r','a','t','o','r','s',' ','l',
   'i','k','e',' ','C',' ','(','*','=',',','+','=',',','/','=',
-  ' ','a','n','d',' ','-','=',')',#000,'*','*','2','S','e','_',
-  'c','o','m','p','i','l','e','r',' ','s','t','o','p','s',' ',
-  'a','f','t','e','r',' ','t','h','e',' ','f','i','r','s','t',
-  ' ','e','r','r','o','r',#000,'*','*','2','S','g','_','a','l',
-  'l','o','w','s',' ','L','A','B','E','L',' ','a','n','d',' ',
-  'G','O','T','O',#000,'*','*','2','S','i','_','s','u','p','p',
-  'o','r','t',' ','C','+','+',' ','s','t','l','y','e','d',' ',
-  'I','N','L','I','N','E',#000,'*','*','2','S','m','_','s','u',
-  'p','p','o','r','t',' ','m','a','c','r','o','s',' ','l','i',
-  'k','e',' ','C',' ','(','g','l','o','b','a','l',')',#000,'*',
-  '*','2','S','o','_','t','r','i','e','s',' ','t','o',' ','b',
-  'e',' ','T','P','/','B','P',' ','7','.','0',' ','c','o','m',
-  'p','a','t','i','b','l','e',#000,'*','*','2','S','s','_','c',
-  'o','n','s','t','r','u','c','t','o','r',' ','n','a','m','e',
-  ' ','m','u','s','t',' ','b','e',' ','i','n','i','t',' ','(',
-  'd','e','s','t','r','u','c','t','o','r',' ','m','u','s','t',
-  ' ','b','e',' ','d','o','n','e',')',#000,'*','*','2','S','t',
-  '_','a','l','l','o','w','s',' ','s','t','a','t','i','c',' ',
-  'k','e','y','w','o','r','d',' ','i','n',' ','o','b','j','e',
-  'c','t','s',#000,'*','*','1','s','_','d','o','n',#039,'t',' ',
-  'c','a','l','l',' ','a','s','s','e','m','b','l','e','r',' ',
-  'a','n','d',' ','l','i','n','k','e','r',' ','(','o','n','l',
-  'y',' ','w','i','t','h',' ','-','a',')',#000,'*','*','1','T',
-  '<','x','>','_','T','a','r','g','e','t',' ','o','p','e','r',
-  'a','t','i','n','g',' ','s','y','s','t','e','m',#000,'3','*',
-  '2','T','G','O','3','2','V','1','_','v','e','r','s','i','o',
-  'n',' ','1',' ','o','f',' ','D','J',' ','D','e','l','o','r',
-  'i','e',' ','D','O','S',' ','e','x','t','e','n','d','e','r',
-  #000,'3','*','2','T','G','O','3','2','V','2','_','v','e','r',
-  's','i','o','n',' ','2',' ','o','f',' ','D','J',' ','D','e',
-  'l','o','r','i','e',' ','D','O','S',' ','e','x','t','e','n',
-  'd','e','r',#000,'3','*','2','T','L','I','N','U','X','_','L',
-  'i','n','u','x',#000,'3','*','2','T','O','S','2','_','O','S',
-  '/','2',' ','2','.','x',#000,'3','*','2','T','W','i','n','3',
-  '2','_','W','i','n','d','o','w','s',' ','3','2',' ','B','i',
-  't',#000,'6','*','2','T','A','M','I','G','A','_','C','o','m',
-  'm','o','d','o','r','e',' ','A','m','i','g','a',#000,'6','*',
-  '2','T','A','T','A','R','I','_','A','t','a','r','i',' ','S',
-  'T','/','S','T','e','/','T','T',#000,'6','*','2','T','M','A',
-  'C','O','S','_','M','a','c','i','n','t','o','s','h',' ','m',
-  '6','8','k',#000,'6','*','2','T','L','I','N','U','X','_','L',
-  'i','n','u','x','-','6','8','k',#000,'*','*','1','u','<','x',
-  '>','_','u','n','d','e','f','i','n','e','s',' ','t','h','e',
-  ' ','s','y','m','b','o','l',' ','<','x','>',#000,'*','*','1',
-  'U','_','u','n','i','t',' ','o','p','t','i','o','n','s',#000,
-  '*','*','2','U','l','s','_','m','a','k','e',' ','s','t','a',
-  't','i','c',' ','l','i','b','r','a','r','y',' ','f','r','o',
-  'm',' ','u','n','i','t',#000,'*','*','2','U','l','d','_','m',
-  'a','k','e',' ','d','y','n','a','m','i','c',' ','l','i','b',
-  'r','a','r','y',' ','f','r','o','m',' ','u','n','i','t',#000,
-  '*','*','2','U','n','_','d','o','n',#039,'t',' ','c','h','e',
-  'c','k',' ','t','h','e',' ','u','n','i','t',' ','n','a','m',
-  'e',#000,'*','*','2','U','p','<','x','>','_','s','a','m','e',
-  ' ','a','s',' ','-','F','u','<','x','>',#000,'*','*','2','U',
-  's','_','c','o','m','p','i','l','e',' ','a',' ','s','y','s',
-  't','e','m',' ','u','n','i','t',#000,'*','*','1','v','<','x',
-  '>','_','B','e',' ','v','e','r','b','o','s','e','.',' ','<',
-  'x','>',' ','i','s',' ','a',' ','c','o','m','b','i','n','a',
-  't','i','o','n',' ','o','f',' ','t','h','e',' ','f','o','l',
-  'l','o','w','i','n','g',' ','l','e','t','t','e','r','s',' ',
-  ':',#000,'*','*','2','*','_','e',' ',':',' ','S','h','o','w',
-  ' ','e','r','r','o','r','s',' ','(','d','e','f','a','u','l',
-  't',')',' ',' ',' ',' ',' ',' ',' ','d',' ',':',' ','S','h',
-  'o','w',' ','d','e','b','u','g',' ','i','n','f','o',#000,'*',
-  '*','2','*','_','w',' ',':',' ','S','h','o','w',' ','w','a',
-  'r','n','i','n','g','s',' ',' ',' ',' ',' ',' ',' ',' ',' ',
-  ' ',' ',' ',' ',' ',' ','u',' ',':',' ','S','h','o','w',' ',
-  'u','s','e','d',' ','f','i','l','e','s',#000,'*','*','2','*',
-  '_','n',' ',':',' ','S','h','o','w',' ','n','o','t','e','s',
+  ' ','a','n','d',' ','-','=',')',#000,'*','*','2','S','d','_',
+  'c','o','m','p','i','l','e','r',' ','d','i','s','p','o','s',
+  'e','s',' ','a','s','m',' ','l','i','s','t','s',' ','(','u',
+  's','e','s',' ','l','e','s','s',' ','m','e','m','o','r','y',
+  ' ','b','u','t',' ','m','u','c','h',' ','s','l','o','w','e',
+  'r',')',#000,'*','*','2','S','e','_','c','o','m','p','i','l',
+  'e','r',' ','s','t','o','p','s',' ','a','f','t','e','r',' ',
+  't','h','e',' ','f','i','r','s','t',' ','e','r','r','o','r',
+  #000,'*','*','2','S','g','_','a','l','l','o','w','s',' ','L',
+  'A','B','E','L',' ','a','n','d',' ','G','O','T','O',#000,'*',
+  '*','2','S','i','_','s','u','p','p','o','r','t',' ','C','+',
+  '+',' ','s','t','l','y','e','d',' ','I','N','L','I','N','E',
+  #000,'*','*','2','S','m','_','s','u','p','p','o','r','t',' ',
+  'm','a','c','r','o','s',' ','l','i','k','e',' ','C',' ','(',
+  'g','l','o','b','a','l',')',#000,'*','*','2','S','o','_','t',
+  'r','i','e','s',' ','t','o',' ','b','e',' ','T','P','/','B',
+  'P',' ','7','.','0',' ','c','o','m','p','a','t','i','b','l',
+  'e',#000,'*','*','2','S','s','_','c','o','n','s','t','r','u',
+  'c','t','o','r',' ','n','a','m','e',' ','m','u','s','t',' ',
+  'b','e',' ','i','n','i','t',' ','(','d','e','s','t','r','u',
+  'c','t','o','r',' ','m','u','s','t',' ','b','e',' ','d','o',
+  'n','e',')',#000,'*','*','2','S','t','_','a','l','l','o','w',
+  's',' ','s','t','a','t','i','c',' ','k','e','y','w','o','r',
+  'd',' ','i','n',' ','o','b','j','e','c','t','s',#000,'*','*',
+  '1','s','_','d','o','n',#039,'t',' ','c','a','l','l',' ','a',
+  's','s','e','m','b','l','e','r',' ','a','n','d',' ','l','i',
+  'n','k','e','r',' ','(','o','n','l','y',' ','w','i','t','h',
+  ' ','-','a',')',#000,'*','*','1','T','<','x','>','_','T','a',
+  'r','g','e','t',' ','o','p','e','r','a','t','i','n','g',' ',
+  's','y','s','t','e','m',#000,'3','*','2','T','G','O','3','2',
+  'V','1','_','v','e','r','s','i','o','n',' ','1',' ','o','f',
+  ' ','D','J',' ','D','e','l','o','r','i','e',' ','D','O','S',
+  ' ','e','x','t','e','n','d','e','r',#000,'3','*','2','T','G',
+  'O','3','2','V','2','_','v','e','r','s','i','o','n',' ','2',
+  ' ','o','f',' ','D','J',' ','D','e','l','o','r','i','e',' ',
+  'D','O','S',' ','e','x','t','e','n','d','e','r',#000,'3','*',
+  '2','T','L','I','N','U','X','_','L','i','n','u','x',#000,'3',
+  '*','2','T','O','S','2','_','O','S','/','2',' ','2','.','x',
+  #000,'3','*','2','T','W','i','n','3','2','_','W','i','n','d',
+  'o','w','s',' ','3','2',' ','B','i','t',#000,'6','*','2','T',
+  'A','M','I','G','A','_','C','o','m','m','o','d','o','r','e',
+  ' ','A','m','i','g','a',#000,'6','*','2','T','A','T','A','R',
+  'I','_','A','t','a','r','i',' ','S','T','/','S','T','e','/',
+  'T','T',#000,'6','*','2','T','M','A','C','O','S','_','M','a',
+  'c','i','n','t','o','s','h',' ','m','6','8','k',#000,'6','*',
+  '2','T','L','I','N','U','X','_','L','i','n','u','x','-','6',
+  '8','k',#000,'*','*','1','u','<','x','>','_','u','n','d','e',
+  'f','i','n','e','s',' ','t','h','e',' ','s','y','m','b','o',
+  'l',' ','<','x','>',#000,'*','*','1','U','_','u','n','i','t',
+  ' ','o','p','t','i','o','n','s',#000,'*','*','2','U','l','s',
+  '_','m','a','k','e',' ','s','t','a','t','i','c',' ','l','i',
+  'b','r','a','r','y',' ','f','r','o','m',' ','u','n','i','t',
+  #000,'*','*','2','U','l','d','_','m','a','k','e',' ','d','y',
+  'n','a','m','i','c',' ','l','i','b','r','a','r','y',' ','f',
+  'r','o','m',' ','u','n','i','t',#000,'*','*','2','U','n','_',
+  'd','o','n',#039,'t',' ','c','h','e','c','k',' ','t','h','e',
+  ' ','u','n','i','t',' ','n','a','m','e',#000,'*','*','2','U',
+  'p','<','x','>','_','s','a','m','e',' ','a','s',' ','-','F',
+  'u','<','x','>',#000,'*','*','2','U','s','_','c','o','m','p',
+  'i','l','e',' ','a',' ','s','y','s','t','e','m',' ','u','n',
+  'i','t',#000,'*','*','1','v','<','x','>','_','B','e',' ','v',
+  'e','r','b','o','s','e','.',' ','<','x','>',' ','i','s',' ',
+  'a',' ','c','o','m','b','i','n','a','t','i','o','n',' ','o',
+  'f',' ','t','h','e',' ','f','o','l','l','o','w','i','n','g',
+  ' ','l','e','t','t','e','r','s',' ',':',#000,'*','*','2','*',
+  '_','e',' ',':',' ','S','h','o','w',' ','e','r','r','o','r',
+  's',' ','(','d','e','f','a','u','l','t',')',' ',' ',' ',' ',
+  ' ',' ',' ','d',' ',':',' ','S','h','o','w',' ','d','e','b',
+  'u','g',' ','i','n','f','o',#000,'*','*','2','*','_','w',' ',
+  ':',' ','S','h','o','w',' ','w','a','r','n','i','n','g','s',
   ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',
-  ' ',' ',' ','t',' ',':',' ','S','h','o','w',' ','t','r','i',
-  'e','d',' ','f','i','l','e','s',#000,'*','*','2','*','_','h',
-  ' ',':',' ','S','h','o','w',' ','h','i','n','t','s',' ',' ',
-  ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',
-  ' ','m',' ',':',' ','S','h','o','w',' ','d','e','f','i','n',
-  'e','d',' ','m','a','c','r','o','s',#000,'*','*','2','*','_',
-  'i',' ',':',' ','S','h','o','w',' ','g','e','n','e','r','a',
-  'l',' ','i','n','f','o',' ',' ',' ',' ',' ',' ',' ',' ',' ',
-  ' ',' ','p',' ',':',' ','S','h','o','w',' ','c','o','m','p',
-  'i','l','e','d',' ','p','r','o','c','e','d','u','r','e','s',
-  #000,'*','*','2','*','_','l',' ',':',' ','S','h','o','w',' ',
-  'l','i','n','e','n','u','m','b','e','r','s',' ',' ',' ',' ',
-  ' ',' ',' ',' ',' ',' ',' ',' ','c',' ',':',' ','S','h','o',
-  'w',' ','c','o','n','d','i','t','i','o','n','a','l','s',#000,
-  '*','*','2','*','_','a',' ',':',' ','S','h','o','w',' ','e',
-  'v','e','r','y','t','h','i','n','g',' ',' ',' ',' ',' ',' ',
-  ' ',' ',' ',' ',' ',' ',' ','0',' ',':',' ','S','h','o','w',
-  ' ','n','o','t','h','i','n','g',' ','(','e','x','c','e','p',
-  't',' ','e','r','r','o','r','s',')',#000,'*','*','1','X','_',
-  'e','x','e','c','u','t','a','b','l','e',' ','o','p','t','i',
-  'o','n','s',#000,'*','L','2','X','c','_','l','i','n','k',' ',
-  'w','i','t','h',' ','t','h','e',' ','c',' ','l','i','b','r',
-  'a','r','y',#000,'*','*','2','X','s','_','s','t','r','i','p',
-  ' ','a','l','l',' ','s','y','m','b','o','l','s',' ','f','r',
-  'o','m',' ','e','x','e','c','u','t','a','b','l','e',#000,'*',
-  '*','0','*','_','P','r','o','c','e','s','s','o','r',' ','s',
-  'p','e','c','i','f','i','c',' ','o','p','t','i','o','n','s',
-  ':',#000,'3','*','1','A','_','o','u','t','p','u','t',' ','f',
-  'o','r','m','a','t',#000,'3','*','2','A','a','t','t','_','A',
-  'T','&','T',' ','a','s','s','e','m','b','l','e','r',#000,'3',
-  '*','2','A','o','_','c','o','f','f',' ','f','i','l','e',' ',
-  'u','s','i','n','g',' ','G','N','U',' ','A','S',#000,'3','*',
-  '2','A','o','b','j','_','O','M','F',' ','f','i','l','e',' ',
-  'u','s','i','n','g',' ','N','A','S','M',#000,'3','*','2','A',
-  'n','a','s','m','_','c','o','f','f',' ','f','i','l','e',' ',
-  'u','s','i','n','g',' ','N','A','S','M',#000,'3','*','2','A',
-  'm','a','s','m','_','a','s','s','e','m','b','l','e','r',' ',
-  'f','o','r',' ','t','h','e',' ','M','i','c','r','o','s','o',
-  'f','t','/','B','o','r','l','a','n','d','/','W','a','t','c',
-  'o','m',' ','a','s','s','e','m','b','l','e','r',#000,'3','*',
-  '1','R','_','a','s','s','e','m','b','l','e','r',' ','r','e',
-  'a','d','i','n','g',' ','s','t','y','l','e',#000,'3','*','2',
-  'R','a','t','t','_','r','e','a','d',' ','A','T','&','T',' ',
-  's','t','y','l','e',' ','a','s','s','e','m','b','l','e','r',
-  #000,'3','*','2','R','i','n','t','e','l','_','r','e','a','d',
-  ' ','I','n','t','e','l',' ','s','t','y','l','e',' ','a','s',
-  's','e','m','b','l','e','r',#000,'3','*','2','R','d','i','r',
-  'e','c','t','_','c','o','p','y',' ','a','s','s','e','m','b',
-  'l','e','r',' ','t','e','x','t',' ','d','i','r','e','c','t',
-  'l','y',' ','t','o',' ','a','s','s','e','m','b','l','e','r',
-  ' ','f','i','l','e',#000,'3','*','1','O','_','o','p','t','i',
-  'm','i','z','a','t','i','o','n','s',#000,'3','*','2','O','a',
-  '_','s','i','m','p','l','e',' ','o','p','t','i','m','i','z',
-  'a','t','i','o','n','s',#000,'3','*','2','O','g','_','o','p',
-  't','i','m','i','z','e',' ','f','o','r',' ','s','i','z','e',
-  #000,'3','*','2','O','G','_','o','p','t','i','m','i','z','e',
-  ' ','f','o','r',' ','t','i','m','e',#000,'3','*','2','O','x',
-  '_','o','p','t','i','m','i','z','e',' ','m','a','x','i','m',
-  'u','m',#000,'3','*','2','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',' ','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);
+  'u',' ',':',' ','S','h','o','w',' ','u','s','e','d',' ','f',
+  'i','l','e','s',#000,'*','*','2','*','_','n',' ',':',' ','S',
+  'h','o','w',' ','n','o','t','e','s',' ',' ',' ',' ',' ',' ',
+  ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','t',' ',':',
+  ' ','S','h','o','w',' ','t','r','i','e','d',' ','f','i','l',
+  'e','s',#000,'*','*','2','*','_','h',' ',':',' ','S','h','o',
+  'w',' ','h','i','n','t','s',' ',' ',' ',' ',' ',' ',' ',' ',
+  ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','m',' ',':',' ','S',
+  'h','o','w',' ','d','e','f','i','n','e','d',' ','m','a','c',
+  'r','o','s',#000,'*','*','2','*','_','i',' ',':',' ','S','h',
+  'o','w',' ','g','e','n','e','r','a','l',' ','i','n','f','o',
+  ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','p',' ',':',' ',
+  'S','h','o','w',' ','c','o','m','p','i','l','e','d',' ','p',
+  'r','o','c','e','d','u','r','e','s',#000,'*','*','2','*','_',
+  'l',' ',':',' ','S','h','o','w',' ','l','i','n','e','n','u',
+  'm','b','e','r','s',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',
+  ' ',' ','c',' ',':',' ','S','h','o','w',' ','c','o','n','d',
+  'i','t','i','o','n','a','l','s',#000,'*','*','2','*','_','a',
+  ' ',':',' ','S','h','o','w',' ','e','v','e','r','y','t','h',
+  'i','n','g',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',
+  ' ','0',' ',':',' ','S','h','o','w',' ','n','o','t','h','i',
+  'n','g',' ','(','e','x','c','e','p','t',' ','e','r','r','o',
+  'r','s',')',#000,'*','*','1','X','_','e','x','e','c','u','t',
+  'a','b','l','e',' ','o','p','t','i','o','n','s',#000,'*','L',
+  '2','X','c','_','l','i','n','k',' ','w','i','t','h',' ','t',
+  'h','e',' ','c',' ','l','i','b','r','a','r','y',#000,'*','*',
+  '2','X','s','_','s','t','r','i','p',' ','a','l','l',' ','s',
+  'y','m','b','o','l','s',' ','f','r','o','m',' ','e','x','e',
+  'c','u','t','a','b','l','e',#000,'*','*','0','*','_','P','r',
+  'o','c','e','s','s','o','r',' ','s','p','e','c','i','f','i',
+  'c',' ','o','p','t','i','o','n','s',':',#000,'3','*','1','A',
+  '_','o','u','t','p','u','t',' ','f','o','r','m','a','t',#000,
+  '3','*','2','A','a','t','t','_','A','T','&','T',' ','a','s',
+  's','e','m','b','l','e','r',#000,'3','*','2','A','o','_','c',
+  'o','f','f',' ','f','i','l','e',' ','u','s','i','n','g',' ',
+  'G','N','U',' ','A','S',#000,'3','*','2','A','o','b','j','_',
+  'O','M','F',' ','f','i','l','e',' ','u','s','i','n','g',' ',
+  'N','A','S','M',#000,'3','*','2','A','n','a','s','m','_','c',
+  'o','f','f',' ','f','i','l','e',' ','u','s','i','n','g',' ',
+  'N','A','S','M',#000,'3','*','2','A','m','a','s','m','_','a',
+  's','s','e','m','b','l','e','r',' ','f','o','r',' ','t','h',
+  'e',' ','M','i','c','r','o','s','o','f','t','/','B','o','r',
+  'l','a','n','d','/','W','a','t','c','o','m',' ','a','s','s',
+  'e','m','b','l','e','r',#000,'3','*','1','R','_','a','s','s',
+  'e','m','b','l','e','r',' ','r','e','a','d','i','n','g',' ',
+  's','t','y','l','e',#000,'3','*','2','R','a','t','t','_','r',
+  'e','a','d',' ','A','T','&','T',' ','s','t','y','l','e',' ',
+  'a','s','s','e','m','b','l','e','r',#000,'3','*','2','R','i',
+  'n','t','e','l','_','r','e','a','d',' ','I','n','t','e','l',
+  ' ','s','t','y','l','e',' ','a','s','s','e','m','b','l','e',
+  'r',#000,'3','*','2','R','d','i','r','e','c','t','_','c','o',
+  'p','y',' ','a','s','s','e','m','b','l','e','r',' ','t','e',
+  'x','t',' ','d','i','r','e','c','t','l','y',' ','t','o',' ',
+  'a','s','s','e','m','b','l','e','r',' ','f','i','l','e',#000,
+  '3','*','1','O','_','o','p','t','i','m','i','z','a','t','i',
+  'o','n','s',#000,'3','*','2','O','a','_','s','i','m','p','l',
+  'e',' ','o','p','t','i','m','i','z','a','t','i','o','n','s',
+  #000,'3','*','2','O','g','_','o','p','t','i','m','i','z','e',
+  ' ','f','o','r',' ','s','i','z','e',#000,'3','*','2','O','G',
+  '_','o','p','t','i','m','i','z','e',' ','f','o','r',' ','t',
+  'i','m','e',#000,'3','*','2','O','x','_','o','p','t','i','m',
+  'i','z','e',' ','m','a','x','i','m','u','m',#000,'3','*','2',
+  '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',' ','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);

+ 19 - 10
compiler/parser.pas

@@ -447,15 +447,16 @@ unit parser;
          { if already compiled jumps directly here }
 done:
          { close trees }
-{$ifdef disposetree}
-         dispose(datasegment,Done);
-         dispose(codesegment,Done);
-         dispose(bsssegment,Done);
-         dispose(debuglist,Done);
-         dispose(externals,Done);
-         dispose(internals,Done);
-         dispose(consts,Done);
-{$endif}
+         if dispose_asm_lists then
+           begin
+              dispose(datasegment,Done);
+              dispose(codesegment,Done);
+              dispose(bsssegment,Done);
+              dispose(debuglist,Done);
+              dispose(externals,Done);
+              dispose(internals,Done);
+              dispose(consts,Done);
+           end;
 
          { restore symtable state }
 {$ifdef UseBrowser}
@@ -531,7 +532,14 @@ done:
 end.
 {
   $Log$
-  Revision 1.3  1998-04-07 22:45:04  florian
+  Revision 1.4  1998-04-08 16:58:03  pierre
+    * several bugfixes
+      ADD ADC and AND are also sign extended
+      nasm output OK (program still crashes at end
+      and creates wrong assembler files !!)
+      procsym types sym in tdef removed !!
+
+  Revision 1.3  1998/04/07 22:45:04  florian
     * bug0092, bug0115 and bug0121 fixed
     + packed object/class/array
 
@@ -891,3 +899,4 @@ end.
 
 }
 
+

+ 11 - 3
compiler/pass_1.pas

@@ -3099,8 +3099,8 @@ unit pass_1;
            p^.registers32:=1;
 {$ifdef GDB}
          if must_be_valid and
-           not(procinfo.funcret_is_valid) and
-           ((procinfo.flags and pi_uses_asm)=0) then
+           not(procinfo.funcret_is_valid) {and
+           ((procinfo.flags and pi_uses_asm)=0)} then
            Message(sym_w_function_result_not_set);
          if count_ref then procinfo.funcret_is_valid:=true;
 {$endif * GDB *}
@@ -4069,6 +4069,7 @@ unit pass_1;
 {$ifdef SUPPORT_MMX}
               p^.registersmmx:=p^.left^.registersmmx;
 {$endif SUPPORT_MMX}
+
            end;
       end;
 
@@ -4494,7 +4495,14 @@ unit pass_1;
 end.
 {
   $Log$
-  Revision 1.4  1998-04-07 22:45:04  florian
+  Revision 1.5  1998-04-08 16:58:04  pierre
+    * several bugfixes
+      ADD ADC and AND are also sign extended
+      nasm output OK (program still crashes at end
+      and creates wrong assembler files !!)
+      procsym types sym in tdef removed !!
+
+  Revision 1.4  1998/04/07 22:45:04  florian
     * bug0092, bug0115 and bug0121 fixed
     + packed object/class/array
 

+ 15 - 5
compiler/pstatmnt.pas

@@ -534,10 +534,12 @@ unit pstatmnt;
          if token=LKLAMMER then
            begin
               consume(LKLAMMER);
-          p:=expr;
+              p:=expr;
               consume(RKLAMMER);
               if procinfo.retdef=pdef(voiddef) then
-                Message(parser_e_void_function);
+                Message(parser_e_void_function)
+              else
+                procinfo.funcret_is_valid:=true;
            end
          else
            p:=nil;
@@ -814,8 +816,9 @@ unit pstatmnt;
               emptystats;
            end;
          consume(_END);
-         first:=gensinglenode(blockn,first);
-         statement_block:=first;
+         last:=gensinglenode(blockn,first);
+         set_file_line(first,last);
+         statement_block:=last;
       end;
 
     function statement : ptree;
@@ -1064,7 +1067,14 @@ unit pstatmnt;
 end.
 {
   $Log$
-  Revision 1.3  1998-03-28 23:09:56  florian
+  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
+      and creates wrong assembler files !!)
+      procsym types sym in tdef removed !!
+
+  Revision 1.3  1998/03/28 23:09:56  florian
     * secondin bugfix (m68k and i386)
     * overflow checking bugfix (m68k and i386) -- pretty useless in
       secondadd, since everything is done using 32-bit

+ 22 - 8
compiler/radi386.pas

@@ -55,10 +55,8 @@ unit radi386;
            s[0]:=chr(i);
            if s<>'' then
             code^.concat(new(pai_direct,init(strpnew(s))));
-            { if function return is param }
-            { consider it set if the offset was loaded }
+            { consider it set function set if the offset was loaded }
            if assigned(procinfo.retdef) and
-              ret_in_param(procinfo.retdef) and
               (pos(retstr,upper(s))>0) then
               procinfo.funcret_is_valid:=true;
            s:='';
@@ -67,6 +65,9 @@ unit radi386;
      begin
        ende:=false;
        s:='';
+       if assigned(procinfo.retdef) and
+          is_fpu(procinfo.retdef) then
+         procinfo.funcret_is_valid:=true;
        if assigned(procinfo.retdef) and
           (procinfo.retdef<>pdef(voiddef)) then
          retstr:=upper(tostr(procinfo.retoffset)+'('+att_reg2str[procinfo.framepointer]+')')
@@ -106,8 +107,14 @@ unit radi386;
                               begin
                                  { is the last written character an special }
                                  { char ?                                   }
+                                 if (s[length(s)]='%') and
+                                    ret_in_acc(procinfo.retdef) and
+                                    ((pos('AX',upper(hs))>0) or
+                                    (pos('AL',upper(hs))>0)) then
+                                   procinfo.funcret_is_valid:=true;
                                  if (s[length(s)]<>'%') and
-                                   (s[length(s)]<>'$') then
+                                   (s[length(s)]<>'$') and
+                                   ((s[length(s)]<>'0') or (hs[1]<>'x')) then
                                    begin
                                       if assigned(aktprocsym^.definition^.localst) then
                                         sym:=aktprocsym^.definition^.localst^.search(upper(hs))
@@ -186,8 +193,6 @@ unit radi386;
                                                   (procinfo.retdef<>pdef(voiddef)) then
                                                   begin
                                                   hs:=retstr;
-                                                  if pos(',',s) > 0 then
-                                                    procinfo.funcret_is_valid:=true;
                                                   end
                                                 else
                                                  Message(assem_w_void_function);
@@ -210,6 +215,8 @@ unit radi386;
                          end;
                    end;
  '{',';',#10,#13 : begin
+                      if pos(retstr,s) > 0 then
+                        procinfo.funcret_is_valid:=true;
                      writeasmline;
                      c:=asmgetchar;
                    end;
@@ -229,8 +236,15 @@ unit radi386;
 end.
 {
   $Log$
-  Revision 1.1  1998-03-25 11:18:15  root
-  Initial revision
+  Revision 1.2  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
+      and creates wrong assembler files !!)
+      procsym types sym in tdef removed !!
+
+  Revision 1.1.1.1  1998/03/25 11:18:15  root
+  * Restored version
 
   Revision 1.13  1998/03/24 21:48:33  florian
     * just a couple of fixes applied:

+ 14 - 3
compiler/rai386.pas

@@ -83,7 +83,7 @@ Implementation
 
 Uses
   aasm,globals,AsmUtils,strings,hcodegen,scanner,
-  cobjects,verbose;
+  cobjects,verbose,types;
 
 
 type
@@ -3243,7 +3243,11 @@ var
     inexpression := FALSE;
     firsttoken := TRUE;
     operandnum := 0;
-    { sets up all opcode and register tables in uppercase }
+    if assigned(procinfo.retdef) and
+       (is_fpu(procinfo.retdef) or
+       ret_in_acc(procinfo.retdef)) then
+      procinfo.funcret_is_valid:=true;
+   { sets up all opcode and register tables in uppercase }
     if not _asmsorted then
     Begin
       SetupTables;
@@ -3358,7 +3362,14 @@ Begin
 end.
 {
   $Log$
-  Revision 1.2  1998-03-31 15:21:01  florian
+  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
+      and creates wrong assembler files !!)
+      procsym types sym in tdef removed !!
+
+  Revision 1.2  1998/03/31 15:21:01  florian
     * fix of out (intel syntax) applied
 
   Revision 1.1.1.1  1998/03/25 11:18:15  root

+ 13 - 2
compiler/ratti386.pas

@@ -76,7 +76,7 @@ Implementation
 
 Uses
   aasm,globals,AsmUtils,strings,hcodegen,scanner,
-  cobjects,verbose,symtable;
+  cobjects,verbose,symtable,types;
 
 type
  tinteltoken = (
@@ -3384,6 +3384,10 @@ const
     Message(assem_d_start_att);
     firsttoken := TRUE;
     operandnum := 0;
+    if assigned(procinfo.retdef) and
+       (is_fpu(procinfo.retdef) or
+       ret_in_acc(procinfo.retdef)) then
+      procinfo.funcret_is_valid:=true;
     { sets up all opcode and register tables in uppercase }
     if not _asmsorted then
     Begin
@@ -3671,7 +3675,14 @@ end.
 
 {
   $Log$
-  Revision 1.2  1998-03-30 15:53:01  florian
+  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
+      and creates wrong assembler files !!)
+      procsym types sym in tdef removed !!
+
+  Revision 1.2  1998/03/30 15:53:01  florian
     * last changes before release:
        - gdb fixed
        - ratti386 warning removed (about unset function result)

+ 10 - 4
compiler/types.pas

@@ -841,9 +841,8 @@ unit types;
                                     begin
                                       datasegment^.concat(new(pai_const,init_symbol(
                                         strpnew(procdefcoll^.data^.mangledname))));
-                                      if (procdefcoll^.data^.options and povirtualmethod)<>0 then
-                                        maybe_concat_external(procdefcoll^.data^.owner,
-                                          procdefcoll^.data^.mangledname);
+                                      maybe_concat_external(procdefcoll^.data^.owner,
+                                        procdefcoll^.data^.mangledname);
                                     end;
                                end;
                           end;
@@ -873,7 +872,14 @@ unit types;
 end.
 {
   $Log$
-  Revision 1.3  1998-04-08 11:34:22  peter
+  Revision 1.4  1998-04-08 16:58:09  pierre
+    * several bugfixes
+      ADD ADC and AND are also sign extended
+      nasm output OK (program still crashes at end
+      and creates wrong assembler files !!)
+      procsym types sym in tdef removed !!
+
+  Revision 1.3  1998/04/08 11:34:22  peter
     * nasm works (linux only tested)
 
   Revision 1.2  1998/03/28 23:09:57  florian