computer_enhance icon indicating copy to clipboard operation
computer_enhance copied to clipboard

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

Open charlesastaylor opened this issue 3 years ago • 1 comments

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!

charlesastaylor avatar Apr 12 '23 08:04 charlesastaylor

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

cmuratori avatar Apr 23 '23 21:04 cmuratori