Skip to content

BTST and BCLR with immediate word address gives wrong address #97

@Willyarma

Description

@Willyarma

I'm not sure if I'm doing something wrong but I was trying to run a program with the 2 following op codes and I'm getting the wrong address.

0838 0004 fa01 BTST #4,$0000fa01
08b8 0006 fa11 BCLR #6,$0000fa11

The address is a 16 bit word immediate constant.
I'm getting an 8 bit read from $fffa01 and $fffa11 instead of $00fa01 and $00fa11

After looking through the Musashi code I noticed that its using a function called:
EA_AW_8()
which in turn calls:
MAKE_INT_16()

This routine is changing the address into a signed number when I'm sure is should be unsigned.
This is causing it to change the upper part of the address from 00 to ff.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions