mikeakohn / naken_asm

Assembler for MSP430, dsPIC, ARM, MIPS, 65xx, 68000, 8051/8052, Atmel AVR8, and others.
http://www.mikekohn.net/micro/naken_asm.php
GNU General Public License v3.0
294 stars 50 forks source link

RISC-V: boundchecking with immediates #79

Closed ThomasAusNRW closed 4 years ago

ThomasAusNRW commented 4 years ago

I've made some first steps with RISC-V assembly and get some trouble with immediates:

Immediates values are 12 bit wide, but it's not possible without an error-message to assemble instructions like

addi x1, x2, 0xff8

which should be interpreted as -8 by sign-extension. But all I got is an bound-check-error. IMHO there is no need for an error-message. It can result in a warning, not an error.

Regards, Thomas

mikeakohn commented 4 years ago

I did this because I thought it would confuse people who might not realize it sign extends. If you really want I can remove it.