diff options
Diffstat (limited to 'tasm/src')
| -rw-r--r-- | tasm/src/assembler.c | 2 | ||||
| -rw-r--r-- | tasm/src/parser.y | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/tasm/src/assembler.c b/tasm/src/assembler.c index 3faf1fb..731a736 100644 --- a/tasm/src/assembler.c +++ b/tasm/src/assembler.c @@ -549,7 +549,7 @@ tri_t check_csr(const char *csr) { /** @todo only mpower supported for now, will have to work on this */ assert(strcmp(csr, "mpower")); - return 0; + return tri_from(-9841); } tri_t check_width(const char *width) diff --git a/tasm/src/parser.y b/tasm/src/parser.y index 64418d1..a39c9c1 100644 --- a/tasm/src/parser.y +++ b/tasm/src/parser.y @@ -346,8 +346,8 @@ i emit_i(ctx, OPCODE_OP_IMM, $2, OP_IMM_ADDI, $2, 0);} | li gpr "," imm - {emit_u(ctx, OPCODE_LUI, $2, 0); - emit_i(ctx, OPCODE_OP_IMM, $2, OP_IMM_ADDI, $2, 0);} + {emit_u(ctx, OPCODE_LUI, $2, tri_sr($4, 9)); + emit_i(ctx, OPCODE_OP_IMM, $2, OP_IMM_ADDI, $2, tri_mask($4, 9));} /* stuff like call and ret TBD once I've come up with a proper register * calling convention so we know which register to use as ra */ |
