Skip to content

Unable to use .equ with li pseudo instruction. #29

@houghtonap

Description

@houghtonap

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions