Browse Source

* use the 'wait' prefix (on the same line as the instruction), instead of
'db 09bh' (on the previous line) for the fwait prefixed 8087 instructions in
the nasm assembly output, because it looks prettier this way :)

git-svn-id: trunk@26185 -

nickysn 11 years ago
parent
commit
2d45ea43af
1 changed files with 4 additions and 2 deletions
  1. 4 2
      compiler/x86/agx86nsm.pas

+ 4 - 2
compiler/x86/agx86nsm.pas

@@ -582,6 +582,7 @@ interface
       e        : extended;
       e        : extended;
 {$endif cpuextended}
 {$endif cpuextended}
       fixed_opcode: TAsmOp;
       fixed_opcode: TAsmOp;
+      prefix   : string;
     begin
     begin
       if not assigned(p) then
       if not assigned(p) then
        exit;
        exit;
@@ -972,12 +973,13 @@ interface
                 AsmWriteln(#9#9'DB'#9'09bh')
                 AsmWriteln(#9#9'DB'#9'09bh')
                else
                else
                 begin
                 begin
+                  prefix:='';
 {$ifdef i8086}
 {$ifdef i8086}
                   { nickysn note: I don't know if the 187 requires FWAIT before
                   { nickysn note: I don't know if the 187 requires FWAIT before
                     every instruction like the 8087, so I'm including it just in case }
                     every instruction like the 8087, so I'm including it just in case }
                   if (current_settings.cputype<=cpu_186) and
                   if (current_settings.cputype<=cpu_186) and
                       requires_fwait_on_8087(fixed_opcode) then
                       requires_fwait_on_8087(fixed_opcode) then
-                    AsmWriteln(#9#9'DB'#9'09bh');
+                    prefix:='wait '+prefix;
 {$endif i8086}
 {$endif i8086}
 {$ifndef i8086}
 {$ifndef i8086}
                   { We need to explicitely set
                   { We need to explicitely set
@@ -990,7 +992,7 @@ interface
                       (is_segment_reg(taicpu(hp).oper[0]^.reg)) then
                       (is_segment_reg(taicpu(hp).oper[0]^.reg)) then
                     AsmWriteln(#9#9'DB'#9'066h');
                     AsmWriteln(#9#9'DB'#9'066h');
 {$endif not i8086}
 {$endif not i8086}
-                  AsmWrite(#9#9+std_op2str[fixed_opcode]+cond2str[taicpu(hp).condition]);
+                  AsmWrite(#9#9+prefix+std_op2str[fixed_opcode]+cond2str[taicpu(hp).condition]);
                   if taicpu(hp).ops<>0 then
                   if taicpu(hp).ops<>0 then
                    begin
                    begin
                      if is_calljmp(fixed_opcode) then
                      if is_calljmp(fixed_opcode) then