Support for "virtual operands" of subroutines like this:

jsr	SomeProc
.byte	$00, $01 ; argument to SomeProc
; return here from SomeProc
bit	$3F
This commit is contained in:
AIDA Shinra
2018-06-10 18:09:11 +09:00
parent b74ab9de89
commit 9283e9ca98
9 changed files with 66 additions and 4 deletions

View 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;
}