Assembly: What does the btfsc function do?

  • Thread starter Thread starter atlbraves49
  • Start date Start date
  • Tags Tags
    Assembly Function
Click For Summary
SUMMARY

The BTFSC (Bit Test File Skip if Clear) and BTFSS (Bit Test File Skip if Set) functions are critical instructions in assembly language, particularly for microcontrollers. BTFSC does not skip the next instruction if the specified bit is clear (0), while BTFSS skips the next instruction if the bit is set (1). Understanding these functions is essential for effective control flow in assembly programming. Additionally, the distinction between the CALL and GOTO commands is significant; CALL executes a subroutine and returns, whereas GOTO simply jumps to a specified location in the code.

PREREQUISITES
  • Understanding of assembly language syntax and structure
  • Familiarity with microcontroller instruction sets
  • Knowledge of control flow mechanisms in programming
  • Basic experience with programming concepts such as subroutines
NEXT STEPS
  • Study the instruction set of your specific microcontroller model
  • Learn about the differences between BTFSC and BTFSS in practical applications
  • Explore tutorials on assembly programming, particularly for the PIC microcontroller
  • Investigate the use of CALL and GOTO commands in various programming scenarios
USEFUL FOR

This discussion is beneficial for assembly language programmers, embedded systems developers, and anyone working with microcontroller programming who seeks to understand control flow and instruction usage in assembly code.

atlbraves49
Messages
80
Reaction score
0
And how is it different from btfss?



And also, what's the difference between a call and goto command in assembly?
 
Engineering news on Phys.org
atlbraves49 said:
Assembly: What does the btfsc function do?
And how is it different from btfss?

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)

And also, what's the difference between a call and goto command in assembly?
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" . Though this tutorial is based on the PIC micro, the concepts are true for all others.
 
Last edited by a moderator:
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 :).
 
atlbraves49 said:
And how is it different from btfss?



And also, what's the difference between a call and goto command in assembly?

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 :)
 
Most likely this can only be answered by an "old timer". I am making measurements on an uA709 op amp (metal can). I would like to calculate the frequency rolloff curves (I can measure them). I assume the compensation is via the miller effect. To do the calculations I would need to know the gain of the transistors and the effective resistance seen at the compensation terminals, not including the values I put there. Anyone know those values?

Similar threads

  • · Replies 102 ·
4
Replies
102
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
Replies
4
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
Replies
2
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
16
Views
4K
  • · Replies 16 ·
Replies
16
Views
4K
  • · Replies 8 ·
Replies
8
Views
5K