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.

How to see the value of W register and other general purpose registers in MPLAB ide

khatus

Member level 3
Joined
Oct 7, 2017
Messages
56
Helped
1
Reputation
2
Reaction score
0
Trophy points
6
Activity points
441
I wanted to know the content of W register and content of the adress location 12H in pic 16f84 micrcontroller.
I have write this simple code

Code:
RES_VECT  CODE    0x0000         
GOTO    START                  
MAIN_PROG CODE                     
START
MAIN
MOVLW b'11';// w contains 3
MOVWF 12H ; // 12H contains 3
MOVLW b'100'; // w contains 4
ADDWF 12H, W ; // w contains 7
ADDWF 12H, W ; // w contains 10
ADDWF 12H, W;  // w contains 13
ADDWF 12H, W; // w contains 16
END

The code was compiled successfully. Here is a picture of it

Screenshot (14).png



But the problem is when I open the SFR View window (Window>PIC memory views>SFRs) to see the content of the w register of the target device for the current project.

Screenshot (12).png


It shows WREG content is 19. Even if I do not write the code it shows WREG content is 19. That means The code I wrote is not affecting the ‘w’ registers at all.
since the result will be 16 . My question is how I can view my correct answer in MPLAB ide?

Screenshot (13).png
 

LaTeX Commands Quick-Menu:

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top