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

Update Acc32.hs #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

HochuWatermelon
Copy link

Fixed the text description of some commands. We don't work with values directly.

Fixed the text description of some commands. We don't work with values directly.
@@ -26,7 +26,7 @@ instance Hashable Register
-- | The 'Isa' type represents the instruction set architecture for the Acc32 machine.
-- Each constructor corresponds to a specific instruction.
data Isa w l
= -- | Syntax: @load_imm <value>@ Load an immediate value into the accumulator.
= -- | Syntax: @load_imm <address>@ Load an immediate value into the accumulator.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure? Maybe here it is an value?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'm a sure about that. There is usage example:
load_imm buf

Also in the code for load_imm we have:
LoadImm l -> LoadImm (deref' f l)

And the command realisation:
LoadImm a -> setAcc a >> nextPc

So we understand that the command receives the address of the label and loads this address value into the acc, but we can't directly load a value, because of the "deref' f l" instruction.

Maybe it should be like that:
Syntax: @load_imm

@ Load an immediate value of the address into the accumulator.

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.

2 participants