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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user