-
Notifications
You must be signed in to change notification settings - Fork 1
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
Decode functions #15
base: main
Are you sure you want to change the base?
Decode functions #15
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall, it seems ok. Anyway, I think we can harness our iotas better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missings tests for failed cases, in which you pass parameters that should fail, the code seems to expect only "right" tries.
offsetOpcode := word - opcodeLength | ||
opcode := instruction >> (uint32(offsetOpcode)) | ||
|
||
return Opcode(opcode) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function should return an error if the opcode provided cannot be mapped to one of the options, even if the assembler checks this on a higher level changes will happen and is safe to add this check.
} | ||
|
||
func (m *Machine) decode() {} | ||
func (m *Machine) decodeRTypeInst(instruction uint32) Instruction { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should return an error checking the operands
} | ||
|
||
func (m *Machine) decodeITypeInst(instruction uint32) Instruction { | ||
offsetOpcode := word - opcodeLength |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should return an error checking the operands
No description provided.