I'm new to assembly language on pic microcontrollers and am just trying to control an IO port via GPIO as the datasheet says. Here is my code:
;---------------------------------------------------------------------------------------------------------------------------------------------------------------
INCLUDE <p12f675.inc>
__CONFIG _INTRC_OSC_NOCLKOUT & _WDT_OFF & _PWRTE_OFF & _MCLRE_ON & _BOREN_ON & _CP_OFF & _CPD_OFF
RES_VECT CODE 0x0000
GOTO START
MAIN_PROG CODE
START
bsf STATUS, 5
clrw
movwf TRISIO
bcf STATUS, 5
movlw b'00000100'
movwf GPIO
movlw b'00000000'
movwf GPIO
END
;------------------------------------------------------------------------------------------------------------------------------------------------------------------
When I try to simulate this in MPLAB while incrementing the program counter by hand, I can see that WREG gets loaded correctly to '00000100'. On the next instruction GPIO should be loaded from WREG but it stays at 0x08. Am I missing something here or is something wrong with the simulator? Thanks in advance!
;---------------------------------------------------------------------------------------------------------------------------------------------------------------
INCLUDE <p12f675.inc>
__CONFIG _INTRC_OSC_NOCLKOUT & _WDT_OFF & _PWRTE_OFF & _MCLRE_ON & _BOREN_ON & _CP_OFF & _CPD_OFF
RES_VECT CODE 0x0000
GOTO START
MAIN_PROG CODE
START
bsf STATUS, 5
clrw
movwf TRISIO
bcf STATUS, 5
movlw b'00000100'
movwf GPIO
movlw b'00000000'
movwf GPIO
END
;------------------------------------------------------------------------------------------------------------------------------------------------------------------
When I try to simulate this in MPLAB while incrementing the program counter by hand, I can see that WREG gets loaded correctly to '00000100'. On the next instruction GPIO should be loaded from WREG but it stays at 0x08. Am I missing something here or is something wrong with the simulator? Thanks in advance!