da65: adding support for 4510 cpu of c65

This commit is contained in:
Sven Oliver Moll
2016-09-20 17:37:10 +02:00
parent bcdd190020
commit d0ed84c2d0
9 changed files with 772 additions and 2 deletions

View File

@@ -227,6 +227,13 @@ void OH_Immediate (const OpcDesc* D)
void OH_ImmediateWord (const OpcDesc* D)
{
OneLine (D, "#$%04X", GetCodeWord (PC+1));
}
void OH_Direct (const OpcDesc* D)
{
/* Get the operand */
@@ -349,6 +356,23 @@ void OH_RelativeLong (const OpcDesc* D attribute ((unused)))
void OH_RelativeLong4510 (const OpcDesc* D attribute ((unused)))
{
/* Get the operand */
signed short Offs = GetCodeWord (PC+1);
/* Calculate the target address */
unsigned Addr = (((int) PC+2) + Offs) & 0xFFFF;
/* Generate a label in pass 1 */
GenerateLabel (D->Flags, Addr);
/* Output the line */
OneLine (D, "%s", GetAddrArg (D->Flags, Addr));
}
void OH_DirectIndirect (const OpcDesc* D)
{
/* Get the operand */
@@ -377,6 +401,20 @@ void OH_DirectIndirectY (const OpcDesc* D)
void OH_DirectIndirectZ (const OpcDesc* D)
{
/* Get the operand */
unsigned Addr = GetCodeByte (PC+1);
/* Generate a label in pass 1 */
GenerateLabel (D->Flags, Addr);
/* Output the line */
OneLine (D, "(%s),z", GetAddrArg (D->Flags, Addr));
}
void OH_DirectXIndirect (const OpcDesc* D)
{
/* Get the operand */
@@ -508,9 +546,24 @@ void OH_DirectIndirectLongX (const OpcDesc* D attribute ((unused)))
static void impl_StackRelativeIndirectY (const char *sp, const OpcDesc* D attribute ((unused)))
{
/* Output the line */
OneLine (D, "($%02X,%s),y", GetCodeByte (PC+1), sp);
}
void OH_StackRelativeIndirectY (const OpcDesc* D attribute ((unused)))
{
Error ("Not implemented");
impl_StackRelativeIndirectY( "s", D );
}
void OH_StackRelativeIndirectY4510 (const OpcDesc* D attribute ((unused)))
{
impl_StackRelativeIndirectY( "sp", D );
}