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/scripts/makefile | 2 +- tasm/src/assembler.c | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'tasm') diff --git a/tasm/scripts/makefile b/tasm/scripts/makefile index 5c87c98..cb7108f 100644 --- a/tasm/scripts/makefile +++ b/tasm/scripts/makefile @@ -41,7 +41,7 @@ WARNFLAGS = -Wall -Wextra COMPILE_FLAGS = $(CFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(OBFLAGS) $(ASSERTFLAGS) \ $(DEBUGFLAGS) -INCLUDE_FLAGS = -I include -I ../core +INCLUDE_FLAGS = -I include -I ../core -I ../triscv/include # This makes sure .bss is loaded into the binary OBJCOPY_FLAGS ?= -Obinary -R .garbage \ 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