Index: compiler/x86/aasmcpu.pas
===================================================================
--- compiler/x86/aasmcpu.pas	(revision 41674)
+++ compiler/x86/aasmcpu.pas	(working copy)
@@ -34,7 +34,7 @@
       cpubase,
       cgbase,cgutils,
       aasmbase,aasmtai,aasmsym,
-      ogbase;
+      ogbase,symtype;
 
     const
       { "mov reg,reg" source operand number }
@@ -461,6 +461,9 @@
          FOperandOrder : TOperandOrder;
          procedure init(_size : topsize); { this need to be called by all constructor }
       public
+         { We need to override ppuload and ppuwrite in order to account for FOperandOrder and opsize}
+         constructor ppuload(t: taitype; ppufile: tcompilerppufile); override;
+         procedure ppuwrite(ppufile: tcompilerppufile); override;
          { the next will reset all instructions that can change in pass 2 }
          procedure ResetPass1;override;
          procedure ResetPass2;override;
@@ -1624,6 +1627,23 @@
       end;
 
 
+    constructor taicpu.ppuload(t: taitype; ppufile: tcompilerppufile);
+      begin
+        inherited ppuload(t, ppufile);
+        opsize := TOpSize(ppufile.getbyte);
+        { If FOperandOrder doesn't get initialised, then it defaults to op_intel,
+          which will cause erroneous operand swapping during compilation. [Kit] }
+        FOperandOrder := op_att;
+      end;
+
+
+    procedure taicpu.ppuwrite(ppufile: tcompilerppufile);
+      begin
+        inherited ppuwrite(ppufile);
+        { Will default to S_NO when loaded later }
+        ppufile.putbyte(Byte(opsize));
+      end;
+
     procedure taicpu.ResetPass1;
       begin
         { we need to reset everything here, because the choosen insentry
