Difference between revisions of "Switch jmp"
From Unofficial QEdit Wiki Guide
Line 10: | Line 10: | ||
==Example== | ==Example== | ||
<span style='font-size:12px;font-family:courier'> | <span style='font-size:12px;font-family:courier'> | ||
− | <span style='color:blue'>0: | + | <span style='color:blue'>0: </span><span style='color:green'>get_slotnumber </span>R250 |
<span style='color:green'> ret </span> | <span style='color:green'> ret </span> | ||
− | <span style='color:blue'>1: | + | <span style='color:blue'>1: </span><span style='color:green'>ret </span> |
<span style='color:blue'>100: </span><span style='color:green'>switch_jmp </span>R1, 4:101:102:103:104 | <span style='color:blue'>100: </span><span style='color:green'>switch_jmp </span>R1, 4:101:102:103:104 | ||
<span style='color:blue'>101: </span><span style='color:green'>window_msg </span>'You are in Slot 0.' | <span style='color:blue'>101: </span><span style='color:green'>window_msg </span>'You are in Slot 0.' |
Revision as of 08:48, 19 May 2011
Contents
Syntax
Syntax: switch_jmp register1, string
- register1 = Register to check value
- string = Function list to jump to on value
Use
Used to jump to different functions depending on a registers value.
Example
0: get_slotnumber R250
ret
1: ret
100: switch_jmp R1, 4:101:102:103:104
101: window_msg 'You are in Slot 0.'
winend
ret
102: window_msg 'You are in Slot 1.'
winend
ret
103: window_msg 'You are in Slot 2.'
winend
ret
104: window_msg 'You are in Slot 3.'
winend
ret