From eeb1b927cee5fefe6910201447a23781ef4ea720 Mon Sep 17 00:00:00 2001 From: Greg King Date: Fri, 15 Jun 2018 11:01:14 -0400 Subject: [PATCH] Fixed the order in which the 65816's block-move instructions' operands are written and assembled. The source bank number is written first; but, assembled second. The destination bank is written second; but, assembled first. --- src/ca65/instr.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ca65/instr.c b/src/ca65/instr.c index 37217203a..8d1e96705 100644 --- a/src/ca65/instr.c +++ b/src/ca65/instr.c @@ -1298,10 +1298,16 @@ static void PutPCRel4510 (const InsDesc* Ins) static void PutBlockMove (const InsDesc* Ins) /* Handle the blockmove instructions (65816) */ { + ExprNode* Arg1 = Expression (); + Emit0 (Ins->BaseCode); - EmitByte (Expression ()); ConsumeComma (); + + /* The operands are written in Assembly code as source, destination; + ** but, they're assembled as . + */ EmitByte (Expression ()); + EmitByte (Arg1); } -- 2.39.5