This function writes an i32 variable into a buffer at the specified offset.
Syntax |
set_i32 (buffer, i32 offset, i32 set_val) |
---|---|
buffer |
Can be an array, a structure, or a register |
offset |
Offset in bytes |
set_val |
The I32 value to be written |
Validity |
Task, Rule |
Note |
NO range check is performed, it is up to the user to check that adding the offset and the data size does not exceed the maximum buffer size. See example. If the user wishes to write an i32 into the 'data' buffer of a structure of type bbc_msguser then he must use the function bcc_set_i32(). The mirror function is the get_i32() |
Once you have loaded the example program on a control, via a shell you can verify the operation of set_i32. To do this, set a value between 0 and 127 - sizeof(my_data) to the offset variable, then set a non-zero value to the R(1) register and verify that the variable my_data is equal to R(1).
|