Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with li pseudo instruction #42

Closed
jlusiardi opened this issue Nov 8, 2019 · 2 comments
Closed

Error with li pseudo instruction #42

jlusiardi opened this issue Nov 8, 2019 · 2 comments

Comments

@jlusiardi
Copy link

Hi,

I think there is an issue with either the code that replaces the li pseudo instruction with lui and addi or one of this instructions is buggy.

To reproduce, enter this source code:

li x1, 1193046

The assembled output is:

lui x1 292
addi x1 x1 1110

Executing this code, I don't see the expected value of 1193046 in x1 but 1197142.

But, if I execute the following code, the result in x2 is correct.

lui x2, 292
addi x2, x2, 1110

Regards
Joachim

@mortbopet
Copy link
Owner

I suspect that you might be running an outdated version of Ripes.

li x1, 1193046 in the available continuous build assembles as

lui x1 291
addi x1 x1 1110

and executes to x1=0x00123456.

@jlusiardi
Copy link
Author

Fixed in continuous with hash d3ac2c2. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants