From ad0b0455d8cd05611d1d53c4c4903b6e658724d3 Mon Sep 17 00:00:00 2001 From: florian Date: Thu, 4 Apr 2013 21:06:10 +0000 Subject: [PATCH] * extended comment git-svn-id: branches/i8086@24152 - --- compiler/x86/aasmcpu.pas | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/compiler/x86/aasmcpu.pas b/compiler/x86/aasmcpu.pas index bec967a1ed..a260d5c742 100644 --- a/compiler/x86/aasmcpu.pas +++ b/compiler/x86/aasmcpu.pas @@ -312,7 +312,14 @@ interface were reversed and GAS still keeps this "feature" for compatibility. for details: http://sourceware.org/binutils/docs/as/i386_002dBugs.html#i386_002dBugs http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=372528 - http://en.wikibooks.org/wiki/X86_Assembly/GAS_Syntax#Caveats } + http://en.wikibooks.org/wiki/X86_Assembly/GAS_Syntax#Caveats + + Since FPC is "GAS centric" due to its history it generates instructions with the same operand order so + when generating output for other assemblers, the opcodes must be fixed before writing them. + This function returns the fixed opcodes. Changing the opcodes permanently is no good idea + because in case of smartlinking assembler is generated twice so at the second run wrong + assembler is generated. + } function FixNonCommutativeOpcodes: tasmop; private FOperandOrder : TOperandOrder;