> 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
 21:53:07 up 20:43,  1 user,  load average: 0.27, 0.22, 0.19
This commit is contained in:
tracer-ics2023
2024-08-31 21:53:07 +08:00
committed by zzy
parent 5fd438e3ce
commit d96f878303

View File

@ -53,10 +53,10 @@ static struct rule {
{"/", '/'}, // div
{"\\(", '('}, // (
{"\\)", ')'}, // )
{"[0-9]+", TK_DEC}, // dec number
{"0[xX][0-9a-fA-F]+", TK_HEX}, // hex number
{"[$][0-9a-z]+", TK_REG}, // register
{"[0-9]+", TK_DEC}, // dec number
{"\\$[0-9a-z]+", TK_REG}, // register
};
#define NR_REGEX ARRLEN(rules)
@ -215,7 +215,7 @@ uint32_t eval(const Token* arr, int p, int q, bool* success) {
{
case TK_DEC: return atoi(arr[q].str);
case TK_HEX: return strtol(arr[q].str, NULL, 16);
case TK_REG: return isa_reg_str2val(arr[q].str, success);
case TK_REG: return isa_reg_str2val(arr[q].str + 1, success);
default:
*success = false;
break;