Hey. Installed GNU MCU Eclipse RISC-V Embedded GCC v8.2.0-2.2 20190521. Use riscv-none-embed-as.exe for a simple program. But the results are a little surprised.
When processing code
.section .text
start: add x3, x1, x2
bne x2, x3, 8
The result is:
1 .section .text
2
3 0000 B3812000 start: add x3, x1, x2
4 0004 63043100 bne x2, x3, 8
4 6F000000
5 000c 63143100 beq x2, x3, 8
5 6F000000
although according to the specification it should be like this:
4 0004 63143100 bne x2, x3, 8
5 000c 63043100 beq x2, x3, 8
yes, and what is 6f000000?
Second question. Why when I write another constant in the beq instruction, the result of the machine instruction does not change and remains the same as for the constant 8?
If instead of a constant I use the label start, then the command generally turns into xE31E31FE.
To assemble using this command:
riscv-none-embed-as -al -o a main.S -fPIC -march = rv32i -mabi = ilp32
Thank.