Ver código fonte

* "segss" prefix in Intel is converted into "ss" in ATT
and vice-versa. Fixes web bug #892.

pierre 25 anos atrás
pai
commit
2931f94d33

+ 7 - 3
compiler/cpubase.pas

@@ -43,7 +43,7 @@ uses
 
 const
 { Size of the instruction table converted by nasmconv.pas }
-  instabentries = 1309;
+  instabentries = 1303;
   maxinfolen    = 8;
 
 { By default we want everything }
@@ -207,7 +207,7 @@ const
 
   AsmOverrides = 6;
   AsmOverride : array[0..AsmOverrides-1] of TasmOP =(
-    A_CS,A_ES,A_DS,A_FS,A_GS,A_SS
+    A_SEGCS,A_SEGES,A_SEGDS,A_SEGFS,A_SEGGS,A_SEGSS
   );
 
 
@@ -904,7 +904,11 @@ end;
 end.
 {
   $Log$
-  Revision 1.23  2000-03-01 15:36:11  florian
+  Revision 1.24  2000-03-27 21:18:54  pierre
+    * "segss" prefix in Intel is converted into "ss" in ATT
+      and vice-versa. Fixes web bug 892.
+
+  Revision 1.23  2000/03/01 15:36:11  florian
     * some new stuff for the new cg
 
   Revision 1.22  2000/02/09 13:22:51  peter

+ 6 - 12
compiler/i386att.inc

@@ -33,17 +33,14 @@
 'cmpxchg486',
 'cmpxchg8b',
 'cpuid',
-'cs',
 'cwd',
 'cwtl',
 'daa',
 'das',
 'dec',
 'div',
-'ds',
 'emms',
 'enter',
-'es',
 'f2xm1',
 'fabs',
 'fadd',
@@ -115,7 +112,6 @@
 'fptan',
 'frndint',
 'frstor',
-'fs',
 'fsave',
 'fscale',
 'fsetpm',
@@ -143,7 +139,6 @@
 'fxtract',
 'fyl2x',
 'fyl2xp1',
-'gs',
 'hlt',
 'ibts',
 'icebp',
@@ -329,12 +324,12 @@
 'scasb',
 'scasl',
 'scasw',
-'segcs',
-'segds',
-'seges',
-'segfs',
-'seggs',
-'segss',
+'cs',
+'ds',
+'es',
+'fs',
+'gs',
+'ss',
 'sgdt',
 'shl',
 'shld',
@@ -346,7 +341,6 @@
 'smint',
 'smintold',
 'smsw',
-'ss',
 'stc',
 'std',
 'sti',

+ 0 - 6
compiler/i386atts.inc

@@ -37,15 +37,12 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
-attsufNONE,
 attsufINT,
 attsufINT,
 attsufNONE,
-attsufNONE,
 attsufINT,
 attsufNONE,
 attsufNONE,
-attsufNONE,
 attsufFPU,
 attsufFPU,
 attsufFPU,
@@ -115,7 +112,6 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufINT,
-attsufNONE,
 attsufINT,
 attsufNONE,
 attsufNONE,
@@ -144,7 +140,6 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
-attsufNONE,
 attsufINT,
 attsufNONE,
 attsufINT,
@@ -352,7 +347,6 @@ attsufNONE,
 attsufNONE,
 attsufNONE,
 attsufNONE,
-attsufNONE,
 attsufINT,
 attsufINT,
 attsufINT,

+ 6 - 31
compiler/i386ins.dat

@@ -297,10 +297,6 @@ mem                   \300\2\x0F\xC7\201              PENT
 (Ch_All, Ch_None, Ch_none)
 void                  \2\x0F\xA2                      PENT
 
-[CS]
-(Ch_All, Ch_None, Ch_None)
-void                  \1\x2E                          8086,PRE
-
 [CWD]
 (Ch_MEAX, Ch_WEDX, Ch_None)
 void                  \320\1\x99                      8086
@@ -331,10 +327,6 @@ rm8                   \300\1\xF6\206                  8086
 rm16                  \320\300\1\xF7\206              8086
 rm32                  \321\300\1\xF7\206              386
 
-[DS]
-(Ch_All, Ch_None, Ch_None)
-void                  \1\x3E                          8086,PRE
-
 [EMMS]
 (Ch_FPU, Ch_None, Ch_None)
 void                  \2\x0F\x77                      PENT,MMX
@@ -343,10 +335,6 @@ void                  \2\x0F\x77                      PENT,MMX
 (Ch_RWESP, Ch_None, Ch_None)
 imm,imm               \1\xC8\30\25                    186
 
-[ES]
-(Ch_All, Ch_None, Ch_None)
-void                  \1\x26                          8086,PRE
-
 [F2XM1]
 (Ch_FPU, Ch_None, Ch_None)
 void                  \2\xD9\xF0                      8086,FPU
@@ -710,10 +698,6 @@ void                  \2\xD9\xFC                      8086,FPU
 (Ch_FPU, Ch_None, Ch_None)
 mem                   \300\1\xDD\204                  8086,FPU
 
-[FS]
-(Ch_All, Ch_None, Ch_None)
-void                  \1\x64                          386,PRE
-
 [FSAVE,fsaveX]
 (Ch_Wop1, Ch_None, Ch_None)
 mem                   \300\2\x9B\xDD\206              8086,FPU
@@ -856,10 +840,6 @@ void                  \2\xD9\xF1                      8086,FPU
 (Ch_FPU, Ch_None, Ch_None)
 void                  \2\xD9\xF9                      8086,FPU
 
-[GS]
-(Ch_All, Ch_None, Ch_None)
-void                  \1\x65                          386,PRE
-
 [HLT]
 (Ch_None, Ch_None, Ch_None)
 void                  \1\xF4                          8086,PRIV
@@ -1944,27 +1924,27 @@ void                  \332\321\1\xAF                  386
 (Ch_All, Ch_None, Ch_None)
 void                  \332\320\1\xAF                  8086
 
-[SEGCS]
+[SEGCS,cs]
 (Ch_None, Ch_None, Ch_None)
 void                  \1\x2E                          8086,PRE
 
-[SEGDS]
+[SEGDS,ds]
 (Ch_None, Ch_None, Ch_None)
 void                  \1\x3E                          8086,PRE
 
-[SEGES]
+[SEGES,es]
 (Ch_None, Ch_None, Ch_None)
 void                  \1\x26                          8086,PRE
 
-[SEGFS]
+[SEGFS,fs]
 (Ch_None, Ch_None, Ch_None)
 void                  \1\x64                          8086,PRE
 
-[SEGGS]
+[SEGGS,gs]
 (Ch_None, Ch_None, Ch_None)
 void                  \1\x65                          8086,PRE
 
-[SEGSS]
+[SEGSS,ss]
 (Ch_None, Ch_None, Ch_None)
 void                  \1\x36                          8086,PRE
 
@@ -2046,10 +2026,6 @@ mem                   \300\2\x0F\x01\204              286
 mem16                 \300\2\x0F\x01\204              286
 reg16                 \300\2\x0F\x01\204              286
 
-[SS]
-(Ch_All, Ch_None, Ch_None)
-void                  \1\x36                          8086,PRE
-
 [STC]
 (Ch_WFlags, Ch_None, Ch_None)
 void                  \1\xF9                          8086
@@ -2759,4 +2735,3 @@ mmxreg,mmxreg         \2\x0F\x0F\110\01\xBB           PENT,3DNOW,SM
 [FFREEP]
 (Ch_All, Ch_None, Ch_None)
 fpureg                \1\xDF\10\xC0                   PENT,3DNOW,FPU
-

+ 0 - 6
compiler/i386int.inc

@@ -33,17 +33,14 @@
 'cmpxchg486',
 'cmpxchg8b',
 'cpuid',
-'cs',
 'cwd',
 'cwde',
 'daa',
 'das',
 'dec',
 'div',
-'ds',
 'emms',
 'enter',
-'es',
 'f2xm1',
 'fabs',
 'fadd',
@@ -115,7 +112,6 @@
 'fptan',
 'frndint',
 'frstor',
-'fs',
 'fsave',
 'fscale',
 'fsetpm',
@@ -143,7 +139,6 @@
 'fxtract',
 'fyl2x',
 'fyl2xp1',
-'gs',
 'hlt',
 'ibts',
 'icebp',
@@ -346,7 +341,6 @@
 'smint',
 'smintold',
 'smsw',
-'ss',
 'stc',
 'std',
 'sti',

+ 0 - 6
compiler/i386op.inc

@@ -33,17 +33,14 @@ A_CMPXCHG,
 A_CMPXCHG486,
 A_CMPXCHG8B,
 A_CPUID,
-A_CS,
 A_CWD,
 A_CWDE,
 A_DAA,
 A_DAS,
 A_DEC,
 A_DIV,
-A_DS,
 A_EMMS,
 A_ENTER,
-A_ES,
 A_F2XM1,
 A_FABS,
 A_FADD,
@@ -115,7 +112,6 @@ A_FPREM1,
 A_FPTAN,
 A_FRNDINT,
 A_FRSTOR,
-A_FS,
 A_FSAVE,
 A_FSCALE,
 A_FSETPM,
@@ -143,7 +139,6 @@ A_FXCH,
 A_FXTRACT,
 A_FYL2X,
 A_FYL2XP1,
-A_GS,
 A_HLT,
 A_IBTS,
 A_ICEBP,
@@ -346,7 +341,6 @@ A_SMI,
 A_SMINT,
 A_SMINTOLD,
 A_SMSW,
-A_SS,
 A_STC,
 A_STD,
 A_STI,

+ 0 - 6
compiler/i386prop.inc

@@ -33,17 +33,14 @@
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_none)),
-(Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_MEAX, Ch_WEDX, Ch_None)),
 (Ch: (Ch_MEAX, Ch_None, Ch_None)),
 (Ch: (Ch_MEAX, Ch_None, Ch_None)),
 (Ch: (Ch_MEAX, Ch_None, Ch_None)),
 (Ch: (Ch_Mop1, Ch_WFlags, Ch_None)),
 (Ch: (Ch_RWEAX, Ch_WEDX, Ch_WFlags)),
-(Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_FPU, Ch_None, Ch_None)),
 (Ch: (Ch_RWESP, Ch_None, Ch_None)),
-(Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_FPU, Ch_None, Ch_None)),
 (Ch: (Ch_FPU, Ch_None, Ch_None)),
 (Ch: (Ch_FPU, Ch_None, Ch_None)),
@@ -115,7 +112,6 @@
 (Ch: (Ch_FPU, Ch_None, Ch_None)),
 (Ch: (Ch_FPU, Ch_None, Ch_None)),
 (Ch: (Ch_FPU, Ch_None, Ch_None)),
-(Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_Wop1, Ch_None, Ch_None)),
 (Ch: (Ch_FPU, Ch_None, Ch_None)),
 (Ch: (Ch_FPU, Ch_None, Ch_None)),
@@ -143,7 +139,6 @@
 (Ch: (Ch_FPU, Ch_None, Ch_None)),
 (Ch: (Ch_FPU, Ch_None, Ch_None)),
 (Ch: (Ch_FPU, Ch_None, Ch_None)),
-(Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_None, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
@@ -346,7 +341,6 @@
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_Wop1, Ch_None, Ch_None)),
-(Ch: (Ch_All, Ch_None, Ch_None)),
 (Ch: (Ch_WFlags, Ch_None, Ch_None)),
 (Ch: (Ch_SDirFlag, Ch_None, Ch_None)),
 (Ch: (Ch_WFlags, Ch_None, Ch_None)),

+ 0 - 42
compiler/i386tab.inc

@@ -1295,13 +1295,6 @@
     code    : #2#15#162;
     flags   : if_pent
   ),
-  (
-    opcode  : A_CS;
-    ops     : 0;
-    optypes : (ot_none,ot_none,ot_none);
-    code    : #1#46;
-    flags   : if_8086 or if_pre
-  ),
   (
     opcode  : A_CWD;
     ops     : 0;
@@ -1386,13 +1379,6 @@
     code    : #209#192#1#247#134;
     flags   : if_386
   ),
-  (
-    opcode  : A_DS;
-    ops     : 0;
-    optypes : (ot_none,ot_none,ot_none);
-    code    : #1#62;
-    flags   : if_8086 or if_pre
-  ),
   (
     opcode  : A_EMMS;
     ops     : 0;
@@ -1407,13 +1393,6 @@
     code    : #1#200#24#21;
     flags   : if_186
   ),
-  (
-    opcode  : A_ES;
-    ops     : 0;
-    optypes : (ot_none,ot_none,ot_none);
-    code    : #1#38;
-    flags   : if_8086 or if_pre
-  ),
   (
     opcode  : A_F2XM1;
     ops     : 0;
@@ -2464,13 +2443,6 @@
     code    : #192#1#221#132;
     flags   : if_8086 or if_fpu
   ),
-  (
-    opcode  : A_FS;
-    ops     : 0;
-    optypes : (ot_none,ot_none,ot_none);
-    code    : #1#100;
-    flags   : if_386 or if_pre
-  ),
   (
     opcode  : A_FSAVE;
     ops     : 1;
@@ -2898,13 +2870,6 @@
     code    : #2#217#249;
     flags   : if_8086 or if_fpu
   ),
-  (
-    opcode  : A_GS;
-    ops     : 0;
-    optypes : (ot_none,ot_none,ot_none);
-    code    : #1#101;
-    flags   : if_386 or if_pre
-  ),
   (
     opcode  : A_HLT;
     ops     : 0;
@@ -6965,13 +6930,6 @@
     code    : #192#2#15#1#132;
     flags   : if_286
   ),
-  (
-    opcode  : A_SS;
-    ops     : 0;
-    optypes : (ot_none,ot_none,ot_none);
-    code    : #1#54;
-    flags   : if_8086 or if_pre
-  ),
   (
     opcode  : A_STC;
     ops     : 0;

+ 8 - 1
compiler/ra386int.pas

@@ -1496,6 +1496,9 @@ Begin
       end
     else
      break;
+    { allow for newline after prefix or override }
+    while actasmtoken=AS_SEPARATOR do
+      Consume(AS_SEPARATOR);
   until (actasmtoken<>AS_OPCODE);
   { opcode }
   if (actasmtoken <> AS_OPCODE) then
@@ -1802,7 +1805,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.61  2000-03-15 23:10:01  pierre
+  Revision 1.62  2000-03-27 21:18:55  pierre
+    * "segss" prefix in Intel is converted into "ss" in ATT
+      and vice-versa. Fixes web bug 892.
+
+  Revision 1.61  2000/03/15 23:10:01  pierre
     * fix for bug 848 (that still genrated wrong code)
     + better testing for variables used in assembler
       (gives an error if variable is not directly reachable !)