> compile NEMU
ysyx_22040000 李心杨 Linux calcite 6.1.71 #1-NixOS SMP PREEMPT_DYNAMIC Fri Jan 5 14:18:41 UTC 2024 x86_64 GNU/Linux 22:17:14 up 2 days 11:12, 2 users, load average: 1.39, 0.69, 0.39
This commit is contained in:
parent
f5cdb499b8
commit
c995a80ce8
7 changed files with 815 additions and 4 deletions
|
@ -36,5 +36,15 @@ void isa_reg_display() {
|
|||
}
|
||||
|
||||
word_t isa_reg_str2val(const char *s, bool *success) {
|
||||
return 0;
|
||||
assert(s);
|
||||
int i;
|
||||
for (i = 0; i < 32 && strcmp(s, regs[i]) != 0; i++)
|
||||
;
|
||||
|
||||
if (i == 32) {
|
||||
success = false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return gpr(i);
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
%%
|
||||
|
||||
$?[a-zA-Z]{2,3} { yylval = isa_reg_str2val(yytext, &success); if(!success) { return YYerror; } }
|
||||
$$?[a-zA-Z]{2,3} { yylval = isa_reg_str2val(yytext + 1, &success); if(!success) { return YYerror; } }
|
||||
0[xX][0-9a-fA-F]+ { yylval = strtoul(yytext, NULL, 16); return HEX_NUMBER; }
|
||||
[0-9]+ { yylval = strtoul(yytext, NULL, 10); return NUMBER; }
|
||||
[+\-*/()] { return *yytext; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue