Assembly problems

Thread Starter

Dritech

Joined Sep 21, 2011
901
Hi,

I have some questions regarding assembly programming for PIC18F:

1) How to move the value from the working register to another register? do i have to use MOVFF w,REG1 ??

2) Is STATUS,C low (0) when the value is negative?

Thanks
 
Last edited:

stahta01

Joined Jun 9, 2011
133
FYI: There is likely several hundred assembly languages in the world; it would help if you stated the one you are using in the post you ask the question.
I would even suggest having it in the thread title.

Tim S.
 

RiJoRI

Joined Aug 15, 2007
536
Hi,
I have some questions regarding assembly programming for PIC18F:

1) How to move the value from the working register to another register? do i have to use MOVFF w,REG1 ??

2) Is STATUS,C low (0) when the value is negative?

Thanks
First, take a look at the tutorials at http://gooligum.com.au/tutorials.html
Then...

1) You want to MOVe the Working register to a File.
MOVWF Reg1 should do it.

2) The data sheet will -- or should -- tell you the operation of the carry bit. Actually, it should be called the Carry/Borrow bit. The Datasheets I have tell you:
[Status] bit 0: C: Carry/borrow bit (ADDWF, ADDLW, SUBLW, SUBWF instructions)
1 = A carry-out from the most significant bit of the result occurred
0 = No carry-out from the most significant bit of the result occurred

Note: For borrow the polarity is reversed. A subtraction is executed by adding the two’s complement of the second operand.

For rotate (RRF, RLF) instructions, this bit is loaded with either the high or low order bit of the source register.
 

MrChips

Joined Oct 2, 2009
30,823
FYI: There is likely several hundred assembly languages in the world; it would help if you stated the one you are using in the post you ask the question.
I would even suggest having it in the thread title.

Tim S.
Well he did say he is programming a PIC18F.
 
Top