problem with MPLAB Assembler - Page 1
Forum section: electronics / general

author: RodH
author_rank: Newbie
timestamp: February 10, 2013, 10:37:58 pm
content: I have been attempting to compile the attached program fragment and I get these error messages:Error C:\PIC DOCUMENTS\MEDTIM.ASM 58 : Argument out of range (0008 not between 0005 and 0007)Error C:\PIC DOCUMENTS\MEDTIM.ASM 68 : Symbol not previously defined (two)Error C:\PIC DOCUMENTS\MEDTIM.ASM 70 : Symbol not previously defined (four)Error C:\PIC DOCUMENTS\MEDTIM.ASM 72 : Symbol not previously defined (six)Error C:\PIC DOCUMENTS\MEDTIM.ASM 74 : Symbol not previously defined (eight)Error C:\PIC DOCUMENTS\MEDTIM.ASM 76 : Symbol not previously defined (ten)Error C:\PIC DOCUMENTS\MEDTIM.ASM 78 : Symbol not previously defined (twelve)Here is part of the program:list p=pic16f877radix hex; #include <p16f877>;================================================================================================================================================================================;; cpu equates (memory map)tmro equ 0x01porta equ 0x05portb equ 0x06portc equ 0x07portd equ 0x08porte equ 0x09intcon equ 0x0csecond equ 0x0eminute equ 0x10hours equ 0x12minutes equ 0x14;============================================================================================================================================================org 0x00goto start ;skip interrupt vectorstartorg 0x004bcf intcon,7 ;disable global interruptmovlw b'000001' ;setup port atris porta ;setup port a 1=in,0=outmovlw b'000000' ;clear portamovwf portamovlw b'00000111' ;setup portbtris portb ;setup portb 1=in, 0=outmovlw b'00000000' ;clear bmovwf portbmovlw b'00001100' ;portctris portc ;setup portc 1=in,0=outmovlw b'00000000' ;clear cmovwf portcmovlw b'00000000' ;setup dtris portdmovlw b'00000000' ;clear dmovwf portdpgmclrw ;clear wclrf second ;clear second countclrf minute ;clear minute countclrf minutes ;clear clock mintesclrf hours ;clear clock hoursbtfss porta,5 ;test port a5, skip next if set(low active)goto twobtfss portb,5 ;test portb5, skip next if setgoto fourbtfss portb,6 ;test portb6goto sixbtfss portb,7 ;test portb7goto eightbtfss portc,4 ;test portc4,skip next if setgoto tenbtfss portc,5 ;test portc5goto twelveend;===================================================================================================================================================================twomovlw b'00000000' ;setting first digitwovwf portamovlw b'00100000' ;setting second digitmovwf portbmovlw b'00000010' ;loading hoursmovfw hoursmovlw b'00000000' ;setting third digitmovwf portcmovlw b'00000000' ;setting fourth digitmovwf portdmovlw b'00000000' ;loading minutesmovwf minutesgoto clock;=====================================================================================================================================================================fourmovlw b'00000000' ;setting first digitwovwf portamovlw b'01000000' ;setting second digitmovwf portbmovlw b'00000100' ;loading hoursmovfw hoursmovlw b'00000000' ;setting third digitmovwf portcmovlw b'00000000' ;setting fourth digitmovwf portdmovlw b'00000000' ;loading minutesmovwf minutesgoto clock;==========================================================================================================================================================================sixmovlw b'00000000' ;setting first digitwovwf portamovlw b'01100000' ;setting second digitmovwf portbmovlw b'00000110' ;loading hoursmovfw hoursmovlw b'00000000' ;setting third digitmovwf portcmovlw b'00000000' ;setting fourth digitmovwf portdmovlw b'00000000' ;loading minutesmovwf minutesgoto clock;=================================================================================================================================================================================eightmovlw b'00000000' ;setting first digitwovwf portamovlw b'10000000' ;setting second digitmovwf portbmovlw b'00001000' ;loading hoursmovfw hoursmovlw b'00000000' ;setting third digitmovwf portcmovlw b'00000000' ;setting fourth digitmovwf portdmovlw b'00000000' ;loading minutesmovwf minutesgoto clock;===================================================================================================================================================================================tenmovlw b'00000001' ;setting first digitwovwf portamovlw b'00000000' ;setting second digitmovwf portbmovlw b'00001010' ;loading hoursmovfw hoursmovlw b'00000000' ;setting third digitmovwf portcmovlw b'00000000' ;setting fourth digitmovwf portdmovlw b'00000000' ;loading minutesmovwf minutesgoto clock;==================================================================================================================================================================================twelvemovlw b'00000001' ;setting first digitwovwf portamovlw b'01000000' ;setting second digitmovwf portbmovlw b'00001100' ;loading hoursmovfw hoursmovlw b'00000000' ;setting third digitmovwf portcmovlw b'00000000' ;setting fourth digitmovwf portdmovlw b'00000000' ;loading minutesmovwf minutesgoto clock;===================================================================================================================================================================================clockbsf t1con,tmr1on ;turn on timer 1bcf t1con,tmr1cs ;use internal 4mhz clockmovlw 0x8movwf t1ckps0 ;set prescale = 8bcf t1con,t1ckps1 ;set division = 0; movlw b'00110001'; movwf t1con ;alternative loadgoto circlegoto clockAny Ideas?

author: croberts
author_rank: Regular Contributor
timestamp: February 10, 2013, 10:53:33 pm
content: Hello RodHTry moving the 'end' directive to the end of your code.

author: kripton2035
author_rank: Super Contributor
timestamp: February 10, 2013, 10:54:19 pm
content: Quote from: croberts on February 10, 2013, 10:53:33 pm+1

author: Mr Smiley
author_rank: Frequent Contributor
timestamp: February 10, 2013, 11:59:18 pm
content: Anything to do withtenmovlw b'00000001' ;setting first digitwovwf portawhat's wovwf ??It's in all you calls.