venus
venus copied to clipboard
Unable to use .equ with li pseudo instruction.
My environment is using the VS Code extension for venus on Windows 10. I am writing some code and came across an oddity of using .equ with the li pseudo instruction. the code looks like:
.text
hash: .globl hash
.equ prime, 0x01000193
.equ seed, 0x811C9DC5
li a3, prime
li a0, seed
This results in the following error in the Venus Terminal:
AssemblerError: test.riscv:36: immediate value out of range: 16777619
li a3, prime
However, when I remove the .equ and assign the values directly it is successful:
.text
hash: .globl hash
li a3, 0x01000193
li a0, 0x811C9DC5
Looking at the riscv-asm-manual on github it appears what I'm trying to accomplish is the same as the example in the manual.