At 01:53 PM 11/19/96 PST, you wrote: >Hi, does anyone have any macros for 'IF THEN' statements and also a compare >function. > >Thanks in advance, > Brian. > > Try including this in your source: ; ------------------------------------------------------------------------- ; COMPARE.INC ; ; Macros to compare and branch/skip/call ; ; ------------------------------------------------------------------------- ; Usage Description ; ---------------------------------- ---------------------------------- ; clskpe label1, label2 Compare literal and skip if equal ; clskpne label1, label2 Compare literal and skip if not equal ; clje label1, label2, address Compare literal and jump to if equal ; cljne label1, label2, address Compare literal and jump to if not equal ; clcalle label1, label2, address Compare literal and call if equal ; clcallne label1, label2, address Compare literal and call if not equal ; cskpe label1, label2 Compare and skip if equal ; cskpne label1, label2 Compare and skip if not equal ; cje label1, label2, address Compare and jump to if equal ; cjne label1, label2, address Compare and jump to if not equal ; ccalle label1, label2, address Compare and call if equal ; ccallne label1, label2, address Compare and call if not equal ; ; ------------------------------------------------------------------------- clskpe MACRO label1, label2 ; compare literal and skip if equal movlw label2 ; (macro) xorwf label1, 0 ; (macro) btfss 3, 2 ; (macro) ENDM clskpne MACRO label1, label2 ; compare literal and skip if not equal movlw label2 ; (macro) xorwf label1, 0 ; (macro) btfsc 3, 2 ; (macro) ENDM clje MACRO label1, label2, address ; compare literal and jump to if equal movlw label2 ; (macro) xorwf label1, 0 ; (macro) btfsc 3, 2 ; (macro) goto address ; (macro) ENDM cljne MACRO label1, label2, address ; compare literal and jump to if not equal movlw label2 ; (macro) xorwf label1, 0 ; (macro) btfss 3, 2 ; (macro) goto address ; (macro) ENDM clcalle MACRO label1, label2, address ; compare literal and call if equal movlw label2 ; (macro) xorwf label1, 0 ; (macro) btfsc 3, 2 ; (macro) call address ; (macro) ENDM clcallne MACRO label1, label2, address ; compare literal and call if not equal movlw label2 ; (macro) xorwf label1, 0 ; (macro) btfss 3, 2 ; (macro) call address ; (macro) ENDM cskpe MACRO label1, label2 ; compare and skip if equal movf label2, 0 ; (macro) xorwf label1, 0 ; (macro) btfss 3, 2 ; (macro) ENDM cskpne MACRO label1, label2 ; compare and skip if not equal movf label2, 0 ; (macro) xorwf label1, 0 ; (macro) btfsc 3, 2 ; (macro) ENDM cje MACRO label1, label2, address ; compare and jump to if equal movf label2, 0 ; (macro) xorwf label1, 0 ; (macro) btfsc 3, 2 ; (macro) goto address ; (macro) ENDM cjne MACRO label1, label2, address ; compare and jump to if not equal movf label2, 0 ; (macro) xorwf label1, 0 ; (macro) btfss 3, 2 ; (macro) goto address ; (macro) ENDM ccalle MACRO label1, label2, address ; compare and call if equal movf label2, 0 ; (macro) xorwf label1, 0 ; (macro) btfsc 3, 2 ; (macro) call address ; (macro) ENDM ccallne MACRO label1, label2, address ; compare and call if not equal movf label2, 0 ; (macro) xorwf label1, 0 ; (macro) btfss 3, 2 ; (macro) call address ; (macro) ENDM