Difference between revisions of "Stack popm"
From Unofficial QEdit Wiki Guide
(Created page with "==Syntax== ''Syntax:'' <span style='font-size:12px;font-family:courier'><span style='color:green'>stack_pushm </span>register1, dword</span> * ''register1'' = Value to begin...") |
(→Example) |
||
Line 14: | Line 14: | ||
<span style='color:green'> leti </span>R3, 0000000C <span style='color:orange'>//Set R3 to 12</span> | <span style='color:green'> leti </span>R3, 0000000C <span style='color:orange'>//Set R3 to 12</span> | ||
<span style='color:green'> window_msg </span>'R1 = <r1>, R2 = <r2>, R3 = <r3>' | <span style='color:green'> window_msg </span>'R1 = <r1>, R2 = <r2>, R3 = <r3>' | ||
− | <span style='color:green'> stack_pushm </span>R1 <span style='color:orange'>//Push the value of R1, R2, and R3 to the stack</span> | + | <span style='color:green'> stack_pushm </span>R1, 00000003 <span style='color:orange'>//Push the value of R1, R2, and R3 to the stack</span> |
<span style='color:green'> clear </span>R1 | <span style='color:green'> clear </span>R1 | ||
<span style='color:green'> clear </span>R2 | <span style='color:green'> clear </span>R2 | ||
Line 21: | Line 21: | ||
<span style='color:green'> add_msg </span>'R2 = <r2>' <span style='color:orange'>//R2 now is set to 0</span> | <span style='color:green'> add_msg </span>'R2 = <r2>' <span style='color:orange'>//R2 now is set to 0</span> | ||
<span style='color:green'> add_msg </span>'R3 = <r3>' <span style='color:orange'>//R3 now is set to 0</span> | <span style='color:green'> add_msg </span>'R3 = <r3>' <span style='color:orange'>//R3 now is set to 0</span> | ||
− | <span style='color:green'> stack_popm </span>R1 <span style='color:orange'>//Retrieve values from stack and set R1, R2, R3 to value. Remember, when pushing and popping stacks are Last In First Out (LIFO)</span> | + | <span style='color:green'> stack_popm </span>R1, 00000003 <span style='color:orange'>//Retrieve values from stack and set R1, R2, R3 to value. Remember, when pushing and popping stacks are Last In First Out (LIFO)</span> |
<span style='color:green'> add_msg </span>'R1 = <r1>, R2 = <r2>, R3 = <r3>' <span style='color:orange'>//R1's value has now been restored to 10, R2 to 11, R3 to 12</span> | <span style='color:green'> add_msg </span>'R1 = <r1>, R2 = <r2>, R3 = <r3>' <span style='color:orange'>//R1's value has now been restored to 10, R2 to 11, R3 to 12</span> | ||
<span style='color:green'> winend</span> | <span style='color:green'> winend</span> |
Latest revision as of 23:35, 7 June 2021
Contents
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