i64.load32_s
Takes 32 bits (4 bytes) of memory from the given location and pushes it onto the stack as an i64
value.
This looks at the value as a signed integer (can be negative). If the 32 bit number in memory is a negative value,
then all the highter bits of the i64
number are set to 1, making it a negative number too.
Syntax
i64.load32_s offset=n align=n
Parameters
offset Optional
A numeric value that gives an extra offset to the memory location given.
Must be a positive value.
Can be written as a decimal number or using the 0x00 hexadecimal notation.
If the memory location is 8 and you add an extra offset of 2, then the final memory location is 10.
This is useful if you are using a data structure with fields at different locations inside.
align Optional
Gives information to the machine running the application about the alignment that could be used
when setting the location of the memory. This can only be 0, 1, 2, or 4.
You will not see any difference and it may not even be used. It is more of a hint than a command.
Stack In
i32 |
Memory offset location to get the data from. |
Stack Out
i64 |
The data copied from memory. |
Examples
i32.const 2
i64.load32_s
i32.const 4
i64.load32_s
i32.const 2
i64.load32_s offset=2