I am trying to write some RISC-V (standard) code that will calculate the absolute value of an integer. My unit tests are failing so i am not sure where the bug in my logic is. Does anybody have any advice?
# FUNCTION: Given an int return its absolute value.
# a0 (int) is input integer
# a0 (int) the absolute value of the input
# return 0
mv a0, zero
Hi Brendan Marshal,
Arm processors do not "speak" RISC-V but rather the Arm ISA. See this guide for example for an introduction to the Arm instruction set.
It might be worth posting your question also to a forum, where people are more familiar with the RISC-V instruction set.
View all questions in Community Help forum