RISC-V shift instructions



in the documentation, I found this info in the mnemonics table about the shift instructions:

Shift left logical imm : ($slli a0 'a1 imm) : r0 = r1 >> 3

What’s that “3”? it should be “imm”, or not?



Thanks for spotting that - good to know someone’s reading it! There were many mistakes in that section of the table which I hope I’ve corrected now.

For definitive information I recommend:



Thanks a lot!
Is there a way to call a defcode’d function in another defcode’d function? :)


I don’t think there is a way to get the memory address of the function from uLisp code. If you had that, it should be no problem. That said, it kinda opens the same questions about calling conventions we discussed earlier.


I could provide a uLisp function to return the address of a machine code function defined with defcode, but note that the address could change if you delete and create other machine code functions.

Alternatively, you can create several functions within one defcode and make calls between them. For an example see:

ARM assembler examples - factor

The same would be possible on RISC-V.