Difference between revisions of "Switch jmp"
From Unofficial QEdit Wiki Guide
Line 20: | Line 20: | ||
<span style='color:green'> winend </span> | <span style='color:green'> winend </span> | ||
<span style='color:green'> ret </span> | <span style='color:green'> ret </span> | ||
− | <span style='color:blue'>103: </span><span style='color:green'>window_msg </span>'You are in yellow slot.' | + | <span style='color:blue'>103: </span><span style='color:green'>window_msg </span>'You are in the yellow slot.' |
<span style='color:green'> winend </span> | <span style='color:green'> winend </span> | ||
<span style='color:green'> ret </span> | <span style='color:green'> ret </span> | ||
− | <span style='color:blue'>104: </span><span style='color:green'>window_msg </span>'You are in blue slot.' | + | <span style='color:blue'>104: </span><span style='color:green'>window_msg </span>'You are in the blue slot.' |
<span style='color:green'> winend </span> | <span style='color:green'> winend </span> | ||
<span style='color:green'> ret </span> | <span style='color:green'> ret </span> |
Revision as of 08:55, 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 R250, 4:101:102:103:104
101: window_msg 'You are in the red slot.'
winend
ret
102: window_msg 'You are in the green slot.'
winend
ret
103: window_msg 'You are in the yellow slot.'
winend
ret
104: window_msg 'You are in the blue slot.'
winend
ret