f32.store
Copies a f32 value into memory at the required location.

Syntax

f32.store 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 copy the data to.
f32 The data to be copied into memory.

Stack Out

NONE

Examples

;; Push the i32 memory offset value location onto the stack
i32.const 2

;; Push the f32 value to copy into memory onto the stack
f32.const 3.142

;; Pop the memory location and the value off the stack, set the memory
;; at the given location to the data value
f32.store

;; Memory: 
;; 0x00, 0x00, 0x87, 0x16
;; 0x49, 0x40, 0x00, 0x00
;; 0x00, 0x00, 0x00, 0x00
;; Push the i32 memory offset value location onto the stack
i32.const 2

;; Push the f32 value to copy into memory onto the stack
f32.const 3.142

;; Pop the memory location and the value off the stack, set the memory
;; at the given location to the data value
f32.store offset=2

;; Memory: 
;; 0x00, 0x00, 0x00, 0x00
;; 0x87, 0x16, 0x49, 0x40
;; 0x00, 0x00, 0x00, 0x00