I have been attempting to compile the attached program fragment and I get these error messages:
Error[126] C:\PIC DOCUMENTS\MEDTIM.ASM 58 : Argument out of range (0008 not between 0005 and 0007)
Error[113] C:\PIC DOCUMENTS\MEDTIM.ASM 68 : Symbol not previously defined (two)
Error[113] C:\PIC DOCUMENTS\MEDTIM.ASM 70 : Symbol not previously defined (four)
Error[113] C:\PIC DOCUMENTS\MEDTIM.ASM 72 : Symbol not previously defined (six)
Error[113] C:\PIC DOCUMENTS\MEDTIM.ASM 74 : Symbol not previously defined (eight)
Error[113] C:\PIC DOCUMENTS\MEDTIM.ASM 76 : Symbol not previously defined (ten)
Error[113] C:\PIC DOCUMENTS\MEDTIM.ASM 78 : Symbol not previously defined (twelve)
Here is part of the program:
list p=pic16f877
radix hex
; #include <p16f877>
;================================================================================================================================================================================
;
; cpu equates (memory map)
tmro equ 0x01
porta equ 0x05
portb equ 0x06
portc equ 0x07
portd equ 0x08
porte equ 0x09
intcon equ 0x0c
second equ 0x0e
minute equ 0x10
hours equ 0x12
minutes equ 0x14
;============================================================================================================================================================
org 0x00
goto start ;skip interrupt vector
start
org 0x004
bcf intcon,7 ;disable global interrupt
movlw b'000001' ;setup port a
tris porta ;setup port a 1=in,0=out
movlw b'000000' ;clear porta
movwf porta
movlw b'00000111' ;setup portb
tris portb ;setup portb 1=in, 0=out
movlw b'00000000' ;clear b
movwf portb
movlw b'00001100' ;portc
tris portc ;setup portc 1=in,0=out
movlw b'00000000' ;clear c
movwf portc
movlw b'00000000' ;setup d
tris portd
movlw b'00000000' ;clear d
movwf portd
pgm
clrw ;clear w
clrf second ;clear second count
clrf minute ;clear minute count
clrf minutes ;clear clock mintes
clrf hours ;clear clock hours
btfss porta,5 ;test port a5, skip next if set(low active)
goto two
btfss portb,5 ;test portb5, skip next if set
goto four
btfss portb,6 ;test portb6
goto six
btfss portb,7 ;test portb7
goto eight
btfss portc,4 ;test portc4,skip next if set
goto ten
btfss portc,5 ;test portc5
goto twelve
end
;===================================================================================================================================================================
two
movlw b'00000000' ;setting first digit
wovwf porta
movlw b'00100000' ;setting second digit
movwf portb
movlw b'00000010' ;loading hours
movfw hours
movlw b'00000000' ;setting third digit
movwf portc
movlw b'00000000' ;setting fourth digit
movwf portd
movlw b'00000000' ;loading minutes
movwf minutes
goto clock
;=====================================================================================================================================================================
four
movlw b'00000000' ;setting first digit
wovwf porta
movlw b'01000000' ;setting second digit
movwf portb
movlw b'00000100' ;loading hours
movfw hours
movlw b'00000000' ;setting third digit
movwf portc
movlw b'00000000' ;setting fourth digit
movwf portd
movlw b'00000000' ;loading minutes
movwf minutes
goto clock
;==========================================================================================================================================================================
six
movlw b'00000000' ;setting first digit
wovwf porta
movlw b'01100000' ;setting second digit
movwf portb
movlw b'00000110' ;loading hours
movfw hours
movlw b'00000000' ;setting third digit
movwf portc
movlw b'00000000' ;setting fourth digit
movwf portd
movlw b'00000000' ;loading minutes
movwf minutes
goto clock
;=================================================================================================================================================================================
eight
movlw b'00000000' ;setting first digit
wovwf porta
movlw b'10000000' ;setting second digit
movwf portb
movlw b'00001000' ;loading hours
movfw hours
movlw b'00000000' ;setting third digit
movwf portc
movlw b'00000000' ;setting fourth digit
movwf portd
movlw b'00000000' ;loading minutes
movwf minutes
goto clock
;===================================================================================================================================================================================
ten
movlw b'00000001' ;setting first digit
wovwf porta
movlw b'00000000' ;setting second digit
movwf portb
movlw b'00001010' ;loading hours
movfw hours
movlw b'00000000' ;setting third digit
movwf portc
movlw b'00000000' ;setting fourth digit
movwf portd
movlw b'00000000' ;loading minutes
movwf minutes
goto clock
;==================================================================================================================================================================================
twelve
movlw b'00000001' ;setting first digit
wovwf porta
movlw b'01000000' ;setting second digit
movwf portb
movlw b'00001100' ;loading hours
movfw hours
movlw b'00000000' ;setting third digit
movwf portc
movlw b'00000000' ;setting fourth digit
movwf portd
movlw b'00000000' ;loading minutes
movwf minutes
goto clock
;===================================================================================================================================================================================
clock
bsf t1con,tmr1on ;turn on timer 1
bcf t1con,tmr1cs ;use internal 4mhz clock
movlw 0x8
movwf t1ckps0 ;set prescale = 8
bcf t1con,t1ckps1 ;set division = 0
; movlw b'00110001'
; movwf t1con ;alternative load
goto circle
goto clock
Any Ideas?