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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/06/05 13:45
Read: times


 
#94394 - Macros
Responding to: ???'s previous message
In my ASM programs I usually put the following macros:
;	Macros:

JPLESS	MACRO	R,DAT,LAB	; Jump to LABEL if REG less than DAT
	CJNE	R,DAT,$+3
	JC	LAB
ENDM

JPGTEQ	MACRO	R,DAT,LAB	; Jump to LABEL if REG greater-equal to DAT
	CJNE	R,DAT,$+3
	JNC	LAB
ENDM


Note: R can be any register or accumulator - just that CJNE is a legal command, DAT can be only "immediate" - #N in case of registers, but also any of direct RAM if R is accumulator. If accumulator is to be compared with a register, than the register only can be taken as a direct address, eg. 0 - 7.
Examples:

      JPLESS  A,ADDR38H,LABEL1
      JPGTEQ  @R0,#0AEH,LABEL2
      JPLESS  A,3,LABEL3        ; Compare A with R3, bank 0

Slobodan

List of 23 messages in thread
TopicAuthorDate
compares on the 8051.            01/01/70 00:00      
   CJNE            01/01/70 00:00      
      sorry, I forgot            01/01/70 00:00      
   compares on the 8051            01/01/70 00:00      
      Not so good...            01/01/70 00:00      
         Comparing            01/01/70 00:00      
            where is the bible?            01/01/70 00:00      
               Here it is            01/01/70 00:00      
               Compare value            01/01/70 00:00      
                  the code            01/01/70 00:00      
                     Another method            01/01/70 00:00      
                        what?            01/01/70 00:00      
                           No            01/01/70 00:00      
                              There are more errors!            01/01/70 00:00      
                                 anyone??            01/01/70 00:00      
                                 There are more errors!            01/01/70 00:00      
                                    YOU ARE GREAT!!! THANKS!!!            01/01/70 00:00      
                                       Simulator            01/01/70 00:00      
                                       search..            01/01/70 00:00      
                                          Compare tips            01/01/70 00:00      
         Try these            01/01/70 00:00      
            sensors            01/01/70 00:00      
   Macros            01/01/70 00:00      

Back to Subject List