Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Getting Syntax error(in db statement) in keil ..

Status
Not open for further replies.

tushki7

Full Member level 4
Joined
Jul 6, 2010
Messages
232
Helped
50
Reputation
100
Reaction score
47
Trophy points
1,318
Location
india
Activity points
2,789
Hey Guys,
I am getting syntax error whenever i use DB command to create a table in keil. .
for example take this program:-
-------------------------------------------------------------------------------------------------------------------
Code:
;Program for Nokia 3310 LCD PCD8544 48x84 pixcel
		 

		 	SCK		BIT	P1.7
		 	SDIN		BIT	P1.6
		 	D_C		BIT	P1.5	
		 	SCE		BIT	P1.4	
		 	RES		BIT	P1.3
		   
		 	
		 	ORG 0000H   		
			AJMP MAIN			
			ORG 0030H  
	MAIN:  	

			MOV SP,#60H 			
			MOV P1,#00H          
			CLR C
			CALL RESET     		
			CALL LCD_INIT  		
		HERE:	
			CALL CLEAR_RAM
			MOV DPTR,#MESSAGE
			CALL LCD_STRING
			CALL DELAYS
			CALL CLEAR_RAM
			MOV DPTR,#IMAGE
			CALL DISPLAY 
			CALL DELAYS
  		   	AJMP HERE
	
		DELAYS:	       	 ;1s DELAY
			MOV R5,#10
		D1:
			CALL DELAY
			DJNZ R5,D1
			RET
				
		DELAY:            	;100ms DELAY
			SETB PSW.4
			MOV R7,#200
		HDH:								
			MOV R6,#100
		HD:	NOP
			NOP
			NOP
			DJNZ R6,HD
			DJNZ R7,HDH	
			CLR PSW.4	
			RET

				
		RESET:          	 ; RESET 
			SETB SCE
			SETB RES
			CLR  RES
			CALL DELAY
			SETB RES
			RET
			
		LCD_INIT:             			;INITALIZE LCD
			MOV DPTR,#LCDCODE1
			CALL LCD_IN	
		   	CALL CLEAR_RAM
		   	MOV R1,#00H   	;Y
		   	MOV R2,#00H    	;X
			CALL CURSOR
			RET
			
	LCD_IN:	            
			MOV A,#00H
			MOV R6,#00H
	LOOP3:
			INC R6
			MOVC A,@A+DPTR
			CJNE A,#2FH,NEXT3 	
			RET
	NEXT3:
			CALL LCD_COM
			MOV A,R6
			AJMP LOOP3
				
		DISPLAY:            			 ;DISPLAY IMAGE
				MOV R7,#06H
			DO:	PUSH DPL
				PUSH DPH
				MOV R6,#84
			BACK:
				MOV A,#00H
				MOVC A,@A+DPTR
				CALL ROTATE
				CALL LCD_DATA
				CALL IN_DP
				DJNZ R6,BACK
				POP DPH
				POP DPL
				INC DPTR
            				DJNZ R7,DO
				RET
				
				
			IN_DP:
				MOV R5,#06H
	  		GO1:	INC DPTR
				DJNZ R5,GO1
				RET	

			ROTATE:
				CLR C	 
				MOV R3,#8H       
			ROT:
				RLC A
				MOV 53H,A
				PUSH 53H
				MOV A,R1
				RRC A
				MOV R1,A          
				POP 53H
				MOV A,53H
				DJNZ R3,ROT
				MOV A,R1
            				RET
            
			LCD_COM:            		 ;ROUTINE TO SEND LCD COMMAND
				CLR D_C
				CLR SCE
				NOP
				CALL CLOCK_DATA
				SETB SCE
				NOP
				RET
				
			LCD_DATA:      		;ROUTINE TO SEND LCD DATA
				SETB D_C
				CLR SCE
				NOP
				CALL CLOCK_DATA
				NOP
				SETB SCE
				RET
				
			CLOCK_DATA:         		 ;ROUTINE FOR SPI
			 	CLR C
				MOV R5,#08
			HERE1:
				CLR SCK
				RLC A
				MOV SDIN,C
				SETB SCK
				DJNZ R5,HERE1
				RET
			
			CURSOR:           		 ;SET DISPLAY CURSOR
				MOV A,R1   	  ;Y POINTER
				ANL A,#07H
				ORL A,#40H
				CALL LCD_COM
				MOV A,R2     	 ;X POINTER
				ANL A,#7FH
				ORL A,#80H
				CALL LCD_COM
				RET
				
		CLEAR_RAM: 			  ;CLEAR RAM
				MOV R1,#00H
				MOV R2,#00H
				CALL CURSOR
				CLR C
				MOV R6,#06
			LOOP:
			   	MOV R7,#84
			LOOP1:
				MOV A,#00H
				CALL LCD_DATA
				DJNZ R7,LOOP1	
			   	DJNZ R6,LOOP
			  	 RET
			   
		LCD_STRING:       			  ;ROUTINE TO DISPLAY MESSAGE
				MOV A,#0H
				MOV 50H,#0H
			NEXT:
				INC 50H
				MOVC A,@A+DPTR
				CJNE A,#2FH,NEXT1
				RET
			NEXT1:
				CALL TABLE_PTR
				MOV A,#00H
				CALL LCD_DATA
				MOV A,50H
				AJMP NEXT
				
			TABLE_PTR: 
							
				PUSH DPL 
				PUSH DPH
				
				MOV DPTR,#TABLE
				MOV B,#05H
				MUL AB
				SUBB A,#0A0H
				JNC HERE2
				DEC B
			HERE2:
			  	MOV R4,A
			  	CJNE R4,#00H,L1
			  	AJMP L3		   	
			  L1:	INC DPTR
				DJNZ R4,L1
			  L3:		
				CLR C
				MOV R4,B
			      	CJNE R4,#00H,L2
			      	AJMP L4
				L2:INC DPH
				DJNZ R4,L2	   			
			L4:
				MOV R6,#00H
				MOV A,#00H
			NEXT2:
				INC R6
				MOVC A,@A+DPTR
				CALL LCD_DATA
				MOV A,R6
				CJNE R6,#05H,NEXT2
				POP DPH
				POP DPL
				RET				   
														
			LCDCODE1:
				DB 21H  
			  	DB 90H		
				DB 07H   
				DB 13H   
				DB 20H   
				DB 09H   
				DB 08H   
			   	DB 0CH   
         				DB 2FH   
 
 	 
MESSAGE: DB "  GOOD DAY !/" 

	  


TABLE:        ;HEX ARRAY TO DISPLAY CHARACTERS 
DB		000H,000H,000H,000H,000H,	; 20 space		
DB		000H,000H,05fH,000H,000H,	; 21 !			
DB		000H,007H,000H,007H,000H,	; 22 "			
DB		014H,07fH,014H,07fH,014H,	; 23 #			
DB		024H,02aH,07fH,02aH,012H,	; 24 $			
DB		023H,013H,008H,064H,062H,	; 25 %
DB		036H,049H,055H,022H,050H,	; 26 &
DB		000H,005H,003H,000H,000H,	; 27 '
DB		000H,01cH,022H,041H,000H,	; 28 (
DB		000H,041H,022H,01cH,000H,	; 29 )
DB		014H,008H,03eH,008H,014H,	; 2a *
DB		008H,008H,03eH,008H,008H,	; 2b +
DB		000H,050H,030H,000H,000H,	; 2c ,
DB		008H,008H,008H,008H,008H,	; 2d -
DB		000H,060H,060H,000H,000H,	; 2e .
DB		020H,010H,008H,004H,002H,	; 2f /
DB		03eH,051H,049H,045H,03eH,	; 30 0
DB		000H,042H,07fH,040H,000H,	; 31 1
DB		042H,061H,051H,049H,046H,	; 32 2
DB		021H,041H,045H,04bH,031H,	; 33 3
DB		018H,014H,012H,07fH,010H,	; 34 4
DB		027H,045H,045H,045H,039H,	; 35 5
DB		03cH,04aH,049H,049H,030H,	; 36 6
DB		001H,071H,009H,005H,003H,	; 37 7
DB		036H,049H,049H,049H,036H,	; 38 8
DB		006H,049H,049H,029H,01eH,	; 39 9
DB		000H,036H,036H,000H,000H,	; 3a :
DB		000H,056H,036H,000H,000H,	; 3b ;
DB		008H,014H,022H,041H,000H,	; 3c <
DB		014H,014H,014H,014H,014H,	; 3d =
DB		000H,041H,022H,014H,008H,	; 3e >
DB		002H,001H,051H,009H,006H,	; 3f ?
DB		032H,049H,079H,041H,03eH,	; 40 @
DB		07eH,011H,011H,011H,07eH,	; 41 A
DB		07fH,049H,049H,049H,036H,	; 42 B
DB		03eH,041H,041H,041H,022H,	; 43 C
DB		07fH,041H,041H,022H,01cH,	; 44 D
DB		07fH,049H,049H,049H,041H,	; 45 E
DB		07fH,009H,009H,009H,001H,	; 46 F
DB		03eH,041H,049H,049H,07aH,	; 47 G
DB		07fH,008H,008H,008H,07fH,	; 48 H
DB		000H,041H,07fH,041H,000H,	; 49 I
DB		020H,040H,041H,03fH,001H,	; 4a J
DB		07fH,008H,014H,022H,041H,	; 4b K
DB		07fH,040H,040H,040H,040H,	; 4c L
DB		07fH,002H,00cH,002H,07fH,	; 4d M
DB		07fH,004H,008H,010H,07fH,	; 4e N
DB		03eH,041H,041H,041H,03eH,	; 4f O
DB		07fH,009H,009H,009H,006H,	; 50 P
DB		03eH,041H,051H,021H,05eH,	; 51 Q
DB		07fH,009H,019H,029H,046H,	; 52 R
DB		046H,049H,049H,049H,031H,	; 53 S
DB		001H,001H,07fH,001H,001H,	; 54 T
DB		03fH,040H,040H,040H,03fH,	; 55 U
DB		01fH,020H,040H,020H,01fH,	; 56 V
DB		03fH,040H,038H,040H,03fH,	; 57 W
DB		063H,014H,008H,014H,063H,	; 58 X
DB		007H,008H,070H,008H,007H,	; 59 Y
DB		061H,051H,049H,045H,043H,	; 5a Z
DB		000H,07fH,041H,041H,000H,	; 5b [
DB		002H,004H,008H,010H,020H,	; 5c Yen Currency Sign
DB		000H,041H,041H,07fH,000H,	; 5d ]
DB		004H,002H,001H,002H,004H,	; 5e ^
DB		040H,040H,040H,040H,040H,	; 5f _
DB		000H,001H,002H,004H,000H,	; 60 `
DB		020H,054H,054H,054H,078H,	; 61 a
DB		07fH,048H,044H,044H,038H,	; 62 b
DB		038H,044H,044H,044H,020H,	; 63 c
DB		038H,044H,044H,048H,07fH,	; 64 d
DB		038H,054H,054H,054H,018H,	; 65 e
DB		008H,07eH,009H,001H,002H,	; 66 f
DB		00cH,052H,052H,052H,03eH,	; 67 g
DB		07fH,008H,004H,004H,078H,	; 68 h
DB		000H,044H,07dH,040H,000H,	; 69 i
DB		020H,040H,044H,03dH,000H,	; 6a j 
DB		07fH,010H,028H,044H,000H,	; 6b k
DB		000H,041H,07fH,040H,000H,	; 6c l
DB		07cH,004H,018H,004H,078H,	; 6d m
DB		07cH,008H,004H,004H,078H,	; 6e n
DB		038H,044H,044H,044H,038H,	; 6f o
DB		07cH,014H,014H,014H,008H,	; 70 p
DB		008H,014H,014H,018H,07cH,	; 71 q
DB		07cH,008H,004H,004H,008H,	; 72 r
DB		048H,054H,054H,054H,020H,	; 73 s
DB		004H,03fH,044H,040H,020H,	; 74 t
DB		03cH,040H,040H,020H,07cH,	; 75 u
DB		01cH,020H,040H,020H,01cH,	; 76 v
DB		03cH,040H,030H,040H,03cH,	; 77 w
DB		044H,028H,010H,028H,044H,	; 78 x
DB		00cH,050H,050H,050H,03cH,	; 79 y
DB		044H,064H,054H,04cH,044H,	; 7a z
DB		000H,008H,036H,041H,000H,	; 7b <
DB		000H,000H,07fH,000H,000H,	; 7c |
DB		000H,041H,036H,008H,000H,	; 7d >
DB		010H,008H,008H,010H,008H,	; 7e Right Arrow 	->
DB		078H,046H,041H,046H,078H	; 7f Left Arrow	<-
					
IMAGE:       ;HEX ARRAY FOR IMAGE

DB 000H,000H,0fdH,000H,000H,080H,
DB 000H,007H,0ffH,000H,001H,000H,
DB 000H,00fH,0ffH,086H,002H,000H,
DB 000H,01fH,0ffH,0f9H,004H,000H,
DB 000H,03fH,0ffH,0fcH,084H,000H,
DB 000H,03fH,0ffH,0fcH,0c4H,000H,
DB 000H,07fH,0ffH,0feH,03cH,001H,
DB 000H,07fH,0ffH,0feH,014H,002H,
DB 000H,07fH,0ffH,0feH,00bH,006H,
DB 000H,07fH,0ffH,0ffH,008H,01aH,
DB 000H,07fH,0ffH,0feH,00cH,002H,
DB 000H,07fH,0ffH,0ffH,006H,004H,
DB 000H,07fH,0ffH,0feH,003H,0f8H,
DB 000H,07fH,0ffH,0feH,003H,0f8H,
DB 000H,03fH,0ffH,0feH,003H,0fcH,
DB 000H,03fH,0ffH,0fcH,003H,0f8H,
DB 000H,01fH,0ffH,0fcH,001H,0fcH,
DB 000H,00fH,0ffH,0f8H,001H,0fcH,
DB 000H,007H,0ffH,0f0H,001H,0fcH,
DB 000H,001H,0ffH,0e0H,001H,0fcH,
DB 0e0H,000H,0ffH,0fcH,001H,0fcH,
DB 0f0H,003H,0ffH,0efH,001H,0fcH,
DB 0f8H,007H,0ffH,081H,0c1H,0fcH,
DB 0fcH,00fH,0feH,000H,061H,0fcH,
DB 0feH,03fH,0fcH,000H,030H,0fcH,
DB 0feH,03fH,0fcH,000H,018H,0fcH,
DB 0ffH,07fH,0f8H,000H,00cH,0fcH,
DB 0ffH,0ffH,0f8H,000H,006H,0fcH,
DB 0ffH,0ffH,0f8H,000H,002H,0feH,
DB 0ffH,0ffH,0f8H,000H,003H,0feH,
DB 0ffH,0ffH,0f8H,000H,001H,0feH,
DB 0ffH,0ffH,0f8H,020H,007H,0feH,
DB 0ffH,0ffH,0f8H,020H,001H,0feH,
DB 0ffH,0ffH,0fcH,03cH,008H,07eH,
DB 0ffH,0ffH,0fcH,027H,0ffH,03eH,
DB 0ffH,0ffH,0feH,011H,0ffH,09eH,
DB 0ffH,0c0H,00fH,000H,07fH,0cfH,
DB 0ffH,080H,001H,080H,03fH,0efH,
DB 0ffH,000H,000H,080H,00fH,0cfH,
DB 0f6H,000H,000H,000H,00fH,0dfH,
DB 0c2H,000H,000H,000H,007H,09fH,
DB 002H,060H,000H,000H,003H,0bfH,
DB 003H,040H,0bfH,000H,001H,03fH,
DB 001H,081H,003H,0c0H,001H,07fH,
DB 001H,082H,007H,0e0H,001H,0ffH,
DB 001H,0c0H,003H,0e0H,000H,0ffH,
DB 000H,0f1H,080H,0c0H,000H,0ffH,
DB 000H,078H,03fH,000H,000H,0ffH,
DB 000H,07eH,000H,004H,000H,0ffH,
DB 000H,030H,000H,008H,000H,0feH,
DB 000H,018H,0dfH,0b0H,000H,0feH,
DB 000H,00cH,087H,0e0H,000H,0feH,
DB 000H,003H,023H,0e0H,001H,0feH,
DB 000H,000H,0faH,0c0H,001H,0feH,
DB 000H,000H,01fH,0c0H,003H,0feH,
DB 000H,000H,000H,040H,003H,0feH,
DB 000H,000H,007H,0f0H,007H,0feH,
DB 000H,000H,01eH,0f8H,00dH,0feH,
DB 000H,000H,018H,038H,01bH,0faH,
DB 000H,000H,019H,0f8H,063H,0f1H,
DB 000H,000H,01fH,0ffH,0c3H,0f0H,
DB 000H,000H,00fH,0e0H,003H,0f0H,
DB 000H,000H,002H,000H,003H,0f0H,
DB 000H,000H,000H,000H,003H,0f0H,
DB 000H,000H,000H,000H,003H,0f0H,
DB 000H,000H,000H,000H,000H,000H,
DB 000H,000H,000H,000H,000H,000H,
DB 0feH,000H,07cH,0feH,0feH,0c0H,
DB 070H,000H,082H,010H,092H,020H,
DB 00eH,0feH,082H,020H,092H,01eH,
DB 070H,000H,082H,058H,092H,020H,
DB 0feH,000H,044H,086H,000H,0c0H,
DB 000H,000H,000H,000H,000H,000H,
DB 000H,000H,000H,000H,000H,000H,
DB 000H,000H,000H,000H,000H,000H,
DB 000H,000H,000H,000H,000H,000H,
DB 000H,000H,000H,000H,000H,000H,
DB 000H,000H,000H,000H,000H,000H,
DB 000H,000H,000H,000H,000H,000H,
DB 000H,000H,000H,000H,000H,000H,
DB 000H,000H,000H,000H,000H,000H,
DB 000H,000H,000H,000H,000H,000H,
DB 000H,000H,000H,000H,000H,000H,
DB 000H,000H,000H,000H,000H,000H

END


---------------------------------------------------------------------------------------------------

I am getting syntax error whenever i use DB command to create a table or some database: here is pic :-
db error.jpg

Help me Guys .. 8-O
 
Last edited by a moderator:

Hi Tushki7,

Your syntax error is due to the final comma at the end of each DB statement. Each DB statement is terminated by by the absence of a comma, each comma must be followed by a valid byte entry.

Your initial code:

Code:
DB		000H,060H,060H,000H,000H[COLOR="#FF0000"],[/COLOR]	; 2e .
DB		020H,010H,008H,004H,002H[COLOR="#FF0000"],[/COLOR]	; 2f /
DB		03eH,051H,049H,045H,03eH[COLOR="#FF0000"],[/COLOR]	; 30 0
DB		000H,042H,07fH,040H,000H[COLOR="#FF0000"],[/COLOR]	; 31 1
DB		042H,061H,051H,049H,046H[COLOR="#FF0000"],[/COLOR]	; 32 2
DB		021H,041H,045H,04bH,031H[COLOR="#FF0000"],[/COLOR]	; 33 3
DB		018H,014H,012H,07fH,010H[COLOR="#FF0000"],[/COLOR]	; 34 4
...
...
...

Lagging commas removed:

Code:
        	;HEX ARRAY TO DISPLAY CHARACTERS 
TABLE:		        DB		000H,000H,000H,000H,000H	; 20 space		
			DB		000H,000H,05fH,000H,000H	; 21 !			
			DB		000H,007H,000H,007H,000H	; 22 "			
			DB		014H,07fH,014H,07fH,014H	; 23 #			
			DB		024H,02aH,07fH,02aH,012H	; 24 $			
			DB		023H,013H,008H,064H,062H	; 25 %
			DB		036H,049H,055H,022H,050H	; 26 &
			DB		000H,005H,003H,000H,000H	; 27 '
			DB		000H,01cH,022H,041H,000H	; 28 (
			DB		000H,041H,022H,01cH,000H	; 29 )
			DB		014H,008H,03eH,008H,014H	; 2a *
			DB		008H,008H,03eH,008H,008H	; 2b +
			DB		000H,050H,030H,000H,000H	; 2c ,
			DB		008H,008H,008H,008H,008H	; 2d -
			DB		000H,060H,060H,000H,000H	; 2e .
			DB		020H,010H,008H,004H,002H	; 2f /
			DB		03eH,051H,049H,045H,03eH	; 30 0
			DB		000H,042H,07fH,040H,000H	; 31 1
			DB		042H,061H,051H,049H,046H	; 32 2
			DB		021H,041H,045H,04bH,031H	; 33 3
			DB		018H,014H,012H,07fH,010H	; 34 4
			DB		027H,045H,045H,045H,039H	; 35 5
			DB		03cH,04aH,049H,049H,030H	; 36 6
			DB		001H,071H,009H,005H,003H	; 37 7
			DB		036H,049H,049H,049H,036H	; 38 8
			DB		006H,049H,049H,029H,01eH	; 39 9
			DB		000H,036H,036H,000H,000H	; 3a :
			DB		000H,056H,036H,000H,000H	; 3b ;
			DB		008H,014H,022H,041H,000H	; 3c <
			DB		014H,014H,014H,014H,014H	; 3d =
			DB		000H,041H,022H,014H,008H	; 3e >
			DB		002H,001H,051H,009H,006H	; 3f ?
			DB		032H,049H,079H,041H,03eH	; 40 @
			DB		07eH,011H,011H,011H,07eH	; 41 A
			DB		07fH,049H,049H,049H,036H	; 42 B
			DB		03eH,041H,041H,041H,022H	; 43 C
			DB		07fH,041H,041H,022H,01cH	; 44 D
			DB		07fH,049H,049H,049H,041H	; 45 E
			DB		07fH,009H,009H,009H,001H	; 46 F
			DB		03eH,041H,049H,049H,07aH	; 47 G
			DB		07fH,008H,008H,008H,07fH	; 48 H
			DB		000H,041H,07fH,041H,000H	; 49 I
			DB		020H,040H,041H,03fH,001H	; 4a J
			DB		07fH,008H,014H,022H,041H	; 4b K
			DB		07fH,040H,040H,040H,040H	; 4c L
			DB		07fH,002H,00cH,002H,07fH	; 4d M
			DB		07fH,004H,008H,010H,07fH	; 4e N
			DB		03eH,041H,041H,041H,03eH	; 4f O
			DB		07fH,009H,009H,009H,006H	; 50 P
			DB		03eH,041H,051H,021H,05eH	; 51 Q
			DB		07fH,009H,019H,029H,046H	; 52 R
			DB		046H,049H,049H,049H,031H	; 53 S
			DB		001H,001H,07fH,001H,001H	; 54 T
			DB		03fH,040H,040H,040H,03fH	; 55 U
			DB		01fH,020H,040H,020H,01fH	; 56 V
			DB		03fH,040H,038H,040H,03fH	; 57 W
			DB		063H,014H,008H,014H,063H	; 58 X
			DB		007H,008H,070H,008H,007H	; 59 Y
			DB		061H,051H,049H,045H,043H	; 5a Z
			DB		000H,07fH,041H,041H,000H	; 5b [
			DB		002H,004H,008H,010H,020H	; 5c Yen Currency Sign
			DB		000H,041H,041H,07fH,000H	; 5d ]
			DB		004H,002H,001H,002H,004H	; 5e ^
			DB		040H,040H,040H,040H,040H	; 5f _
			DB		000H,001H,002H,004H,000H	; 60 `
			DB		020H,054H,054H,054H,078H	; 61 a
			DB		07fH,048H,044H,044H,038H	; 62 b
			DB		038H,044H,044H,044H,020H	; 63 c
			DB		038H,044H,044H,048H,07fH	; 64 d
			DB		038H,054H,054H,054H,018H	; 65 e
			DB		008H,07eH,009H,001H,002H	; 66 f
			DB		00cH,052H,052H,052H,03eH	; 67 g
			DB		07fH,008H,004H,004H,078H	; 68 h
			DB		000H,044H,07dH,040H,000H	; 69 i
			DB		020H,040H,044H,03dH,000H	; 6a j 
			DB		07fH,010H,028H,044H,000H	; 6b k
			DB		000H,041H,07fH,040H,000H	; 6c l
			DB		07cH,004H,018H,004H,078H	; 6d m
			DB		07cH,008H,004H,004H,078H	; 6e n
			DB		038H,044H,044H,044H,038H	; 6f o
			DB		07cH,014H,014H,014H,008H	; 70 p
			DB		008H,014H,014H,018H,07cH	; 71 q
			DB		07cH,008H,004H,004H,008H	; 72 r
			DB		048H,054H,054H,054H,020H	; 73 s
			DB		004H,03fH,044H,040H,020H	; 74 t
			DB		03cH,040H,040H,020H,07cH	; 75 u
			DB		01cH,020H,040H,020H,01cH	; 76 v
			DB		03cH,040H,030H,040H,03cH	; 77 w
			DB		044H,028H,010H,028H,044H	; 78 x
			DB		00cH,050H,050H,050H,03cH	; 79 y
			DB		044H,064H,054H,04cH,044H	; 7a z
			DB		000H,008H,036H,041H,000H	; 7b <
			DB		000H,000H,07fH,000H,000H	; 7c |
			DB		000H,041H,036H,008H,000H	; 7d >
			DB		010H,008H,008H,010H,008H	; 7e Right Arrow 	->
			DB		078H,046H,041H,046H,078H	; 7f Left Arrow	<-
					
	       ;HEX ARRAY FOR IMAGE

IMAGE:		DB 000H,000H,0fdH,000H,000H,080H
			DB 000H,007H,0ffH,000H,001H,000H
			DB 000H,00fH,0ffH,086H,002H,000H
			DB 000H,01fH,0ffH,0f9H,004H,000H
			DB 000H,03fH,0ffH,0fcH,084H,000H
			DB 000H,03fH,0ffH,0fcH,0c4H,000H
			DB 000H,07fH,0ffH,0feH,03cH,001H
			DB 000H,07fH,0ffH,0feH,014H,002H
			DB 000H,07fH,0ffH,0feH,00bH,006H
			DB 000H,07fH,0ffH,0ffH,008H,01aH
			DB 000H,07fH,0ffH,0feH,00cH,002H
			DB 000H,07fH,0ffH,0ffH,006H,004H
			DB 000H,07fH,0ffH,0feH,003H,0f8H
			DB 000H,07fH,0ffH,0feH,003H,0f8H
			DB 000H,03fH,0ffH,0feH,003H,0fcH
			DB 000H,03fH,0ffH,0fcH,003H,0f8H
			DB 000H,01fH,0ffH,0fcH,001H,0fcH
			DB 000H,00fH,0ffH,0f8H,001H,0fcH
			DB 000H,007H,0ffH,0f0H,001H,0fcH
			DB 000H,001H,0ffH,0e0H,001H,0fcH
			DB 0e0H,000H,0ffH,0fcH,001H,0fcH
			DB 0f0H,003H,0ffH,0efH,001H,0fcH
			DB 0f8H,007H,0ffH,081H,0c1H,0fcH
			DB 0fcH,00fH,0feH,000H,061H,0fcH
			DB 0feH,03fH,0fcH,000H,030H,0fcH
			DB 0feH,03fH,0fcH,000H,018H,0fcH
			DB 0ffH,07fH,0f8H,000H,00cH,0fcH
			DB 0ffH,0ffH,0f8H,000H,006H,0fcH
			DB 0ffH,0ffH,0f8H,000H,002H,0feH
			DB 0ffH,0ffH,0f8H,000H,003H,0feH
			DB 0ffH,0ffH,0f8H,000H,001H,0feH
			DB 0ffH,0ffH,0f8H,020H,007H,0feH
			DB 0ffH,0ffH,0f8H,020H,001H,0feH
			DB 0ffH,0ffH,0fcH,03cH,008H,07eH
			DB 0ffH,0ffH,0fcH,027H,0ffH,03eH
			DB 0ffH,0ffH,0feH,011H,0ffH,09eH
			DB 0ffH,0c0H,00fH,000H,07fH,0cfH
			DB 0ffH,080H,001H,080H,03fH,0efH
			DB 0ffH,000H,000H,080H,00fH,0cfH
			DB 0f6H,000H,000H,000H,00fH,0dfH
			DB 0c2H,000H,000H,000H,007H,09fH
			DB 002H,060H,000H,000H,003H,0bfH
			DB 003H,040H,0bfH,000H,001H,03fH
			DB 001H,081H,003H,0c0H,001H,07fH
			DB 001H,082H,007H,0e0H,001H,0ffH
			DB 001H,0c0H,003H,0e0H,000H,0ffH
			DB 000H,0f1H,080H,0c0H,000H,0ffH
			DB 000H,078H,03fH,000H,000H,0ffH
			DB 000H,07eH,000H,004H,000H,0ffH
			DB 000H,030H,000H,008H,000H,0feH
			DB 000H,018H,0dfH,0b0H,000H,0feH
			DB 000H,00cH,087H,0e0H,000H,0feH
			DB 000H,003H,023H,0e0H,001H,0feH
			DB 000H,000H,0faH,0c0H,001H,0feH
			DB 000H,000H,01fH,0c0H,003H,0feH
			DB 000H,000H,000H,040H,003H,0feH
			DB 000H,000H,007H,0f0H,007H,0feH
			DB 000H,000H,01eH,0f8H,00dH,0feH
			DB 000H,000H,018H,038H,01bH,0faH
			DB 000H,000H,019H,0f8H,063H,0f1H
			DB 000H,000H,01fH,0ffH,0c3H,0f0H
			DB 000H,000H,00fH,0e0H,003H,0f0H
			DB 000H,000H,002H,000H,003H,0f0H
			DB 000H,000H,000H,000H,003H,0f0H
			DB 000H,000H,000H,000H,003H,0f0H
			DB 000H,000H,000H,000H,000H,000H
			DB 000H,000H,000H,000H,000H,000H
			DB 0feH,000H,07cH,0feH,0feH,0c0H
			DB 070H,000H,082H,010H,092H,020H
			DB 00eH,0feH,082H,020H,092H,01eH
			DB 070H,000H,082H,058H,092H,020H
			DB 0feH,000H,044H,086H,000H,0c0H
			DB 000H,000H,000H,000H,000H,000H
			DB 000H,000H,000H,000H,000H,000H
			DB 000H,000H,000H,000H,000H,000H
			DB 000H,000H,000H,000H,000H,000H
			DB 000H,000H,000H,000H,000H,000H
			DB 000H,000H,000H,000H,000H,000H
			DB 000H,000H,000H,000H,000H,000H
			DB 000H,000H,000H,000H,000H,000H
			DB 000H,000H,000H,000H,000H,000H
			DB 000H,000H,000H,000H,000H,000H
			DB 000H,000H,000H,000H,000H,000H
			DB 000H,000H,000H,000H,000H,000H

Replace both your Data Byte tables with the above correction and your code should assemble fine.

BigDog
 

Attachments

  • Tushki7ASM.jpg
    Tushki7ASM.jpg
    293.6 KB · Views: 81
  • Like
Reactions: tushki7

    tushki7

    Points: 2
    Helpful Answer Positive Rating
Hi Biddogguru,
Actually i already tried this, but i thought removing last comma will terminate the DB derivative and force it to go to the main program i.e after executing first DB instruction it will terminate and does not execute 2nd db instruction ..
so its ok to remove last comma's--> hmm in other programs which i had downloaded from (different sites), programs are exactly same i.e all db statements are ended with those commas(as in this program). .
moreover why should uploader will post wrong programs--> means that those programs are fine and they are debugging well with those comma's ..
there is something i am missing!!!
 

so its ok to remove last comma's--> hmm in other programs which i had downloaded from (different sites), programs are exactly same i.e all db statements are ended with those commas(as in this program). .

Here's the reference to the DB Assembler Directive:

Writing constants to the memory


DB Write to the memory in bytes (1 byte at a time)
DW Write to the memory in words (2 bytes at a time)

<Label> DB (DW) <Value>

Instruction to reserve 1 byte (or 1 word) at the currently addressed program memory location and at the same time, write the given to this location.
At the same time, the current memory address is assigned to the named <Label>.

<Label> DB (DW) <Value 1, Value 2, ...Value n>

Instruction to reserve n bytes (or n words) starting at the currently addressed memory location and write the given <Value 1...n> to these locations.
At the same time, the current memory address is assigned to the named <Label>.

<Label> DB ‘Character‘

Instruction to reserve 1 byte at the currently addressed program memory location and at the same time, write the given ASCII - value of the given <Character> to this location.
At the same time, the current memory address is assigned to the named <Label>.

<Label> DB ‘Character 1‘ , ‘Character 2‘, ... ‘Character n‘

Instruction to reserve n bytes starting at the currently addressed memory location and write the given ASCII - values of the given <Character 1...n> to these locations.
At the same time, the current memory address is assigned to the named <Label>.

<Label> DB "String"

Starting at the currently addressed memory location, reserve 1 byte for each character and write the ASCII - values of the individual characters given in the <String>.
At the same time, the current memory address is assigned to the named <Label>.

You maybe able start a Data Byte table with the directive "DB" and terminate the first line with a comma then continue the next line without the directive "DB" to start the current line.

However, I have not tried this technique.

BigDog
 
  • Like
Reactions: tushki7

    tushki7

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top