Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/19/07 15:39
Read: times


 
#147191 - Check CJNE
Responding to: ???'s previous message
Nimish Dave said:

; CJP jumps if arg1 > arg2
cjp MACRO dato1,dato2,salto
cjne dato1,dato2,$+6
sjmp $+7
jc $+5
ljmp salto
ENDM


What is "salto" here ?
If the cjne instruction is satisfied(as dato1>dato2) the program will jump to $+6 ,it would also jump if dato1


Checkout the definition of CJNE - not only does it compare equality, but als sets the carry flag if arg1 is less than arg 2 (in the above example).

Thus if dato1 = dato2 we jump out of the macro.
If dato1 != dato2 we jump to the line "jc $+5" and check the Carry flag. If it's set (dato1 < dato2) we jump to the end of the macro. If it's clear (dato1 > dato2) we take the long jump to salto (literally 'jump' in Spanish).




List of 11 messages in thread
TopicAuthorDate
Extended opcode            01/01/70 00:00      
   You mean this?            01/01/70 00:00      
      Translating            01/01/70 00:00      
         Updated            01/01/70 00:00      
   Macro            01/01/70 00:00      
      Macro            01/01/70 00:00      
         Macro - widespread, general term.            01/01/70 00:00      
            The idea is            01/01/70 00:00      
      Does it works..?            01/01/70 00:00      
         Check CJNE            01/01/70 00:00      
            Thanks Robert            01/01/70 00:00      

Back to Subject List