Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Does the ASM command MOVF TEMP,W remove the value stored in theTEMP register?

Status
Not open for further replies.

JohnJohn20

Advanced Member level 4
Full Member level 1
Joined
Feb 2, 2012
Messages
111
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Visit site
Activity points
2,377
In ASM, the command MOVF TEMP,W moves the value stored in the TEMP register into the W register. Does the value in theTEMP register remain unchanged or is it deleted?

What about MOVWF TEMP? Does moving the value in the W register into the TEMP register remove the value from the W register or leave it unchanged?

While there are a lots of explanations for these commands, I can't find one that actually states what happens.

Thanks.

Thanks.
 

Hi,

In the datasheet of the chip you are using there is the Instruction Set Summary, in there is the full description of MOVWF and it gives a clear example of the state of those registers before and after execution.

Also if you use MPLABs SIM and a watch window you can single step though your code and see exactly what happens to your data in W and TEMP.
 

Attachments

  • 2013-01-28 12_16_59-billyboy - MPLAB IDE v8.80 - Watch.jpg
    2013-01-28 12_16_59-billyboy - MPLAB IDE v8.80 - Watch.jpg
    93.4 KB · Views: 161
Thank you both. Just wasn't clear from the datasheet:
MOVWF Move W to f
Syntax: [ label ] MOVWF f
Operands: 0 ≤ f ≤ 127
Operation: (W) → (f)
Status Affected: None
Description: Move data from W register to register ‘f’. which doesn't answer my question.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top