cmuratori / computer_enhance

Source code for the https://computerenhance.com programming series

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

charlesastaylor opened this issue · 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!

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