ysyx_22040000 李心杨 Linux calcite 6.1.69 #1-NixOS SMP PREEMPT_DYNAMIC Wed Dec 20 16:00:29 UTC 2023 x86_64 GNU/Linux 20:56:08 up 3 days 19:56, 2 users, load average: 0.65, 0.96, 0.78
40 lines
1.3 KiB
C
40 lines
1.3 KiB
C
/***************************************************************************************
|
|
* Copyright (c) 2014-2022 Zihao Yu, Nanjing University
|
|
*
|
|
* NEMU is licensed under Mulan PSL v2.
|
|
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
|
* You may obtain a copy of Mulan PSL v2 at:
|
|
* http://license.coscl.org.cn/MulanPSL2
|
|
*
|
|
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
|
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
|
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
|
*
|
|
* See the Mulan PSL v2 for more details.
|
|
***************************************************************************************/
|
|
|
|
#include <isa.h>
|
|
#include "local-include/reg.h"
|
|
#include "macro.h"
|
|
|
|
const char *regs[] = {
|
|
"$0", "ra", "sp", "gp", "tp", "t0", "t1", "t2",
|
|
"s0", "s1", "a0", "a1", "a2", "a3", "a4", "a5",
|
|
"a6", "a7", "s2", "s3", "s4", "s5", "s6", "s7",
|
|
"s8", "s9", "s10", "s11", "t3", "t4", "t5", "t6"
|
|
};
|
|
|
|
void isa_reg_display() {
|
|
int colomn_per_row = 4;
|
|
for(int i = 0; i < ARRLEN(regs); i++) {
|
|
printf("%3s: %#08x\t", reg_name(i), gpr(i));
|
|
if (i % colomn_per_row == 3)
|
|
putchar('\n');
|
|
else
|
|
putchar('|');
|
|
}
|
|
}
|
|
|
|
word_t isa_reg_str2val(const char *s, bool *success) {
|
|
return 0;
|
|
}
|