Difference between revisions of "Subi"
From Unofficial QEdit Wiki Guide
Line 12: | Line 12: | ||
<span style='color:blue'>100: </span><span style='color:green'>leti </span>R1, '0000000A' <span style='color:orange'>//Set R1 to 10</span> | <span style='color:blue'>100: </span><span style='color:green'>leti </span>R1, '0000000A' <span style='color:orange'>//Set R1 to 10</span> | ||
<span style='color:green'> window_msg </span>'Register 1 = <r1>' <span style='color:orange'>//Display the value of R1 in a window message (10)</span> | <span style='color:green'> window_msg </span>'Register 1 = <r1>' <span style='color:orange'>//Display the value of R1 in a window message (10)</span> | ||
− | <span style='color:green'> subi </span>R1, '00000001' <span style='color:orange'>// | + | <span style='color:green'> subi </span>R1, '00000001' <span style='color:orange'>//Subtract 1 from R1</span> |
<span style='color:green'> add_msg </span>'Register 1 = <r1>' <span style='color:orange'>//Display the new value of R1 in a window message (9)</span> | <span style='color:green'> add_msg </span>'Register 1 = <r1>' <span style='color:orange'>//Display the new value of R1 in a window message (9)</span> | ||
− | <span style='color:green'> subi </span>R1, '00000001' <span style='color:orange'>// | + | <span style='color:green'> subi </span>R1, '00000001' <span style='color:orange'>//Subtract 1 from R1</span> |
<span style='color:green'> add_msg </span>'Register 1 = <r1>' <span style='color:orange'>//Display the new value of R1 in a window message (8)</span> | <span style='color:green'> add_msg </span>'Register 1 = <r1>' <span style='color:orange'>//Display the new value of R1 in a window message (8)</span> | ||
− | <span style='color:green'> subi </span>R1, '00000001' <span style='color:orange'>// | + | <span style='color:green'> subi </span>R1, '00000001' <span style='color:orange'>//Subtract 1 from R1</span> |
<span style='color:green'> add_msg </span>'Register 1 = <r1>' <span style='color:orange'>//Display the new value of R1 in a window message (7)</span> | <span style='color:green'> add_msg </span>'Register 1 = <r1>' <span style='color:orange'>//Display the new value of R1 in a window message (7)</span> | ||
− | <span style='color:green'> subi </span>R1, '00000001' <span style='color:orange'>// | + | <span style='color:green'> subi </span>R1, '00000001' <span style='color:orange'>//Subtract 1 from R1</span> |
<span style='color:green'> winend </span> <span style='color:orange'>//Close window message</span> | <span style='color:green'> winend </span> <span style='color:orange'>//Close window message</span> | ||
<span style='color:green'> ret </span> | <span style='color:green'> ret </span> |
Latest revision as of 13:12, 12 April 2011
Contents
Syntax
Syntax: subi register1, xxxxxxxx
- register1 = Register to subtract from
- xxxxxxxx = Integer value to add
Use
Used to subtract a integer value from a register. For subtracting registers from registers see sub
Example
100: leti R1, '0000000A' //Set R1 to 10
window_msg 'Register 1 = <r1>' //Display the value of R1 in a window message (10)
subi R1, '00000001' //Subtract 1 from R1
add_msg 'Register 1 = <r1>' //Display the new value of R1 in a window message (9)
subi R1, '00000001' //Subtract 1 from R1
add_msg 'Register 1 = <r1>' //Display the new value of R1 in a window message (8)
subi R1, '00000001' //Subtract 1 from R1
add_msg 'Register 1 = <r1>' //Display the new value of R1 in a window message (7)
subi R1, '00000001' //Subtract 1 from R1
winend //Close window message
ret
Also see
leti, window_msg, add_msg, winend, ret