i use the keil uvision3 which can be use for c source code and assembler.each time i write a code in A51 i keep getting error in trying to build it(target not created i.e the error message)whic i thought the error is that i dont know the type of header to use in a51 just like we use #include <> in c51.pls try to give me solution to this.
I have some skills, but none of them includes telepathy (I doubt whether many others here do). How about copy-pasting the error message(s)?
this is the code: INCLUDE <REG52.h> BACK:MOV A,#55H MOV P1,A ACALL DELAY MOV A,#AAH MOV P1,A ACALL DELAY SJMP BACK
DELAY: MOV R0,#11 H1:MOV R1,#248 H2:MOV R3,#255 H3:DJNZ R3,H3 DJNZ R1,H2 DJNZ R0,H1 RET END error message: Build target 'Target 1' assembling TEST2.A51... TEST2.A51(1): error A9: SYNTAX ERROR TEST2.A51(5): error A45: UNDEFINED SYMBOL (PASS-2) Target not created
you forgot to: 1. use your previous thread 2. use the proper tags used to post source code (pre and /pre)
what kind of header should i use in a51 just like we use #inclde<> in c51?
The kind that is described in the A51 Manual!
http://www.keil.com/support/man/docs/a51/
Specifically: http://www.keil.com/support/man/docs/a51/a51_include.htm
Note that "The Ax51 Assembler includes a standard C preprocessor that is identical with the macro preprocessor in the Cx51 Compiler (with a few minor exceptions" http://www.keil.com/support/man/docs/a51/a51_mp_c.htm
you can also reference their "TEMPLATE.A51" file:
C:\...\Keil\C51\ASM\TEMPLATE.A51
Just a re-write...
#INCLUDE <REG52.h> BACK: mov A,#(55h) mov P1,A ACALL DELAY mov A,#(AAh) mov P1,A ACALL DELAY SJMP BACK DELAY: mov R0,#(11) H1: mov R1,#(248) H2: mov R3,#(255) H3: DJNZ R3,H3 DJNZ R1,H2 DJNZ R0,H1 RET END
My preference is to localize the .INC or .H file so it is located with the general source code directory, thus keeping the whole program intact:
#include "REG52.h"
--Cpt. Vince Foster 2nd Cannon Place Fort Marcy Park, VA
FROM THE TEMPLATE FILE IN KEIL A51.I USED: $NOMOD51 #include <reg52.h> ;THE ERROR MESSAGE WAS:
Build target 'Target 1' assembling TEST2.A51... TEST2.A51(7): error A45: UNDEFINED SYMBOL (PASS-2) Target not created.
PLS HELP ME SOLVE THIS PROBLEM!
You are forward referencing the DELAY routine. Is that the problem (I don't want to test it myself now):
(or you might need to use the $INCLUDE method--depending upon the revision of KEIL I guess)...
#INCLUDE <REG52.h> DELAY: mov R0,#(11) H1: mov R1,#(248) H2: mov R3,#(255) H3: DJNZ R3,H3 DJNZ R1,H2 DJNZ R0,H1 RET BACK: mov A,#(55h) mov P1,A ACALL DELAY mov A,#(AAh) mov P1,A ACALL DELAY SJMP BACK END
i try the correction u made above and this was the error message: Build target 'Target 1' assembling TEST2.A51... TEST2.A51(1): error A315: unknown #directive 'INCLUDE' TEST2.A51(23): error A45: UNDEFINED SYMBOL (PASS-2) Target not created
Try the leading zero in the mov A,#(AAh) to mov A,#(0AAh)
#INCLUDE <REG52.h> DELAY: mov R0,#(11) H1: mov R1,#(248) H2: mov R3,#(255) H3: DJNZ R3,H3 DJNZ R1,H2 DJNZ R0,H1 RET BACK: mov A,#(55h) mov P1,A ACALL DELAY mov A,#(0AAh) mov P1,A ACALL DELAY SJMP BACK END
Captain, if you continue posting source code at this rate, Jack Sprat is likely to start complaining about your "cowboy" debugging technics...
the error is now : Build target 'Target 1' assembling TEST2.A51... TEST2.A51(1): error A315: unknown #directive 'INCLUDE' Target not created
No kidding.
i was just trying to see how i can correct this problem.so donot be angry.
Don't make me come down there and fix it! (At this point, you may need a sardine's take on it)
Are you sure about the #include <REG52.H> ? Try localizing it (move REG52.H to the source file directory) and do the #include "REG52.H" thing.
(I really don't want to create a project just do debug this stupid, err, sample code).