Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

BTFSC error (PIC Assembly)

Status
Not open for further replies.

picforall007

Junior Member level 3
Joined
Jan 10, 2010
Messages
27
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
India
Activity points
1,458
Code:
#include<p16c74a.inc>

data1 equ 50h
data2 equ 51h
result equ 60h
rem equ 61h

;main prog
clrf result
movfw data1
l1:
	subwf data2,1
	btfsc STATUS,0
	incf result
	btfsc STATUS,0
	goto l1
	addwf data2,1
	end

I don't know why 'BTFSC' act as "bit test flag skip if carry" instead of "bit test flag skip if clear"...

Please help me...
 

Hi,

The BTFSC instruction works fine (skip if clear). You're testing if the carry flag (STATUS register bit 0) is set or clear so that the overall effect is to skip an instruction if carry is clear.

Regards,
Chris
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top