I found that ISZERO is an opcode but I can't find what is the purpose of ISZERO.
Can somebody please guide me what is the purpose of ISZERO?
Zulfi.
Although this is an old question here's what I found on debugging further. As @haxerl explains above it looks like the only purpose of ISZERO is to check if the top of stack is zero. How does it do it? It does a simple not operation on the last number as seen in the screenshots below from remix
According to ethereum yellow paper, it is like a simple not operation in any other programming language. You can search for the use of not operation on many case but they mostly use so that you dont have to check for many condition: https://stackoverflow.com/questions/4775379/using-not-operator-in-if-conditions.