Files
riscv-operating-system-mooc/code/asm/srai/test.c
2021-04-01 20:02:31 +08:00

9 lines
219 B
C

// for signed int, shift right is assembled to srai
// riscv64-unknown-elf-gcc -march=rv32ima -mabi=ilp32 -c -g test.c -o test.o
// riscv64-unknown-elf-objdump -S test.o
void foo()
{
int i = 0x80000000;
i = i >> 4;
}