Stack pop

From Unofficial QEdit Wiki Guide
Jump to: navigation, search


Syntax: stack_pop register1

  • register1 = The register to set the retrieved value from the stack.


Used to restore a stored value in the stack to a register.


100:     leti R1, 0000000A //Set R1 to 10
         window_msg 'R1 = <r1>'
         stack_push R1 //Push the value of R1 to the stack
         clear R1
         add_msg 'R1 = <r1>' //R1 now is set to 0
         stack_pop R1 //Retrieve value from stack and set R1 to value. Remember, when pushing and popping stacks are Last In First Out (LIFO)
         add_msg 'R1 = <r1>' //R1's value has now been restored to 10

Also see

window_msg, clear, add_msg, stack_push, winend, ret