diff --git a/riscemu/CPU.py b/riscemu/CPU.py index 267ebc3..7de1aa0 100644 --- a/riscemu/CPU.py +++ b/riscemu/CPU.py @@ -83,6 +83,7 @@ class CPU: launch_debug_session(self, self.mmu, self.regs, "Exception encountered, launching debug:".format(self.pc-1)) + print() print(FMT_CPU + "Program exited with code {}".format(self.exit_code) + FMT_NONE) def __run_instruction(self, ins: 'LoadedInstruction'): diff --git a/riscemu/Syscall.py b/riscemu/Syscall.py index 7622154..1ea4a9d 100644 --- a/riscemu/Syscall.py +++ b/riscemu/Syscall.py @@ -70,12 +70,12 @@ class SyscallInterface: """ fileno = scall.registers.get('a0') addr = scall.registers.get('a1') - len = scall.registers.get('a2') + size = scall.registers.get('a2') if fileno not in self.open_files: scall.registers.set('a0', -1) return - chars = self.open_files[fileno].read(len) + chars = self.open_files[fileno].read(size) try: data = bytearray(chars, 'ascii') scall.cpu.mmu.write(addr, len(data), data)