#include <stdarg.h>
/* common */
+#include "xmalloc.h"
#include "xsprintf.h"
/* da65 */
void OH_BitBranch (const OpcDesc* D)
{
+ char* BranchLabel;
+
/* Get the operands */
unsigned char TestAddr = GetCodeByte (PC+1);
signed char BranchOffs = GetCodeByte (PC+2);
GenerateLabel (D->Flags, TestAddr);
GenerateLabel (flLabel, BranchAddr);
+ /* Make a copy of an operand, so that
+ ** the other operand can't overwrite it.
+ ** [GetAddrArg() uses a statically-stored buffer.]
+ */
+ BranchLabel = xstrdup (GetAddrArg (flLabel, BranchAddr));
+
/* Output the line */
- OneLine (D, "%s,%s", GetAddrArg (D->Flags, TestAddr), GetAddrArg (flLabel, BranchAddr));
+ OneLine (D, "%s,%s", GetAddrArg (D->Flags, TestAddr), BranchLabel);
+
+ xfree (BranchLabel);
}
-void OH_BlockMove (const OpcDesc* D attribute ((unused)))
+void OH_BlockMove (const OpcDesc* D)
{
+ char* DstLabel;
+
/* Get source operand */
unsigned Src = GetCodeWord (PC+1);
/* Get destination operand */
GenerateLabel (D->Flags, Src);
GenerateLabel (D->Flags, Dst);
+ /* Make a copy of an operand, so that
+ ** the other operand can't overwrite it.
+ ** [GetAddrArg() uses a statically-stored buffer.]
+ */
+ DstLabel = xstrdup (GetAddrArg (D->Flags, Dst));
+
/* Output the line */
- OneLine (D, "%s%s,%s%s,#$%02X",
+ OneLine (D, "%s%s,%s%s,$%04X",
GetAbsOverride (D->Flags, Src), GetAddrArg (D->Flags, Src),
- GetAbsOverride (D->Flags, Dst), GetAddrArg (D->Flags, Dst),
+ GetAbsOverride (D->Flags, Dst), DstLabel,
GetCodeWord (PC+5));
+
+ xfree (DstLabel);
}
}
SeparatorLine ();
}
+
+
+
+void OH_JmpAbsoluteXIndirect (const OpcDesc* D)
+{
+ OH_AbsoluteXIndirect (D);
+ if (NewlineAfterJMP) {
+ LineFeed ();
+ }
+ SeparatorLine ();
+}