From a152fbd956cc9cb9c05a233abe004ba3d12767a0 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Sun, 21 Jan 2024 23:10:36 +0200 Subject: start working on virtual memory --- tasm/src/assembler.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'tasm/src') diff --git a/tasm/src/assembler.c b/tasm/src/assembler.c index ba61045..0e06a1e 100644 --- a/tasm/src/assembler.c +++ b/tasm/src/assembler.c @@ -1,3 +1,4 @@ +#include #include #include #include @@ -555,8 +556,19 @@ tri_t check_nop3(const char *nop) tri_t check_csr(const char *csr) { /** @todo only mpower supported for now, will have to work on this */ - assert(strcmp(csr, "mpower")); - return tri_from(-9841); + if (strcmp(csr, "mpower")) + return tri_from(CSR_MPOWER); + + if (strcmp(csr, "satpp")) + return tri_from(CSR_SATPP); + + if (strcmp(csr, "satpo")) + return tri_from(CSR_SATPO); + + if (strcmp(csr, "satpn")) + return tri_from(CSR_SATPN); + + assert(0); } tri_t check_width(const char *width) -- cgit v1.3