简体   繁体   English

在 RISCV memory 中加载 32 位立即数

[英]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.

相关问题 为什么MARS mips可以立即达到32位? - Why is MARS mips 32 bit immediate possible? 在 x86-64 asm 中:如果源操作数是两个立即值,是否有办法优化两个相邻的 32 位存储/写入 memory? - In x86-64 asm: is there a way of optimising two adjacent 32-bit stores / writes to memory if the source operands are two immediate values? 为什么我们不能将 64 位立即数移动到 memory? - why we can't move a 64-bit immediate value to memory? 将值从寄存器存储到 memory、ARM 32 位的问题 - Problem to store value ​from register into memory, ARM 32 bit 如何将立即值移位 - How to bit-shift an immediate value 如何知道某个数字可以在 ARM 中表示为 32 位立即数? - How to know that a certain number can be represented as 32 bit immediate in ARM? RISC 处理器中具有长(32 位和 64 位)立即操作数的指令 - Instructions with Long (32 and 64 bit) immediate operands in RISC processors 有没有办法在32位寄存器指令中立即保持字大小 - Is there a way to keep a word sized immediate in a 32bit register instruction 具有64位立即值的长模式(64位)相对调用 - Long mode (64 bit) relative call with a 64 bit immediate value 将1个字节的立即值添加到2个字节的内存位置 - add 1 byte immediate value to a 2 bytes memory location
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM