Do not put variables after code

Apparently the original assembler does not do this, and putting
them inline with the code is needed for subroutines
This commit is contained in:
Sasha Koshka 2022-10-27 17:37:25 -04:00
parent 86b642ba25
commit d648660889
2 changed files with 3 additions and 8 deletions

View File

@ -81,6 +81,7 @@ func (machine *Machine) Execute (offset int16) (err error) {
// Store the PC at address X and jump to X+1 // Store the PC at address X and jump to X+1
machine.memory[operand] = machine.counter machine.memory[operand] = machine.counter
machine.counter = operand machine.counter = operand
println(operand)
case LOAD: case LOAD:
// Load contents of address X into AC // Load contents of address X into AC

View File

@ -65,8 +65,7 @@ func main () {
origin := 0 origin := 0
originSet := false originSet := false
operations := []Statement { } statements := []Statement { }
symbols := []Statement { }
symbolTable := map[string] int { } symbolTable := map[string] int { }
// parse // parse