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


    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 http://www.amqrp.org/elmer160/lessons/index.html" [Broken]. Though this tutorial is based on the PIC micro, the concepts are true for all others.
    Last edited by a moderator: May 3, 2017
  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.


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

    GOTO x
    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
    CALL subrout
    ADDLW $F3
    MOVLW $00
    GOTO subrout

    Hope this helps :)
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook