|
Hello, I'm currently building out the logical operators eq, lt, gt, (as well as neg and or, but those are a bit different, so I'll handle them later).
From what I understand, they should update the stack to contain TRUE or FALSE
e.g.
push constant 17
push constant 17
eq
the stack goes from having 17 and 17 and then the pointer on top, to having true and then the pointer on top, which follows the same pattern as add or subtract etc... but I have no clue how to represent TRUE or FALSE in assembly? I read that -1 is equivalent to true, and 0 is equivalent to false.
Am I supposed to store those values in the correct point in the stack? And then I pick which value to store based on some jump sequencing in assembly?
|