简体   繁体   中英

load 32 bit immediate value in RISCV memory

I am trying to store a 32 bit immediate value in a riscv memory location.The corresponding code is

lui x13,0x12345
addi x13,x13,0x678   // 32 bit value- 12345678
lui x11, 0x1c010     // address location 1c01000
sw x13,x11

The problem I am facing is during simulation 32 bit value is not found in the address location(1c01000). Address location shows only 1 byte of the given data(78)

RISC-V is byte-addressable. If you only checked the one byte at that address, obviously it will contain only 1 byte of the 4-byte value.

You need to check the whole 32-bit word at that address, or the 4 bytes 1c01000.. 1c01003 separately.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM