Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/06/10 20:36
Modified:
  03/06/10 20:47

Read: times


 
#173907 - linking
Responding to: ???'s previous message
Erik Malund said:
... the abscense of a separate linker

SDCC is quite "normal" in this regard, i.e. it follows the preprocessor-compiler-assembler-linker model.

Assuming you have a recent version installed (not 2.9.0), for '51[*], these are sdcpp-sdcc[**]-sdas8051-sdld, respectively; all located in the bin subdirectory of the installation directory. You can see the exact invocation of preprocessor, assembler and linker, if you add "-V" switch to the invocation of sdcc (note that switches are case sensitive).

Erik said:
[...] the only means of precompiled file inclusion is from a libray.

No. You might perhaps want to read chapter 3.1.3 Projects with Multiple Source Files of the manual.

Erik said:
[...]ISRs need be prototyped in main() [...]

The manual puts it down more precisely:
sdccman.pdf in chapter 3.9.1 said:
If you have multiple source files in your project, interrupt service routines can be present in any of them, but a prototype of the isr MUST be present or included in the file that contains the function main.


I think, Maarten Brock once has explained quite concisely the reason, why is it so, but I now can't find it[***], so I try myself (hope I don't get it wrong): when file containing main() is compiled, the interrupt vector table is created (as that contains also the reset vector). So, this file needs to "know", which ISRs are present in the program and under what name, to be able to create that table.

I agree this might be one of the gotchas for the unaware "migrant".

Jan


[*] with the standard installation, you have installed support for *all* targets, i.e. not only '51, but also the extended Dallas '51-s (390 and 400), the Motorola/Freescale HC08, Zilog Z80 (including a gameboy-specific-derivative) and two lines of PICs (but those require some additional software to be installed).

[**] this can be seen as an oddity perhaps. Traditionally, the program called by user to compile - cc - calls all the "components", including the compiler itself (called usually cc1). Here, the compiler itself, sdcc, is invoked by the user; while it calls the preprocessor-assembler-linker, it performs the compilation itself. But this is only a minor, completely unimportant, detail.

[edit][***] found it http://www.8052.com/forumchat/read/166881


List of 39 messages in thread
TopicAuthorDate
SDCC download            01/01/70 00:00      
   Here you go...            01/01/70 00:00      
   newest            01/01/70 00:00      
      Has any effort gone into documentation?            01/01/70 00:00      
         documentation            01/01/70 00:00      
            Just to add...            01/01/70 00:00      
               more howto-s            01/01/70 00:00      
                  the first 'oddity' is ...            01/01/70 00:00      
                     I think you dreamt that one eric            01/01/70 00:00      
                        No - it's a well-known Gotcha! in SDCC!            01/01/70 00:00      
                           Reference: ISRs (or prototypes) must be in same file as main            01/01/70 00:00      
                     linking            01/01/70 00:00      
                        I see it not correct            01/01/70 00:00      
                           I don't understand            01/01/70 00:00      
                              what is it you do not understand?            01/01/70 00:00      
                                 Does it not recognise...            01/01/70 00:00      
                                 Surely not...            01/01/70 00:00      
                                    "magic"            01/01/70 00:00      
                                       That's not the fault of 'C'!!            01/01/70 00:00      
                                       highly unusal, but            01/01/70 00:00      
                                       Try java etc            01/01/70 00:00      
                                 I now see why is this confusing            01/01/70 00:00      
               emulation?            01/01/70 00:00      
                  Source-level debug            01/01/70 00:00      
                     symbol information            01/01/70 00:00      
                        re: symbol information            01/01/70 00:00      
                           hex-file download?            01/01/70 00:00      
                              hex vs omf            01/01/70 00:00      
                     Keil proprietary stuff?            01/01/70 00:00      
                        extended omf51            01/01/70 00:00      
                           omf51 vs cdb            01/01/70 00:00      
                        proprietary file format?            01/01/70 00:00      
                           I don't see why not            01/01/70 00:00      
                              So, what do *you* mean by, "proprietary" ?            01/01/70 00:00      
                                 AutoCAD            01/01/70 00:00      
                           Yes            01/01/70 00:00      
                              patentable vs proprietary            01/01/70 00:00      
                                 Proprietary is a questin of ownership, not protection            01/01/70 00:00      
   bouncing email            01/01/70 00:00      

Back to Subject List