ntege 0 Newbie Poster

hi guys there something wrong with this code that i cant quite figure out.i susoect that one of the tables is too long because when i reduce the length of table 1, the code seems to work.
this code is for moving sign display and i need all the stuff in both tables.table 2 is for pointers to table 1.eventually the pointers will be shifted to the eeprom such that by specifying different pointers i can write a word that will move across the display.
the code is as follows;

Start ORG 0x00 ;This sets up the ports
BSF 03,5
MOVLW 00h
MOVWF 05h
MOVWF 06h
BCF 03,5
GOTO Run1

;Table1 holds the hex values for each column of LEDs

Table1 ADDWF 02h,1 ;Add W to Program Counter
RETLW 00h ;letter A
RETLW 3Fh
RETLW 48h
RETLW 48h
RETLW 48h
RETLW 3Fh
RETLW 0FFh
RETLW 00h ;letter B
RETLW 7Fh
RETLW 49h
RETLW 49h
RETLW 49h
RETLW 36h
RETLW 0FFh
RETLW 00h ;letter C
RETLW 3Eh
RETLW 41h
RETLW 41h
RETLW 41h
RETLW 22h
RETLW 0FFh
RETLW 00h ;letter D
RETLW 7Fh
RETLW 41h
RETLW 41h
RETLW 41h
RETLW 3Eh
RETLW 0FFh
RETLW 00h ;letter E
RETLW 7Fh
RETLW 49h
RETLW 49h
RETLW 41h
RETLW 0FFh
RETLW 00h ;letter F
RETLW 7Fh
RETLW 48h
RETLW 48h
RETLW 40h
RETLW 0FFh
RETLW 00h ;letter G
RETLW 3Eh
RETLW 41h
RETLW 49h
RETLW 49h
RETLW 2Eh
RETLW 0FFh
RETLW 00h ;letter H
RETLW 7Fh
RETLW 08h
RETLW 08h
RETLW 08h
RETLW 7Fh
RETLW 0FFh
RETLW 00h ;letter I
RETLW 00h
RETLW 7Fh
RETLW 00h
RETLW 0FFh
RETLW 00h ;letter j
RETLW 02h
RETLW 01h
RETLW 01h
RETLW 7Eh
RETLW 0FFh
RETLW 00h ;letter K
RETLW 7Fh
RETLW 08h
RETLW 18h
RETLW 24h
RETLW 43h
RETLW 0FFh
RETLW 00h ;letter L
RETLW 7Fh
RETLW 01h
RETLW 01h
RETLW 01h
RETLW 0FFh
RETLW 00h ;letter M
RETLW 3Fh
RETLW 40h
RETLW 40h
RETLW 3Fh
RETLW 40h
RETLW 40h
RETLW 3Fh
RETLW 0FFh
RETLW 00h ;letter N
RETLW 7Fh
RETLW 20h
RETLW 1Ch
RETLW 02h
RETLW 7Fh
RETLW 0FFh
RETLW 00h ;letter O
RETLW 3Eh
RETLW 41h
RETLW 41h
RETLW 41h
RETLW 3Eh
RETLW 0FFh
RETLW 00h ;letter P
RETLW 3Fh
RETLW 48h
RETLW 48h
RETLW 48h
RETLW 30h
RETLW 0FFh
RETLW 00h ;letter Q
RETLW 3Eh
RETLW 41h
RETLW 45h
RETLW 43h
RETLW 3Fh
RETLW 0FFh
RETLW 00h ;letter R
RETLW 7Fh
RETLW 48h
RETLW 4Ch
RETLW 4Ah
RETLW 31h
RETLW 0FFh
RETLW 00h ;letter S
RETLW 32h
RETLW 49h
RETLW 49h
RETLW 49h
RETLW 26h
RETLW 0FFh
RETLW 00h ;letter T
RETLW 40h
RETLW 40h
RETLW 7Fh
RETLW 40h
RETLW 40h
RETLW 0FFh
RETLW 00h ;letter U
RETLW 3Eh
RETLW 01h
RETLW 01h
RETLW 01h
RETLW 3Eh
RETLW 0FFh
RETLW 00h ;letter V
RETLW 78h
RETLW 06h
RETLW 01h
RETLW 06h
RETLW 78h
RETLW 0FFh
RETLW 00h ;letter w
RETLW 7Eh
RETLW 01h
RETLW 01h
RETLW 7Eh
RETLW 01h
RETLW 01h
RETLW 7Eh
RETLW 0FFh
RETLW 00h ;letter x
RETLW 41h
RETLW 22h
RETLW 1Ch
RETLW 22h
RETLW 41h
RETLW 0FFh
RETLW 00h ;letter y
RETLW 40h
RETLW 20h
RETLW 1Fh
RETLW 20h
RETLW 40h
RETLW 0FFh
RETLW 00h ;letter z
RETLW 43h
RETLW 45h
RETLW 49h
RETLW 51h
RETLW 51h
RETLW 0FFh
RETLW 00h ;number1
RETLW 10h
RETLW 20h
RETLW 7Fh
RETLW 0FFh
RETLW 00h ;number2
RETLW 27h
RETLW 49h
RETLW 49h
RETLW 49h
RETLW 31h
RETLW 0FFh
RETLW 00h ;number3
RETLW 22h
RETLW 41h
RETLW 49h
RETLW 49h
RETLW 36h
RETLW 0FFh
RETLW 00h ;number4
RETLW 0Ch
RETLW 14h
RETLW 24h
RETLW 7Fh
RETLW 04h
RETLW 0FFh
RETLW 00h ;number5
RETLW 7Ah
RETLW 49h
RETLW 49h
RETLW 49h
RETLW 46h
RETLW 0FFh
RETLW 00h ;number6
RETLW 3Eh
RETLW 49h
RETLW 49h
RETLW 49h
RETLW 26h
RETLW 0FFh
RETLW 00h ;number7
RETLW 40h
RETLW 47h
RETLW 48h
RETLW 50h
RETLW 60h
RETLW 0FFh
RETLW 00h ;number8
RETLW 36h
RETLW 49h
RETLW 49h
RETLW 49h
RETLW 36h
RETLW 0FFh
RETLW 00h ;number9
RETLW 32h
RETLW 49h
RETLW 49h
RETLW 49h
RETLW 3Eh
RETLW 0FFh
RETLW 00h ;number0
RETLW 3Eh
RETLW 41h
RETLW 41h
RETLW 41h
RETLW 3Eh
RETLW 0FFh

Table2 ADDWF 02h,1 ;Add W to Program Counter
RETLW 00h
RETLW 00h ;pointer for A
RETLW 07h ;pointer for B
RETLW 0Eh ;pointer for c
RETLW 15h ;pointer for D
RETLW 1Ch ;pointer for E
RETLW 22h ;pointer for F
RETLW 28h ;pointer for G
RETLW 2Fh ;pointer for H
RETLW 36h ;pointer for I
RETLW 3Bh ;pointer for J
RETLW 41h ;pointer for K
RETLW 48h ;pointer for L
RETLW 4Eh ;pointer for M
RETLW 57h ;pointer for N
RETLW 5Eh ;pointer for O
RETLW 65h ;pointer for P
RETLW 6Ch ;pointer for Q
RETLW 73h ;pointer for R
RETLW 7Ah ;pointer for S
RETLW 81h ;pointer for T
RETLW 88h ;pointer for U
RETLW 8Fh ;pointer for V
RETLW 96h ;pointer for W
RETLW 9Fh ;pointer for X
RETLW 0xA6 ;pointer for Y
RETLW 0xAD ;pointer for Z
RETLW 0xB4 ;pointer for 1
RETLW 0xB9 ;pointer for 2
RETLW 0xC0 ;pointer for 3
RETLW 0xC7 ;pointer for 4
RETLW 0xCE ;pointer for 5
RETLW 0xD5 ;pointer for 6
RETLW 0xDC ;pointer for 7
RETLW 0xE3 ;pointer for 8
RETLW 0xEA ;pointer for 9
RETLW 0xF1 ;pointer for 0
RETLW 0FFh


Run1 CLRF 11h ;Clear the column locations ready for starting
CLRF 12h ;by column i means the columns of the leds on the
CLRF 13h ;running display
CLRF 14h
CLRF 15h
CLRF 16h
CLRF 17h
CLRF 18h
CLRF 19h
CLRF 20h
CLRF 21h
CLRF 22h
CLRF 23h
CLRF 24h
CLRF 25h
CLRF 26h
CLRF 27h
CLRF 28h
CLRF 29h
CLRF 30h


MOVLW 00
MOVWF 40h ;File 40h is file where the pointers for table 2
;are put
esp clrf 30h
clrf 35h
INCF 40h,1 ;this increments the pointers to table2 so that
MOVF 40h,0 ;you can move from one letter to another.
call Table2
MOVWF 35h ;File 35h is file where the pointers for table 1 are put.
XORLW 0FFh ;If table value is FF,
BTFSC 03,2 ; bit 2 of file 3 will be SET (=1)
GOTO Run1 ;Start Table1 again, start the message again.
Run2 MOVLW 20h
MOVWF 36h ;File 18h counts the number of scans
CALL Shift ;and controls the "run speed".The speed at which the message is moving across the display.
INCF 35h,1
MOVF 35h,0 ;Put jump value into W
CALL Table1
MOVWF 30h ;W contains table data - put it in 15h
XORLW 0FFh ;If table value is FF,
BTFSC 03,2 ;bit 2 of file 3 will be SET (=1)
GOTO esp ;Start Table1 again
Run3 DECFSZ 36h,1 ;Scan the display 40h times
GOTO Run4
GOTO Run2
Run4 CALL Scan
GOTO Run3

Scan BSF 05,1 ;Reset 4017
NOP
BCF 05,1

MOVF 11h,0 ;Output the data at the 5 Ghost
MOVWF 06h ; locations to the display
CALL DelD
MOVF 12h,0
MOVWF 06h
CALL DelD
MOVF 13h,0
MOVWF 06h
CALL DelD
MOVF 14h,0
MOVWF 06h
CALL DelD
MOVF 15h,0
MOVWF 06h
CALL DelD
MOVF 16h,0
MOVWF 06h
CALL DelD
MOVF 17h,0
MOVWF 06h
CALL DelD
MOVF 18h,0
MOVWF 06h
CALL DelD
MOVF 19h,0
MOVWF 06h
CALL DelD
MOVF 20h,0
MOVWF 06h
CALL DelD
MOVF 21h,0
MOVWF 06h
CALL DelD
MOVF 22h,0
MOVWF 06h
CALL DelD
MOVF 23h,0
MOVWF 06h
CALL DelD
MOVF 24h,0
MOVWF 06h
CALL DelD
MOVF 25h,0
MOVWF 06h
CALL DelD
MOVF 26h,0
MOVWF 06h
CALL DelD
MOVF 27h,0
MOVWF 06h
CALL DelD
MOVF 28h,0
MOVWF 06h
CALL DelD
MOVF 29h,0
MOVWF 06h
CALL DelD
MOVF 30h,0
MOVWF 06h
CALL DelD
RETURN

;SHIFT moves the data one place to the left to give the "movement"
; effect on the screen

Shift MOVF 12h,0 ;Move file 12h to W
MOVWF 11h ;Move W to file 11h
MOVF 13h,0 ;Move file 13h to W
MOVWF 12h ;Move W to file 12h
MOVF 14h,0 ;Move file 14h to W
MOVWF 13h ;Move W to file 13h
MOVF 15h,0 ;Move file 15h to W
MOVWF 14h ;Move W to file 14h
MOVF 16h,0 ;Move file 16h to W
MOVWF 15h ;Move W to file 15h
MOVF 17h,0 ;Move file 17h to W
MOVWF 16h ;Move W to file 16h
MOVF 18h,0 ;Move file 17h to W
MOVWF 17h ;Move W to file 16h
MOVF 19h,0 ;Move file 17h to W
MOVWF 18h ;Move W to file 16h
MOVF 20h,0 ;Move file 17h to W
MOVWF 19h ;Move W to file 16h
MOVF 21h,0 ;Move file 17h to W
MOVWF 20h ;Move W to file 16h
MOVF 22h,0 ;Move file 17h to W
MOVWF 21h ;Move W to file 16h
MOVF 23h,0 ;Move file 17h to W
MOVWF 22h ;Move W to file 16h
MOVF 24h,0 ;Move file 17h to W
MOVWF 23h ;Move W to file 16h
MOVF 25h,0 ;Move file 17h to W
MOVWF 24h ;Move W to file 16h
MOVF 26h,0 ;Move file 17h to W
MOVWF 25h ;Move W to file 16h
MOVF 27h,0 ;Move file 17h to W
MOVWF 26h ;Move W to file 16h
MOVF 28h,0 ;Move file 17h to W
MOVWF 27h ;Move W to file 16h
MOVF 29h,0 ;Move file 17h to W
MOVWF 28h ;Move W to file 16h
MOVF 30h,0 ;Move file 17h to W
MOVWF 29h ;Move W to file 16h
RETURN


DelD DECFSZ 1Bh,1 ;Delay for viewing the
GOTO DelD ; column of LEDs
MOVLW 00h
MOVWF 06
Clk BSF 05,0 ;Clock the 4017 to
NOP ; the next output
BCF 05,0
RETURN

END