实现中断与异常

This commit is contained in:
2025-04-18 19:18:49 +08:00
parent a096b91bc1
commit 38d433558d
11 changed files with 392 additions and 10 deletions

View File

@@ -44,12 +44,19 @@ int main()
{
int a=1;
int b=2;
// typedef void (*fun_t)(void);
// fun_t fun = (fun_t)0xffffffff;
// fun();
int c = add(a, b);
my_printf("Hello World! %s\n", "Andy");
my_printf("add(%d, %d)=%d\n", a, b, c);
a = 67;b = -78;
my_printf("mul(%d, %d)=%d\n", a, b, a * b);
my_printf("ram_val test: %s\n", g_string);
set_csr(mstatus, 0x00000008);
set_csr(mie, (1 << 3));
set_csr(mip, (1 << 3));
cpu_test();
return 0;
}