Inquisitive
Super Moderator
Firstly and foremost thank you for your time.
I'm trying to learn the basics of Assembly language with a PIC18F458. Using MPLAB IDE 8.92 in MPLABSIM mode.
I can watch WREG and see its result. I can watch COUNT and see its result. I know the final value should be 30 once decrementing and addition are done.
My question is why can't I see the final result in PORT B using a watch window? Is there some other method that would allow this?
I'm trying to learn the basics of Assembly language with a PIC18F458. Using MPLAB IDE 8.92 in MPLABSIM mode.
Code:
#include <P18F458.inc>
List P=18F458
;
org 0x000
; this program adds value 3 to WREG ten times
COUNT EQU 0x25 ; use location 25H for counter
;
MOVLW d'10' ; WREG = 10 (decimal) for counter
MOVWF COUNT ; load the counter
MOVLW 0 ; WREG = 0
AGAIN ADDLW 3 ; add 03 to WREG (WREG = sum)
DECFSZ COUNT, F ; decrement counter, skip if count = 0
GOTO AGAIN ; repeat until count becomes 0
MOVWF PORTB ; send sum to PORTB SFR
;
end
I can watch WREG and see its result. I can watch COUNT and see its result. I know the final value should be 30 once decrementing and addition are done.
My question is why can't I see the final result in PORT B using a watch window? Is there some other method that would allow this?
Last edited: