[英]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我正在尝试将 32 位立即值存储在 riscv memory 位置。相应的代码是
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).我面临的问题是在模拟过程中在地址位置(1c01000)中找不到 32 位值。 Address location shows only 1 byte of the given data(78)地址位置仅显示给定数据的 1 个字节 (78)
RISC-V is byte-addressable. RISC-V 是字节可寻址的。 If you only checked the one byte at that address, obviously it will contain only 1 byte of the 4-byte value.如果您只检查该地址的一个字节,显然它将只包含 4 字节值的 1 个字节。
You need to check the whole 32-bit word at that address, or the 4 bytes 1c01000.. 1c01003 separately.您需要检查该地址的整个 32 位字,或分别检查 4 个字节 1c01000.. 1c01003。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.