Specifications
mikroElektronika | Free Online Book | PIC Microcontrollers | Appendix B: Examples
Example 16:
;*********************** Header ***************************************
; DEFINING VARIABLES IN PROGRAM
w_temp EQU 0x7D ; Variable for saving W register
status_temp EQU 0x7E ; Variable for saving STATUS register
pclath_temp EQU 0x7F ; Variable for saving PCLATH w register
cblock 0x20 ; Block of variables starts at address 20 h
Port_A ; Variable at address 20 h
Port_B ; Variable at address 21 h
RS232temp ; Variable at address 22 h
RXchr ; Variable at address 23 h
endc ; End of block of variables
;**********************************************************************
ORG 0x0000 ; Reset vector
nop
goto main ; Go to beginning of program (label "main")
;**********************************************************************
ORG 0x0004 ; Interrupt vector address
movwf w_temp ; Save value of W register
movf STATUS,w ; Save value of STATUS register
movwf status_temp
movf PCLATH,w ; Save value of PCLATH register
movwf pclath_temp
;**********************************************************************
http://www.mikroe.com/en/books/picmcubook/appb/ (52 of 54)5/3/2009 11:36:02 AM