Difference between revisions of "Jmpiug"

From Unofficial QEdit Wiki Guide
Jump to: navigation, search
 
(Example)
 
Line 12: Line 12:
 
  <span style='font-size:12px;font-family:courier'>
 
  <span style='font-size:12px;font-family:courier'>
 
  <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:blue'>101:    </span><span style='color:green'>jmp_> </span>R1, 00000002, 102 <span style='color:orange'>//If R1 is greater than R2 go to function 102</span>
+
  <span style='color:blue'>101:    </span><span style='color:green'>jmpi_> </span>R1, 00000002, 102 <span style='color:orange'>//If R1 is greater than 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>101
 
  <span style='color:green'>        jmp </span>101

Latest revision as of 23:20, 22 May 2014

Syntax

Syntax: jmpi_> register1, xxxxxxxx, function

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

Use

Used to compare the value of a register with an integer value. If register 1 is greater than integer go to function. To compare register with another register use jmp_>

Example


100:     leti R1, 00000001
101:     jmpi_> R1, 00000002, 102 //If R1 is greater than R2 go to function 102
         addi R1, 00000001
         jmp 101
102:     nop //This example does nothing.
         ret 

Also see

leti, addi, ret, nop, jmp