mirror of
https://github.com/pound-emu/pound.git
synced 2025-12-12 01:36:57 +00:00
Added print debug info, .write_byte and .read_byte to cpu, with boundary check and rewrote the test program to use those.
This commit is contained in:
parent
e6829ef94c
commit
cb485588cd
2 changed files with 31 additions and 7 deletions
15
ui/main.cpp
15
ui/main.cpp
|
|
@ -3,20 +3,23 @@
|
|||
|
||||
#include <cstdio>
|
||||
|
||||
int main()
|
||||
{
|
||||
int main() {
|
||||
CPU cpu;
|
||||
cpu.pc = 0;
|
||||
|
||||
// Simple ARMv8 program in memory (MOVZ X0, #5; ADD X0, X0, #3; RET)
|
||||
// These are placeholders; real encoding will be parsed later
|
||||
cpu.memory[0] = 0x05; // MOVZ placeholder
|
||||
cpu.memory[4] = 0x03; // ADD placeholder
|
||||
cpu.memory[8] = 0xFF; // RET placeholder
|
||||
cpu.write_byte(0, 0x05); // MOVZ placeholder
|
||||
cpu.write_byte(4, 0x03); // ADD placeholder
|
||||
cpu.write_byte(8, 0xFF); // RET placeholder
|
||||
|
||||
printf("%u\n", cpu.read_byte(0));
|
||||
|
||||
JIT jit;
|
||||
jit.translate_and_run(cpu);
|
||||
|
||||
printf("X0 = %llu\n", cpu.regs[0]);
|
||||
cpu.print_debug_information();
|
||||
|
||||
printf("X0 = %lu\n", cpu.x(0));
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue