diff options
Diffstat (limited to 'tasm')
| -rw-r--r-- | tasm/scripts/makefile | 2 | ||||
| -rw-r--r-- | tasm/src/assembler.c | 16 |
2 files changed, 15 insertions, 3 deletions
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 <triscv/csr.h> #include <tasm/assembler.h> #include <tasm/parser.h> #include <bits.h> @@ -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) |
