>
> > > SKIP_WLE ;skip if W less than or equal from last SUBLW or SUBWF
> > > SKIP_WGT ;skip if W greater than ...
> >
> > I really like those skip_wle and skip_wgt mnemonics! Thanks,
> > will make good use of those in the future! Does anyone else
> > have any other good ones?
>
> Since you plan on using them, I have included the source code below to save
> you the trouble of re-creating them.
>
> ;
> ;********************
> ;
> ; Macro SKIP_WLE
> ;
> ; Skip the next instruction if W was less than or equal to the value
> ; it was subtracted from. This assumes that the carry flag has been
> ; preserved from the last SUBWF or SUBLW instruction.
> ;
> skip_wle macro
> if fam_17
> btfss alusta, c
> exitm
> endif
>
> btfss status, c ;skip if no borrow occurred
> endm
> ;
> ;********************
> ;
> ; Macro SKIP_WGT
> ;
> ; Skip the next instruction if W was greater than the value
> ; it was subtracted from. This assumes that the carry flag has been
> ; preserved from the last SUBWF or SUBLW instruction.
> ;
> skip_wgt macro
> if fam_17
> btfsc alusta, c
> exitm
> endif
>
> btfsc status, c ;skip if a borrow occurred
> endm
> ;
> ;********************
> ;
> ; Macro SKIP_Z
> ;
> ; Skip the next instruction if the zero flag is set.
> ;
> skip_z macro
> if fam_17
> btfss alusta, z
> exitm
> endif
>
> btfss status, z
> endm
> ;
> ;********************
> ;
> ; Macro SKIP_NZ
> ;
> ; Skip the next instruction if the zero flag is not set.
> ;
> skip_nz macro
> if fam_17
> btfsc alusta, z
> exitm
> endif
>
> btfsc status, z
> endm
> ;
> ;********************
> ;
> ; Macro SKIP_CARR
> ;
> ; Skip the next instruction if a carry occurred.
> ;
> skip_carr macro
> if fam_17
> btfss alusta, c
> exitm
> endif
>
> btfss status, c
> endm
> ;
> ;********************
> ;
> ; Macro SKIP_NCARR
> ;
> ; Skip the next instruction if no carry occurred.
> ;
> skip_ncarr macro
> if fam_17
> btfsc alusta, c
> exitm
> endif
>
> btfsc status, c
> endm
> ;
> ;********************
> ;
> ; Macro SKIP_BORR
> ;
> ; Skip the next instruction if a borrow occurred.
> ;
> skip_borr macro
> if fam_17
> btfsc alusta, c
> exitm
> endif
>
> btfsc status, c
> endm
> ;
> ;********************
> ;
> ; Macro SKIP_NBORR
> ;
> ; Skip the next instruction if no borrow occurred.
> ;
> skip_nborr macro
> if fam_17
> btfss alusta, c
> exitm
> endif
>
> btfss status, c
> endm
> ;
> ;********************
> ;
> ; Macro INTR_OFF
> ;
> ; Globally disable interrupts without changing which interrupts are
> ; individually disabled. This macro together with INTR_ON can be used
> ; around small sections of code that need to run with interrupts off.
> ;
> intr_off macro
> if fam_16
> bcf intcon, gie
> endif
> if fam_17
> bsf cpusta, glintd
> endif
> endm
> ;
> ;********************
> ;
> ; Macro INTR_ON
> ;
> ; Globally enable interrupts without changing which interrupts are
> ; individually enabled. This macro together with INTR_OFF can be used
> ; around small sections of code that need to run with interrupts off.
> ;
> intr_on macro
> if fam_16
> bsf intcon, gie
> endif
> if fam_17
> bcf cpusta, glintd
> endif
> endm
>
> *****************************************************************
> Olin Lathrop, embedded systems consultant in Devens Massachusetts
> (978) 772-3129,
.....olinKILLspam
@spam@cognivis.com, http://www.cognivis.com
>
> --
>
http://www.piclist.com hint: The PICList is archived three different
> ways. See
http://www.piclist.com/#archives for details.