Difference between revisions of "Jmpue"

From Unofficial QEdit Wiki Guide
Jump to: navigation, search
(Example)
 
(7 intermediate revisions by the same user not shown)
Line 3: Line 3:
  
 
* register1 = Register to compare  
 
* register1 = Register to compare  
* register2 = Register to compate with
+
* register2 = Register to compare with
 
* function = Function to jump to if conditions are true.
 
* function = Function to jump to if conditions are true.
  
 
==Use==
 
==Use==
Used to compare the value of a register with another register. If they are equal go to function.
+
Used to compare the value of a register with another register. If they are equal go to function. To compare register with integer value use [[jmpiue|jmpi_=]]
  
 
==Example==
 
==Example==
Line 13: Line 13:
 
  <span style='color:blue'>100:    </span><span style='color:green'>leti </span>R1, 00000001
 
  <span style='color:blue'>100:    </span><span style='color:green'>leti </span>R1, 00000001
 
  <span style='color:green'>        leti </span>R2, 00000002
 
  <span style='color:green'>        leti </span>R2, 00000002
  <span style='color:green'>         jmp_= </span>R1, R2, 101 <span style='color:orange'>//If R1 is equal to R2 go to function 101</span>
+
  <span style='color:blue'>101:    </span><span style='color:green'>jmp_= </span>R1, R2, 102 <span style='color:orange'>//If R1 is equal to R2 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>100
+
  <span style='color:green'>        jmp </span>101
<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'>101:    </span><span style='color:green'>nop </span><span style='color:orange'>//This example does nothing.</span>
+
 
  <span style='color:green'>        ret </span>
 
  <span style='color:green'>        ret </span>
 
  </span>
 
  </span>
  
 
==Also see==
 
==Also see==
[[leti]], [[addi]], [[ret]], [[nop]]
+
[[leti]], [[addi]], [[ret]], [[nop]], [[jmp]]

Latest revision as of 11:17, 14 September 2012

Syntax

Syntax: jmp_= register1, register2, function

  • register1 = Register to compare
  • register2 = Register to compare with
  • function = Function to jump to if conditions are true.

Use

Used to compare the value of a register with another register. If they are equal go to function. To compare register with integer value use jmpi_=

Example


100:     leti R1, 00000001
         leti R2, 00000002
101:     jmp_= R1, R2, 102 //If R1 is equal to R2 go to function 102
         addi R1, 00000001
         jmp 101
102:     nop //This example does nothing.
         ret 

Also see

leti, addi, ret, nop, jmp