Searching \ for 'Snippets' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/index.htm?key=snippets
Search entire site for: 'Snippets'.

Truncated match.
PICList Thread
'Snippets'
1999\09\27@192617 by Tony Nixon

flavicon
picon face
Hi all,

In light of all the discussion recently this may be off topic now ;-)


Just a few code snippets I discovered in the last two weeks while
writing some new software.

if RAMx > Y

movf RAMx,w
addlw 255 - Y           ; eg if RAMx > 5 ... addlw d'250'
btfsc status,carry
goto True

if RAMx < Y

movf RAMx,w
addlw 255 - Y + 1       ; eg if RAMx < 5 ... addlw d'251'
btfss status,carry
goto True

if RAMx >= Y

movf RAMx,w
addlw 255 - Y + 1       ; eg if RAMx >= 5 ... addlw d'251'
btfsc status,carry
goto True

if RAMx <= Y

movf RAMx,w
addlw 255 - Y           ; eg if RAMx <= 5 ... addlw d'250'
btfss status,carry
goto True


--
Best regards

Tony

http://www.picnpoke.com
Email spam_OUTsalesTakeThisOuTspampicnpoke.com

1999\09\27@193239 by Richard Prosser

flavicon
face
I take this as an indication that I'm not the only one confused by the
result of the carry bit following subtraction - I always get it wrong - (but
thought I was just not suited to the mental gymnastics involved.)

Richard

> {Original Message removed}

More... (looser matching)
- Last day of these posts
- In 1999 , 2000 only
- Today
- New search...