Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Assembly: What does the btfsc function do?

  1. Jan 5, 2009 #1
    And how is it different from btfss?



    And also, whats the difference between a call and goto command in assembly?
     
  2. jcsd
  3. Jan 5, 2009 #2

    Ouabache

    User Avatar
    Science Advisor
    Homework Helper

    Do you know what btfsc and btfss stand for?
    If I was wanting to find this out, I would download the spec sheet for my microcontroller and take a close look at the instruction set. (hint: clear=0, set=1)

    You may benefit from working your way through a tutorial on assembly coding.
    Here may be a useful starting point. Though this tutorial is based on the PIC micro, the concepts are true for all others.
     
  4. Jan 11, 2011 #3
    The BTFSC function is very different to the BTFSS function. The opposite actually.

    BTFSC (Bit test file skip if clear)
    BTFSS (Bit test file skip if set)

    Meaning, if the logic at location f is high (1), then the BTFSC function will not skip the next line of coding. However, the BTFSS function will skip the next line of coding if the logic level is 1.

    e.g.

    \\A button is pressed making logic at PORTB 1.

    BTFSC PORTB
    GOTO x
    BTFSS PORTB
    GOTO y.

    This coding would execute the subroutine at x not y.


    Hope this helps :).
     
  5. Jan 11, 2011 #4
    These two commands are similar but not the same.

    A GOTO command will simply Go to a place stated in a program. However, you use the call command when you wish to execute a subroutine and then return back to the previous point of the program where the call command was.

    For example:

    MOVLW $01
    MOVWF PORTA
    CALL subrout
    ADDLW $F3
    MOVWF PORTB
    subrout:
    MOVLW $00
    MOVWF PORTB
    GOTO subrout
    .END


    Hope this helps :)
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Assembly: What does the btfsc function do?
  1. What do EE's do? (Replies: 5)

  2. What does the diode do? (Replies: 10)

Loading...