Skip to content

Commit 753cca7

Browse files
committed
Trim semicolon in instructions
1 parent ffd1d14 commit 753cca7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Memory/InstructionMemory.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ func (instructionMemory *InstructionMemory) ValidateAndExecuteInstruction() erro
232232

233233
} else {
234234

235-
err = errors.New("Invalid instruction type on line number " + string(instructionMemory.PC+1))
235+
err = errors.New("Invalid instruction type in " + currentInstruction)
236236

237237
}
238238

arm.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func main() {
5656
fmt.Println("Error while reading file : ", err)
5757
return
5858
}
59-
line = strings.TrimSpace(line)
59+
line = strings.TrimSpace(strings.TrimRight(line, ";"))
6060
Memory.InstructionMem.Instructions = append(Memory.InstructionMem.Instructions, line)
6161
}
6262

0 commit comments

Comments
 (0)