Difference between revisions of "Jmpiue"
From Unofficial QEdit Wiki Guide
Line 14: | Line 14: | ||
<span style='color:blue'>101: </span><span style='color:green'>jmp_= </span>R1, 00000002, 102 <span style='color:orange'>//If R1 is equal to 2 go to function 102</span> | <span style='color:blue'>101: </span><span style='color:green'>jmp_= </span>R1, 00000002, 102 <span style='color:orange'>//If R1 is equal to 2 go to function 102</span> | ||
<span style='color:green'> addi </span>R1, 00000001 | <span style='color:green'> addi </span>R1, 00000001 | ||
− | <span style='color:green'> jmp </span> | + | <span style='color:green'> jmp </span>101 |
<span style='color:green'> ret </span> | <span style='color:green'> ret </span> | ||
<span style='color:blue'>102: </span><span style='color:green'>nop </span><span style='color:orange'>//This example does nothing.</span> | <span style='color:blue'>102: </span><span style='color:green'>nop </span><span style='color:orange'>//This example does nothing.</span> | ||
Line 21: | Line 21: | ||
==Also see== | ==Also see== | ||
− | [[leti]], [[addi]], [[ret]], [[nop]] | + | [[leti]], [[addi]], [[ret]], [[nop]], [[jmp]] |
Revision as of 13:30, 28 March 2011
Contents
Syntax
Syntax: jmpi_= register1, xxxxxxxx, function
- register1 = Register to compare
- xxxxxxxx = Integer value to compare with
- function = Function to jump to if conditions are true.
Use
Used to compare the value of a register with a integer value. If they are equal go to function. To compare register with another register use jmp_=
Example
100: leti R1, 00000001
101: jmp_= R1, 00000002, 102 //If R1 is equal to 2 go to function 102
addi R1, 00000001
jmp 101
ret
102: nop //This example does nothing.
ret