]> git.sur5r.net Git - cc65/blobdiff - src/da65/handler.c
Support for "virtual operands" of subroutines like this:
[cc65] / src / da65 / handler.c
index 6249523630005ed7c6a252e1e57f128730240d8f..19b8946de6aadfa795d4a0ec2cc7abf22e562164 100644 (file)
@@ -51,6 +51,8 @@
 
 
 
+static unsigned short SubroutineVOperandSize[0x10000];
+
 /*****************************************************************************/
 /*                             Helper functions                              */
 /*****************************************************************************/
@@ -741,3 +743,31 @@ void OH_JmpAbsoluteXIndirect (const OpcDesc* D)
     }
     SeparatorLine ();
 }
+
+
+
+void OH_JsrAbsolute (const OpcDesc* D)
+{
+    unsigned VOperandSize = SubroutineVOperandSize[GetCodeWord(PC+1)];
+    OH_Absolute (D);
+    if (VOperandSize > 0) {
+        unsigned RemainingBytes;
+        PC += D->Size;
+        RemainingBytes = GetRemainingBytes();
+        if (RemainingBytes < VOperandSize) {
+            VOperandSize = RemainingBytes;
+        }
+        if (VOperandSize > 0) {
+            DataByteLine (VOperandSize); /* FIXME: follow BytesPerLine */
+            PC += VOperandSize;
+        }
+        PC -= D->Size;
+    }
+}
+
+
+
+void SetSubroutineVOperand (unsigned Addr, unsigned Size)
+{
+    SubroutineVOperandSize[Addr] = Size;
+}