Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Tools
Old 29th October 2009, 05:41 AM   #1
Talking Subtract from 00 !

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	
	????
Suraj143 is offline  
Old 29th October 2009, 05:50 AM   #2
Default

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

Mike.

Last edited by Pommie; 29th October 2009 at 06:01 AM. Reason: typo do was to as quoted below.
Pommie is online now  
Old 29th October 2009, 05:56 AM   #3
Default

Quote:
Originally Posted by Pommie View Post
It will subtract W from the file and so will to 0-10 = -10 or 246 or 0xf6.

Mike.
Totally understood.Thanks mike
Suraj143 is offline  
Old 29th October 2009, 07:59 AM   #4
Default

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
Mike, K8LH is offline  
Reply

Tags
subtract

Thread Tools
Display Modes


Similar
Title Starter Forum Replies Latest
Simple Add/Subtract Circuit insttechbazza Electronic Projects Design/Ideas/Reviews 6 18th June 2005 12:06 AM



All times are GMT. The time now is 04:48 PM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker