Skip to content

Instantly share code, notes, and snippets.

@kangsangsoo
Created February 13, 2023 13:29
Show Gist options
  • Save kangsangsoo/d6002f0ed37f9158e97e577d08f0c89e to your computer and use it in GitHub Desktop.
Save kangsangsoo/d6002f0ed37f9158e97e577d08f0c89e to your computer and use it in GitHub Desktop.
pragma solidity ^0.8.18;
contract A{
uint public a = 3;
uint public b;
uint public c;
function test() public {
assembly{
function inter(a, b) {
}
function first() -> z {
z := mload(0x80)
sstore(1, z)
z := sub(z, 1)
mstore(0x80, z)
}
function second() -> z {
z := mload(0x80)
sstore(2, z)
z := sub(z, 1)
mstore(0x80, z)
}
mstore(0x80, 3)
inter(first(), second())
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment