# Subtract from 00 !

Status
Not open for further replies.

#### Suraj143

##### Active Member
I have a small question. After this code what is the value in W?

Thanks

Code:
	movlw	.10
movwf	Data
clrf	Reference
movf	Data,W
subwf	Reference,W
????

#### Pommie

##### Well-Known Member
It will subtract W from the file and so will do 0-10 = -10 or 246 or 0xf6.

Mike.

Last edited:

#### Suraj143

##### Active Member
It will subtract W from the file and so will to 0-10 = -10 or 246 or 0xf6.

Mike.

Totally understood.Thanks mike

#### Mike - K8LH

##### Well-Known Member
Suraj,

I think you'll find that taking the time to learn how to use the MPLAB Simulator and "watch" those file values while single stepping through your code might be a good investment. It certainly was for me...

Kind regards, Mike

Status
Not open for further replies.

Replies
5
Views
1K
Replies
19
Views
4K
Replies
3
Views
803
Replies
65
Views
24K
Replies
28
Views
26K