Browse Source

* fixed the writing of 6502 branch instructions

Nikolay Nikolov 1 year ago
parent
commit
2de07f128c
1 changed files with 13 additions and 8 deletions
  1. 13 8
      compiler/mos6502/agsdas6500.pas

+ 13 - 8
compiler/mos6502/agsdas6500.pas

@@ -312,16 +312,21 @@ unit agsdas6500;
       var
       var
         i: Integer;
         i: Integer;
       begin
       begin
-        writer.AsmWrite(#9#9+std_op2str[hp.opcode]);
-        if (taicpu(hp).ops<>0) or (hp.condition<>C_None) then
+        if hp.opcode=A_Bxx then
+          begin
+            if hp.condition=C_None then
+              internalerror(2024040702);
+            writer.AsmWrite(#9#9'b'+cond2str[hp.condition]);
+          end
+        else
           begin
           begin
-            writer.AsmWrite(#9);
             if hp.condition<>C_None then
             if hp.condition<>C_None then
-              begin
-                writer.AsmWrite(uppercond2str[hp.condition]);
-                if taicpu(hp).ops<>0 then
-                  writer.AsmWrite(',');
-              end;
+              internalerror(2024040703);
+            writer.AsmWrite(#9#9+std_op2str[hp.opcode]);
+          end;
+        if taicpu(hp).ops<>0 then
+          begin
+            writer.AsmWrite(#9);
             for i:=0 to taicpu(hp).ops-1 do
             for i:=0 to taicpu(hp).ops-1 do
               begin
               begin
                 if i<>0 then
                 if i<>0 then