> compile NEMU
ysyx_22040000 李心杨 Linux calcite 6.1.75 #1-NixOS SMP PREEMPT_DYNAMIC Thu Jan 25 23:27:52 UTC 2024 x86_64 GNU/Linux 22:20:24 up 4:21, 2 users, load average: 0.12, 0.18, 0.21
This commit is contained in:
parent
3b98fd1372
commit
58e93a3848
1 changed files with 4 additions and 4 deletions
|
@ -189,12 +189,12 @@ static int cmd_x(char *args) {
|
||||||
goto wrong_usage;
|
goto wrong_usage;
|
||||||
// No deliminter here, just pass all the remain argument to `parse_expr()`
|
// No deliminter here, just pass all the remain argument to `parse_expr()`
|
||||||
arg = strtok(NULL, "");
|
arg = strtok(NULL, "");
|
||||||
word_t addr = parse_expr(arg, &res);
|
word_t start_addr = parse_expr(arg, &res);
|
||||||
if (!res)
|
if (!res)
|
||||||
goto wrong_usage;
|
goto wrong_usage;
|
||||||
addr = addr & ~(WORD_BYTES - 1);
|
start_addr = start_addr & ~(WORD_BYTES - 1);
|
||||||
for (vaddr_t vaddr = addr; vaddr < addr + n; vaddr += WORD_BYTES) {
|
for (vaddr_t vaddr = start_addr; vaddr < start_addr + n; vaddr += WORD_BYTES) {
|
||||||
word_t value = vaddr_read(addr, WORD_BYTES);
|
word_t value = vaddr_read(vaddr, WORD_BYTES);
|
||||||
printf("\e[1;34m" FMT_PADDR "\e[0m"
|
printf("\e[1;34m" FMT_PADDR "\e[0m"
|
||||||
" " FMT_WORD "\n",
|
" " FMT_WORD "\n",
|
||||||
vaddr, value);
|
vaddr, value);
|
||||||
|
|
Loading…
Reference in a new issue