CPU/ASM/debug.py

20 lines
387 B
Python
Raw Normal View History

2024-04-29 16:00:03 +08:00
CMDs = ["prt", "prtr", "prtm"]
def prt(self, operand):
print(operand[0])
def prtr(self, operand):
if len(operand) > 0:
print(self.registers[int(operand[0])], end="")
else:
print(self.registers, end="")
def prtm(self, operand):
if len(operand) > 0:
print(self.dtMemory[int(operand[0])], end="")
else:
print(self.dtMemory, end="")