We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
i m doing a traffic signal project using 89c2051..now when i run my (assembly lang) program it gives two errors in keil...
program is as follows>>>(i have marked the lines where i got error)
INCLUDE REG_52.PDF <<<<<<<<<<<<<<<<<<<<<error SYNTAX ERROR (i used $mod51 syntax then)
NR EQU P3.5 NY EQU P3.4 NG EQU P3.3
SR EQU P1.2 SY EQU P1.3 SG EQU P1.4
ER EQU P1.5 EY EQU P1.6 EG EQU P1.7
WR EQU P3.7 <<<<<<<<<<<<<<<<<<<error ( ATTEMPT TO DEFINE AN ALREADY DEFINED SYMBOL) WY EQU P1.0 WG EQU P1.1
CSEG AT 0 ; RESET VECTOR ;---------==========----------==========---------=========--------- ; PROCESSOR INTERRUPT AND RESET VECTORS ;---------==========----------==========---------=========---------
ORG 00H ; Reset JMP MAIN ;---------==========----------==========---------=========--------- MAIN: MOV SP,#40H MOV P1,#0FFH MOV P3,#0FFH
TOP: CLR NR CLR SR CLR ER CLR WY SETB WG CALL Y_DELAY SETB NR CLR NY CLR WR SETB WY CALL Y_DELAY SETB NY CLR NG CALL DELAY
CLR NY SETB NG CALL Y_DELAY CLR NR SETB NY SETB SR CLR SY CALL Y_DELAY SETB SY CLR SG CALL DELAY
CLR SY SETB SG CALL Y_DELAY CLR SR SETB SY SETB ER CLR EY CALL Y_DELAY SETB EY CLR EG CALL DELAY
CLR EY SETB EG CALL Y_DELAY CLR ER SETB EY SETB WR CLR WY CALL Y_DELAY SETB WY CLR WG CALL DELAY AJMP TOP
;********************************************************** DELAY: MOV R3,#3FH REPA3: MOV R1,#0FFH REPA2: MOV R2,#0FFH REPA1: NOP DJNZ R2,REPA1 DJNZ R1,REPA2 DJNZ R3,REPA3 RET ; ---------==========----------==========---------=========--------- Y_DELAY: MOV R3,#1AH RQPA3: MOV R1,#0FFH RQPA2: MOV R2,#0FFH RQPA1: NOP DJNZ R2,RQPA1 DJNZ R1,RQPA2 DJNZ R3,RQPA3 RET ;********************************************************** END
INCLUDE REG_52.PDF
Hmmm. I've never considered the possibility that I could include a PDF document into my assembler files.
Maybe I'm missing a trick.
But of course. You create your product specification and save to PDF. Then including it in the assembler code makes the assembler know about the project so it can greate the _best_ program possible. With good enough PDF documentation, you can probably even get the 8051 assembler to produce a Linux kernel for an ARM or x86 processor, together with all the normal binaries you need to get a usable Unix system ;)
On a related note - when a compiler or assembler complains about a symbol already been defined, it means just that. WR isn't a very original name for a variable. Selecting two-character names isn't very descriptive.
my (assembly lang) program a program is formatted, indented and commented the scribbles you post do not, and can never, qualify as a 'program'
Erik