Closed WRansohoff closed 4 years ago
The example is clearly incorrect for the reason you pointed out.
I also agree we should dispense with the sexually charged choice of constant. I've rectified both problems with 219a2b2ee359e6feaab69033f228c528e800b8bd
Thank you! Appreciate the clarification
I might be doing this math wrong, but I think that maybe the "Load Immediate" example should use
0x33
as itsLUI
immediate instead of0x32
:Instead of:
When I do the math with
0x32
, I get0xC6FEBABE
, and I get the same result when I run( ( ( ( 0x32 << 12 ) - 1029 ) << 0xE ) - 1346 )
in Python. But it's possible that I am misunderstanding how the sign-extension orLUI
instruction works. Sorry that I can't verify this with anobjdump
, but this is what I get when I build the corresponding test code with GCC:(Compiled with:
riscv32-unknown-elf-gcc -x assembler-with-cpp -c -march=rv32i -o0 test.S -o test
Also, presented without judgement: I've gotten a few odd looks today for having
CAFEBABE
scribbled all over my notes when people come by to talk. Is it possible that something likeFEEDFACE
orDEC0FFEE
might work just as well?