'Limiting number range'
I need to ensure a number (read from EEProm) is with certain limits (0..10
decimal) and if
outside those limits set the number to 1.
This works, but is there a quicker, better, or more obscure way of acieving
the same effect?
movf Number, w
Mike <MITVMA.MIT.EDU> wrote: PICLIST
> I need to ensure a number (read from EEProm) is with certain limits
> (0..10 decimal) and if outside those limits set the number to 1.
> This works, but is there a quicker, better, or more obscure way of
> acieving the same effect?
> movf Number, w
> sublw .10
> goto TestEnd
> movlw .1
> movwf Number
This way is a LITTLE quicker and shorter, and it'll work on the
12-bit PICs as well as the 14-bit ones:
=== Andrew Warren - ix.netcom.comfastfwd
=== Fast Forward Engineering - Vista, California
More... (looser matching)
- Last day of these posts
- In 1998
, 1999 only
- New search...