[WASM] mstore8 function implementation added.

This commit is contained in:
rodiazet 2020-01-15 14:06:36 +01:00
parent 9d9a7ebe25
commit 3760e90582
2 changed files with 5 additions and 5 deletions

View File

@ -577,8 +577,8 @@ function mstore_address(pos, a1, a2, a3, a4) {
mstore_internal(pos, 0, a1, a2, a3)
}
function mstore8(x1, x2, x3, x4, y1, y2, y3, y4) {
// TODO implement
unreachable()
let v := u256_to_byte(y1, y2, y3, y4)
i64.store8(to_internal_i32ptr(x1, x2, x3, x4), v)
}
// Needed?
function msize() -> z1, z2, z3, z4 {

View File

@ -1,15 +1,15 @@
{
mstore(0x30, not(0))
mstore8(0x20, 0xaa)
mstore8(0x25, 0xbbbb)
mstore8(0x26, 0xcc)
mstore8(0x3b, 0x11)
sstore(0, mload(0x20))
}
// ----
// Trace:
// INVALID()
// Memory dump:
// 60: 00000000000000000000000000000000ffffffffffffffffffffffffffffffff
// 20: aa0000000000cc000000000000000000ffffffffffffffffffffff11ffffffff
// 60: aa0000000000cc000000000000000000ffffffffffffffffffffff11ffffffff
// 80: ffffffffffffffffffffffffffffffff00000000000000000000000000000000
// Storage dump:
// 0000000000000000000000000000000000000000000000000000000000000000: aa0000000000cc000000000000000000ffffffffffffffffffffff11ffffffff