Truncated match.
PICList
Thread
'Simple instructions'
1997\03\28@075455
by
David BALDWIN
Does anybody has a set of well-known (for you...) functions like:
if A>B then goto ...
if A<=B then ... else ...
... etc
Thanks
-david
1997\03\28@082434
by
Andy Kunz
At 01:40 PM 3/28/97 +0100, you wrote:
>Does anybody has a set of well-known (for you...) functions like:
>
> if A>B then goto ...
> if A<=B then ... else ...
> ... etc
CCS C does that just fine. So will a Basic compiler, etc. <G>
Check out the thread "Two puzzles for you, All ( Probably useful tricks
;-)" on the WWW page. This ran over teh last week or two, and I've gleaned
some good code to try myself.
One I recall had exactly what you want.
Andy
==================================================================
Andy Kunz - Montana Design - 409 S 6th St - Phillipsburg, NJ 08865
Hardware & Software for Industry & R/C Hobbies
"Go fast, turn right, and keep the wet side down!"
==================================================================
1997\03\28@120249
by
Andrew Warren
David BALDWIN <spam_OUTPICLISTTakeThisOuT
MITVMA.MIT.EDU> wrote:
> Does anybody has a set of well-known (for you...) functions like:
>
> if A>B then goto ...
> if A<=B then ... else ...
> ... etc
David:
See the answer to Question #22, in the "Microchip PIC" area of the
"Answers" page on my company's web site.
-Andy
=== Andrew Warren - .....fastfwdKILLspam
@spam@ix.netcom.com
=== Fast Forward Engineering - Vista, California
===
=== Custodian of the PICLIST Fund -- For more info, see:
=== www.geocities.com/SiliconValley/2499/fund.html
1997\03\28@181133
by
Dmitry Kiryashov
David BALDWIN wrote:
>
> Does anybody has a set of well-known (for you...) functions like:
>
> if A>B then goto ...
> if A<=B then ... else ...
> ... etc
In case when B is constant and A>B construction need:
;A>B then goto ADDR
MOVFW A
SUBLW B
SKPC ;SKIP IF A<=B
GOTO ADDR ;GOTO IF A>B
.......
ADDR:
In case when A and B are variables and A<=B construction need:
;A<=B
MOVFW A
SUBWF B,W
SKPC ;SKIP IF A<=B
GOTO ELSE
THEN: .....
ELSE: .....
At any situation check Carry bit status after SUBWF operation was carry
out.
SUBWF REG,W result to Carry=1 if (REG-W)>=0 else Carry will be equal
zero(0).
SUBLW CONST result to Carry=1 if (CONST-W)>=0 else Carry=0.
WBR Dmitry.
P.S. It's common question as I see, at more definite
situation probably exist better solution.
More... (looser matching)
- Last day of these posts
- In 1997
, 1998 only
- Today
- New search...