I am trying to use a conditional (like an if statement) in assembly. The only assembly reference site I have ever been able to find says the opcode JUMPI is the way to do this.
Using solc 0.7.0, the latest version.
I wasn't sure how to specify the destination parameter for JUMPI, so I just put the word destination in there as a placeholder to test a compilation.
assembly
{
jumpi (destination, eq (b_test, 1))
mstore (t_byte, 1)
}
It didn't recognize the JUMPI command.
Error: Function not found.
|
165 | jumpi (destination, eq (b_test, 1))
| ^^^^^
How can I implement conditional assembly code using solc 0.7.0?
Also, if anyone knows of any better assembly reference sites, I would be interested in knowing about them.
JUMPIis an EVM opcode and is not available in assembly. – Sheraz Arshad Aug 19 '20 at 04:58