Skip to content

Commit

Permalink
Update switch cases for ADDA, MOVA
Browse files Browse the repository at this point in the history
  • Loading branch information
aleury committed Aug 18, 2023
1 parent 40a6c3f commit a017ec1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions gmachine.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,12 @@ func (g *Machine) Run() {
case OpDECA:
g.A--
case OpADDA:
reg := g.Next()
switch reg {
switch g.Next() {
case RegX:
g.A += g.X
}
case OpMOVA:
reg := g.Next()
switch reg {
switch g.Next() {
case RegX:
g.X = g.A
}
Expand Down

0 comments on commit a017ec1

Please sign in to comment.