Stack popm

From Unofficial QEdit Wiki Guide
Jump to: navigation, search

Syntax

Syntax: stack_pushm register1, dword

  • register1 = Value to begin the string of multiple registers to populate from the stack.
  • DWORD = # of registers to populate.

Use

Used to recall multiple registers value into the stack so that the registers can be freed up for another use. Can also populate the stack of registers to another group of free registers.

Example


100:     leti R1, 0000000A //Set R1 to 10
         leti R2, 0000000B //Set R2 to 11
         leti R3, 0000000C //Set R3 to 12
         window_msg 'R1 = <r1>, R2 = <r2>, R3 = <r3>'
         stack_pushm R1, 00000003 //Push the value of R1, R2, and R3 to the stack
         clear R1
         clear R2
         clear R3
         add_msg 'R1 = <r1>' //R1 now is set to 0
         add_msg 'R2 = <r2>' //R2 now is set to 0
         add_msg 'R3 = <r3>' //R3 now is set to 0
         stack_popm R1, 00000003 //Retrieve values from stack and set R1, R2, R3 to value. Remember, when pushing and popping stacks are Last In First Out (LIFO)
         add_msg 'R1 = <r1>, R2 = <r2>, R3 = <r3>' //R1's value has now been restored to 10, R2 to 11, R3 to 12
         winend
         ret 

Also see

window_msg, clear, add_msg, stack_pushm, winend, ret