~charles/awk-riscv

3e3a9d0dc5c8ef7c19fd11e0ab4fd50224d787d7 — Charles Daniels 10 months ago 8335460
assemble jalr
2 files changed, 16 insertions(+), 0 deletions(-)

M riscv.awk
A tests/simulation/jalr.txt
M riscv.awk => riscv.awk +5 -0
@@ 733,6 733,11 @@ function assemble() {
			unresolved[$3] = asmcursor
		}

	} else if (tolower($1) == "jalr") {
		asm_style = "I"
		asm_opcode = 0x67


	} else {
		printf("# ASSEMBLER ERROR: expected opcode, got '%s' (line %d: '%s')\n", $1, NR, asm_line)
		assemble_errors++

A tests/simulation/jalr.txt => tests/simulation/jalr.txt +11 -0
@@ 0,0 1,11 @@
tracemem 1
traceresolve 1

mode assemble
jalr x1 x2 5

mode normal

assert mem 0x0 0x005100e7

dump