# Assembly: What does the btfsc function do?

1. Jan 5, 2009

### atlbraves49

And how is it different from btfss?

And also, whats the difference between a call and goto command in assembly?

2. Jan 5, 2009

### Ouabache

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
3. Jan 11, 2011

### aidansheriff

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 :).

4. Jan 11, 2011

### aidansheriff

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 :)