accessing registers in asm
Posted: Thu May 29, 2008 8:04 am
i am having some difficulty in accessing the general purpose registers of pic for assembly level coding .
i am getting the error: error in built in assembly
do we need to access the registers through their RAM address or do we need the define the variables in flowcode or something else?
i have tried the former two but to no avail.
program in which external variable is used:
bsf _status,5 ;Go to bank 1
movlw 00h ;Put 00000 into W
movwf _trisb ;Move 00000 onto TRISA - all pins set to output
bcf _status,5 ;Come back to Bank 0
movlw AAh
movwf _FCV_A
addlw _FCV_A ,0
movwf _portb
program in which register address is used
bsf _status,5 ;Go to bank 1
movlw 00h ;Put 00000 into W
movwf _trisb ;Move 00000 onto TRISA - all pins set to output
bcf _status,5 ;Come back to Bank 0
movlw AAh
movwf 25h
addlw 25h,0
movwf _portb
both didn't work
plz help.
i am using Flowcode V3 for PIC
i am getting the error: error in built in assembly
do we need to access the registers through their RAM address or do we need the define the variables in flowcode or something else?
i have tried the former two but to no avail.
program in which external variable is used:
bsf _status,5 ;Go to bank 1
movlw 00h ;Put 00000 into W
movwf _trisb ;Move 00000 onto TRISA - all pins set to output
bcf _status,5 ;Come back to Bank 0
movlw AAh
movwf _FCV_A
addlw _FCV_A ,0
movwf _portb
program in which register address is used
bsf _status,5 ;Go to bank 1
movlw 00h ;Put 00000 into W
movwf _trisb ;Move 00000 onto TRISA - all pins set to output
bcf _status,5 ;Come back to Bank 0
movlw AAh
movwf 25h
addlw 25h,0
movwf _portb
both didn't work
plz help.
i am using Flowcode V3 for PIC