> compile NEMU
221220000 张三 Linux zzy 5.15.146.1-microsoft-standard-WSL2 #1 SMP Thu Jan 11 04:09:03 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux 13:51:57 up 1 day, 12:42, 1 user, load average: 0.35, 0.30, 0.24
This commit is contained in:
@ -24,6 +24,7 @@ const char *regs[] = {
|
||||
};
|
||||
|
||||
void isa_reg_display() {
|
||||
printf("%-16s"FMT_PADDR"\n", "pc", cpu.pc);
|
||||
for (size_t i = 0; i < ARRLEN(regs); i++) {
|
||||
const char *name = reg_name(i);
|
||||
|
||||
@ -32,12 +33,13 @@ void isa_reg_display() {
|
||||
}
|
||||
|
||||
word_t isa_reg_str2val(const char *s, bool *success) {
|
||||
*success = false;
|
||||
if (strcmp(s, "pc") == 0) return cpu.pc;
|
||||
for (int i = 0; i < ARRLEN(regs); i ++) {
|
||||
if (strcmp(s, reg_name(i)) == 0) {
|
||||
*success = true;
|
||||
*success &= true;
|
||||
return gpr(i);
|
||||
}
|
||||
}
|
||||
*success &= false;
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user