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.
How do I link several assembly files (src) together Hi! I am new into a project where I have several assembly files (.src) belonging to a project in my hand. I figured that almost 80% of them belong to the project and the rest 20% are just there (I am not too sure about it may be they are old source files). I created a new project using Keil uVision2 and added up all the assembly source file under it. But now how do I tell it which all source files it has to link and which not. Because as of now If i saw build target files it just tries to build every assembly source file in the order they where added. Can anyone help me to understand how actualy you link the various assembly source files in Keil uVision2. Since my project has no documentation is there also a smarter way to find out which all assembly source files belong together and should be linked. Regards Kumaran
"My guess is that SP is not defined (hence UNDEFINED IDENTIFIER)." Yep - it always pays to read the error message, and take it literally! In porting from one assembler to another, you are always going to have to do some work in adapting the syntax. You will have to read the Manuals for both assemblers!
Thanks Andre, John and Graham. I tried MOV SP,#0xFBFEH (Graham) but it didnt help. So I guss too that SP is not defined. But what suprises me is the next line of code which moves data into the CP dosnt bring any error. Its just the first line. MOV SP,#0FBFEH MOV CP,#0F600H This whole code is in the main.src module and ur right I dont see any initialization for SP in main.src. How could have this code compliled before in Riegel if they had not defined it then? Can you let me know how I initialize SP for Keil uVision2 assembler? Regards Kumaran
How could have this code compliled before in Riegel if they had not defined it then? By means of an #include file, typically. Or because the assembler assumes it knows the target architecture well enough that it can predefine all SFRs. IIRC, Keil does that in A51 by default, but not in AX51 (the extended assembler). You really will have to read the manuals. Slowly. All of it at least once. You stand no chance of getting this project done unless you learn how to use all the tools involved. It may be better to step back from the actual project for the time being and investigate the Tutorial and examples coming with your Keil installation.
Yes thats why I am trying to work out the tutorials first. My problem is I was a database programmer before. The whole project is written in assembly with not a single line of C code so there is no #include in the code. All i can see is calls to various other modules from the main.src And ofcourse I see some INC files with EXTERN directives. But even there I dont see any SP initialization.
"How could have this code compliled before in Riegel if they had not defined it then?" Probably because it has some pre-defined symbol "SP" To confirm this, you will have to read the Riegel Manual(s) "Can you let me know how I initialize SP for Keil uVision2 assembler?" For this, you will have to read the Keil Manuals I'm sorry - there is no shortcut here: if you're porting from one assembler to another, you need a thorough understanding of both assemblers! Time for some serious reading!
"You really will have to read the manuals. Slowly. All of it at least once." That should be, "You really will have to read the manuals. Slowly. All of them at least once." That's all the Keil manuals and the Rigel manuals. "You stand no chance of getting this project done unless you learn how to use all the tools involved." Exactly - and that means both the Keil tools and the Rigel tools.
"My problem is I was a database programmer before." Yes, that's a big problem! ;-) seriously, if you have no idea about assembler, then you really need to learn assembler first - before you start trying to port undocumented Rigel assembler into Keil assembler! Maybe the honourable thing to do would be to admit now that you are not the right man for this job at this time - I think this is a job for an experienced embedded assembler programmer. "there is no #include in the code. All i can see is ... some INC files with EXTERN directives." That's the assembler equivalent of #include! Again, you really need to get to grips with assembler before trying to take this port any further at all!
Thanks for all the input. I too realise that I have to get a grasp with the manuals first. I plan to take up a training course which Keil offers. Hope that helps me to start with. I would have to do all this by end of this year and be ready to do some serious job. I dont know if its possible but I hope its possible.
Hi All! I would like to know if some of you can suggest a good book to learn assembler and C for embedded system programming. my platform is the Infinion C167CR-LM processor.
Here are a few places to start: http://www.keil.com/books/8051books.asp I learned 8051 assembly from the Intel Instruction Set Manual (http://www.keil.com/dd/docs/datashts/intel/ism51.pdf). Jon
Oops, I keep thinking this is an 8051 thread. Just ignore that last post. I learned the 166 by writing small programs and looking at the assembler output from the compiler. There are a lot of strange addressing modes the 16x can use and that was the easiest way for me to learn them. The old Siemens C167 databook wasn't too bad but it had a lot of Germlish (German converted to English). Jon
Thanks Jon! Its strange that I cant find a single book about C166 family in Amazon in english. I am wondering why there exist no books on C166 family but plenty on other processors.
I thought I'd share my experience here. There is no need to buy any books on C166 because all the information is available on the Infineon's web site. Here is the page with their C166 product line: http://www.infineon.com/cgi/ecrm.dll/ecrm/scripts/prod_cat.jsp?oid=-8137 It has links to numerous application notes, most of which are not related to actual programming of a C166. The important link is to the C166 family instruction set manual: http://www.infineon.com/cgi/ecrm.dll/ecrm/scripts/public_download.jsp?oid=8056&parent_oid=-8137 It's not that hard to read. The tricky thing, as Jon said, is to familiarize yourself with all the addressing modes. I guess the efficient way is to read up on each of those modes when you see them in the code you have to deal with. Another manual you will probably have to read is the microcontroller manual. You'll find it in the individual product section of the Infineon's web site. And, of course, you will have to learn Keil's assembler syntax. That would be in the Keil's assembler manual. All of that is a lot to learn. I'm no expert in teaching so I can't give advice how to plan the learning process. All I can tell is that Infineon's and Keil's manuals was all I needed. And you should read them from first page to last at least once, but not necessarily in one go. It's all right if you won't remember much after reading. The important thing is that you will know where to look when you have a question. - mike