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	
	????
 
It will subtract W from the file and so will do 0-10 = -10 or 246 or 0xf6.

Mike.
 
Last edited:
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.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…