IF-THEN what?


Results 1 to 11 of 11

Thread: IF-THEN what?

Threaded View

  1. #9
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    Did you find this post helpful? Yes | No

    Default WORDs "cost" can make a huge difference

    Ioannis,

    Depending on the PIC used, you might want to be careful in what syntax you are going tu use.

    This first code costs you i.e. 11 WORDs (PIC16F628) and 13 WORDs (PIC16F690)
    Code:
    w1 var byte
    A  var byte
    B  var byte
    
    IF w1>A THEN
        IF w1<B THEN
        ...
        ENDIF
    ENDIF
    This second code will cost you 60 WORDs (PIC16F628) and 64 WORDs (PIC16F690)
    Code:
    w1 var byte
    A  var byte
    B  var byte
    
    IF w1>A AND w1<B THEN
        ...
    ENDIF
    Last edited by flotulopex; - 22nd June 2011 at 09:39.
    Roger

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts