Apr 7, 2010 #1 P 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...
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...
Apr 7, 2010 #2 C cdh7 Member level 4 Joined Feb 1, 2010 Messages 71 Helped 13 Reputation 26 Reaction score 1 Trophy points 1,288 Location Hamburg, Germany Activity points 1,753 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
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