Searching \ for 'Simple instructions' 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=simple+instructions
Search entire site for: 'Simple instructions'.

Truncated match.
PICList Thread
'Simple instructions'
1997\03\28@075455 by David BALDWIN

flavicon
face
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

flavicon
face
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

face
flavicon
face
David BALDWIN <spam_OUTPICLISTTakeThisOuTspamMITVMA.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 - .....fastfwdKILLspamspam@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

flavicon
face
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...