January 2019
Beginner to intermediate
372 pages
11h 17m
English
Let's take a simple example to execute the script:
2 4 OP_ADD 6 OP_EQUAL
Execution of the script starts from the left-hand side. The data constants 2 and 4 are inserted into the stack as soon as the execution begins. Next, the script performs an addition operation, represented by the OP_ADD operator. The addition operation is performed on the top two items of the stack after popping them, so 2 + 4 = 6. The result is pushed back to the stack. The data constant 6 is pushed to the stack when it is encountered. Finally, the conditional OP_EQUAL operator is performed on the stack items. The last two items are popped from the stack and compared to see if they are equal. Since the last two data items in our stack are 6, the equality ...