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:
parent
86b642ba25
commit
d648660889
@ -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
|
||||||
|
|||||||
10
masm/main.go
10
masm/main.go
@ -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
|
||||||