hi...
i'm sorry....i try to write the code to implement my 'lookup table'...actually this is my first time writting the code....
after click "build all" i got this message
Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\Program Files\MPLAB IDE\MCHIP_Tools\mpasmwin.exe" /q /p16F84A "digital.asm" /l"digital.lst" /e"digital.err"
Message[302] C:\PROGRAM FILES\MPLAB IDE\MYPROJ\DIGITAL.ASM 79 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] C:\PROGRAM FILES\MPLAB IDE\MYPROJ\DIGITAL.ASM 81 : Register in operand not in bank 0. Ensure that bank bits are correct.
Error[113] C:\PROGRAM FILES\MPLAB IDE\MYPROJ\DIGITAL.ASM 87 : Symbol not previously defined (pcl)
Halting build on first failure as requested.
BUILD FAILED: Wed Jun 16 12:03:59 2004
and my code is like this:
Code:
;**********************************************************************
list p=16F84A ; list directive to define processor
#include <p16F84A.inc> ; processor specific variable definitions
__CONFIG _CP_OFF & _WDT_ON & _PWRTE_ON & _RC_OSC
; '__CONFIG' directive is used to embed configuration data within .asm file.
; The lables following the directive are located in the respective .inc file.
; See respective data sheet for additional information on configuration word.
;***** VARIABLE DEFINITIONS
STATUS EQU 03h ; variable used for context saving
TRISA EQU 85h ; variable used for context saving
PORTA EQU 05H
TRISB EQU 86h
PORTB EQU 06h
;**********************************************************************
ORG 0x000 ; processor reset vector
goto main ; go to beginning of program
ORG 0x004 ; interrupt vector location
main bsf STATUS,5 ; bank 0 -----> bank 1
movlw b'00111111' ; set the port a as inputs
movwf TRISA ;
movlw b'11110000' ; set the port b as ouputs
movwf TRISB
bcf STATUS,5 ; bank 1 -----> bank 0
movf PORTA,w
andlw b'00111111'
call table
movwf PORTB
table addwf pcl,f ; inputs outputs
retlw b'0000' ; 0
retlw b'0000' ; 1
retlw b'0000' ; 2
retlw b'0100' ; 3
retlw b'0100' ; 4
retlw b'0100' ; 5
retlw b'0100' ; 6
retlw b'0100' ; 7
retlw b'0000' ; 8
retlw b'0000' ; 9
retlw b'0000' ; 10
retlw b'0100' ; 11
retlw b'0100' ; 12
retlw b'0100' ; 13
retlw b'0100' ; 14
retlw b'0100' ; 15
retlw b'0000' ; 16
retlw b'0000' ; 17
retlw b'0000' ; 18
retlw b'0100' ; 19
retlw b'0101' ; 20
retlw b'0101' ; 21
retlw b'0101' ; 22
retlw b'0101' ; 23
retlw b'1000' ; 24
retlw b'1000' ; 25
retlw b'1000' ; 26
retlw b'1000' ; 27
retlw b'0110' ; 28
retlw b'0110' ; 26
retlw b'0110' ; 30
retlw b'0110' ; 31
retlw b'1010' ; 32
retlw b'1010' ; 33
retlw b'1010' ; 34
retlw b'1011' ; 35
retlw b'1111' ; 36
retlw b'1111' ; 37
retlw b'1111' ; 38
retlw b'1111' ; 39
retlw b'1110' ; 40
retlw b'1110' ; 41
retlw b'1110' ; 42
retlw b'1111' ; 43
retlw b'1111' ; 44
retlw b'1111' ; 45
retlw b'1111' ; 46
retlw b'1111' ; 47
retlw b'1110' ; 48
retlw b'1110' ; 49
retlw b'1110' ; 50
retlw b'1111' ; 51
retlw b'1111' ; 52
retlw b'1111' ; 53
retlw b'1111' ; 54
retlw b'1111' ; 55
retlw b'1110' ; 56
retlw b'1110' ; 57
retlw b'1110' ; 58
retlw b'1111' ; 59
retlw b'1111' ; 60
retlw b'1111' ; 61
retlw b'1111' ; 62
retlw b'1111' ; 63
goto main
END ; directive 'end of program'
when i double click at message the 'green cursor" point at the movwf TRISA and movwf TRISB and error at line table addwf pcl,f
actually what is the problem..? pls help me find the problem...
thanks