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

Decode functions #15

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Decode functions #15

wants to merge 5 commits into from

Conversation

filipe1417
Copy link
Collaborator

No description provided.

@filipe1417 filipe1417 linked an issue Sep 20, 2024 that may be closed by this pull request
zepa.go Outdated Show resolved Hide resolved
zepa.go Outdated Show resolved Hide resolved
Copy link
Member

@thiagomanel thiagomanel left a 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

Copy link
Collaborator

@GeraldoSJr GeraldoSJr left a 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)
Copy link
Collaborator

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 {
Copy link
Collaborator

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
Copy link
Collaborator

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

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

Successfully merging this pull request may close these issues.

Creation of the decode
3 participants