khatus
Member level 3

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
The code was compiled successfully. Here is a picture of it
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.
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?
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
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.
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?