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

Push instruction decode has operand 0 as Operand_None operand 1 as Operand_Register #21

Open
charlesastaylor opened this issue Apr 12, 2023 · 1 comment

Comments

@charlesastaylor
Copy link
Contributor

charlesastaylor commented Apr 12, 2023

Hi Casey,

Calling Sim86_RegisterNameFromOperand on a push r instruction, eg push cx, gives an instruction that has the register in Operands[1], while Operands[0] is Operand_None.

This surprised me when setting up to use your shared library to decode (which otherwise was incredibly easy to use/understand!). Looking at your code I'm afraid I can't tell for sure if this is an issue or if it is expected, so this might not be an issue at all!

Loving the course btw!

@cmuratori
Copy link
Owner

Looking at some of these, it appears that this is a bug in the table. There are a few instructions (inc and dec are some more) that should have ImpD(1) in the table to specify that the register is a destination, and should be in the first slot. But the table doesn't have that. I should probably add a test to ensure that if there is only one parameter, it is in slot 0!

- Casey

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