Add warning message

This commit is contained in:
Niles Rogoff 2017-07-02 14:22:09 -07:00
parent 00720d1602
commit 447f6e75d2
No known key found for this signature in database
GPG Key ID: B78B908F23430F80

View File

@ -76,8 +76,8 @@ while True:
break; break;
instruction = asm[rs["ip"]] instruction = asm[rs["ip"]]
if len(instruction) == 3: handle_three(instruction) if len(instruction) == 3: handle_three(instruction)
if len(instruction) == 2: handle_two(instruction) elif len(instruction) == 2: handle_two(instruction)
if len(instruction) == 1: elif len(instruction) == 1:
instruction = instruction[0] instruction = instruction[0]
if instruction == "debug": if instruction == "debug":
debug() debug()
@ -87,5 +87,7 @@ while True:
if instruction == "ret": if instruction == "ret":
rs["sp"] -= 1 rs["sp"] -= 1
rs["ip"] = ram[rs["sp"]] rs["ip"] = ram[rs["sp"]]
elif len(instruction) != 0:
print("Found suspiciously long instruction \"" + " ".join(instruction) + "\"")
rs["ip"] += 1 rs["ip"] += 1
debug() debug()