Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question on BTST (and BCLR, BCHG, BSET) #3

Open
xahon opened this issue Feb 5, 2023 · 2 comments
Open

Question on BTST (and BCLR, BCHG, BSET) #3

xahon opened this issue Feb 5, 2023 · 2 comments

Comments

@xahon
Copy link

xahon commented Feb 5, 2023

Why BTST dest size is 2 bytes?

BTST 0000_ddd1_00mm_mrrr sz=4; src=cs.data_reg_op(d); dst=cs.ea(r, m, 2);

According to the manual it can't have Word type, only Byte and Long.

I also noticed that you set mask for the next word as follows

BTST 0000_1000_00mm_mrrr 0000_000n_nnnn_nnnn sz=1; src=IMM16(n); dst=cs.ea(r, m, 1);

But the manual says it's 8-bits value
image
Is it a bug or you made it intentionally for some reason? The same applies to the next 3 instructions


An offtop question:
Can you explain how does these 4 instructions work?
I mean that what is "bit number" in the data/register? Both data and register can contain not a single but multiple bits (up to 32 in a register and 8 in next word data [according to the manual scheme]) like 0b01010101. It doesn't make sense then because the product of the instruction is a single bit in CCR

@deplinenoise
Copy link
Owner

Probably a copy-pasta oversight. I'm not using this library for anything currently.

@deplinenoise
Copy link
Owner

Care to submit a patch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants