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.
My code was compiled using the Archimedes C-51 compiler V4.23. I want to use Keil uVersion2 to compile it. But Keil only support those codes using at least Archimedes C-51 compiler Version 5. Does anybody have any idea for compiling my codes? Thanks
Maggie, Knowing why that line is a problem will require a bit of learning that doesn't have much to do with the 8051 or Keil tools in particular. That's basically a 'C' programming question. The "sizeof" macro that you use is something implemented by the compiler, whereas the directives that start with a '#' are pre-processor directives. Since the preprocessor runs BEFORE the compiler (hence, the "pre"), the compiler cannot evaluate that sizeof expression and the preprocessor doesn't know what you're talking about. Assuming that you brush up a bit on your C skills, I would recommend reading both the 8051 programmers guide and the Keil C51 manual. You can probably skip the linker / assembler manual as a first pass if you're using uVision, but then again, if you're porting code, you might run into problems that require you to know the intricacies of the linker as well.
I think it's worth pointing out that sizeof is an operator, not a macro, particularly given the context.
Good point... please excuse my often "semantically challenged" phraseology. :)