~charles/awk-riscv

59f15a918f4584ab4cd873ad68b5faa637b11368 — Charles Daniels 8 months ago ce30c93 master
add error message on invalid register
1 files changed, 4 insertions(+), 1 deletions(-)

M riscv.awk
M riscv.awk => riscv.awk +4 -1
@@ 538,7 538,10 @@ function parsereg(r) {
	else if (r == "29" || r == "t4" || r == "x29") { return 29 }
	else if (r == "30" || r == "t5" || r == "x30") { return 30 }
	else if (r == "31" || r == "t6" || r == "x31") { return 31 }
	else {return -1}
	else {
		printf("# ASSEMBLER ERROR: expected register, got '%s', (line %d: '%s')\n", r, NR, asm_line)
		return -1
	}
}

#### DISASSEMBLER #############################################################