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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/04/08 20:30
Read: times


 
#159656 - from where I sit...
Responding to: ???'s previous message
I said:
I can use the very same argument: why bother with creating a separate file and go through all the oddities of linking it together with the C part?

Erik Malund said:
1) what oddities?

Well, the sheer fact that you have to link files, is an added - and often unjustified - complexity, as compared to a single-file project. Especially in an environment with very relaxed link between the formal declaration of variables and parameters passed to and from functions in a module, and the implementation of module itself. Yes, the separate header files - and a chain of them (plus a bunch of switches to the compiler) - in order to define basic things such as what the hell is char and int - are a very stupid idea.

Then, linkers tend to be quirky animals. I - the dedicated C-hater - was pushed to use several different Cs and their toolchains (on different processors/mcus) in the past few months, and have tons of stories to tell. About a half is linking related (and half of the rest is make related which is an another bunch of very stupid design decisions).

But that's maybe just me, who's stupid here.

Erik Malund said:
2) why put an assembler function in a C module

Why not if it is related to the topic of the module? For example, if I have a communication library, with relatively extensive functions for e.g.assembling/disassembling packets, adding headers/footers - which, together with deffinition of necessary resources (buffers, pointers) would quite naturally occur in C; I see fully justified to add to that very library the low-level interrupt service routine which transmits and receives bytes to/from the buffers - and, as it is very often the case, it is fully justified to write these ISRs in asm, because of speed, latency, whatever.

JW




List of 48 messages in thread
TopicAuthorDate
Asm and C            01/01/70 00:00      
   Depends!            01/01/70 00:00      
      Also            01/01/70 00:00      
         No! Not Inline!!            01/01/70 00:00      
            why not inline?            01/01/70 00:00      
               I agree with Andy (at least for Keil), but ....            01/01/70 00:00      
                  Keil specifically            01/01/70 00:00      
                     Keil and reasoning            01/01/70 00:00      
                        Jan...Take it from experience...            01/01/70 00:00      
                           can you please explain?            01/01/70 00:00      
                              Example??            01/01/70 00:00      
                                 I am curious            01/01/70 00:00      
                              Use these references in lieu of examples:            01/01/70 00:00      
                              I explained it earlier; example here            01/01/70 00:00      
                                 I now see the point with Keil...            01/01/70 00:00      
                                    Often intrinsic use of inline assembler            01/01/70 00:00      
                                       Not a safe assumption?            01/01/70 00:00      
                                          No, extrapolation not allowed            01/01/70 00:00      
                                          but if it is a macro...            01/01/70 00:00      
                                             A limited example            01/01/70 00:00      
                                                an opinion            01/01/70 00:00      
                     Keil specifically - more            01/01/70 00:00      
               Why Not inline C            01/01/70 00:00      
               Inline assembler - Avoid! Avoid!!            01/01/70 00:00      
                  in order to keep things together            01/01/70 00:00      
                     I do            01/01/70 00:00      
                        from where I sit...            01/01/70 00:00      
                           you said it            01/01/70 00:00      
                              this has nothing to do with it            01/01/70 00:00      
                                 asm *functions* embedded in C-majority source file            01/01/70 00:00      
                                 Whay Not???            01/01/70 00:00      
                                    My view point on ASM in C            01/01/70 00:00      
                                       That is the point            01/01/70 00:00      
                                 here is one - at least re Keil            01/01/70 00:00      
                     Maybe not here, but...            01/01/70 00:00      
            I do not disagree            01/01/70 00:00      
   Compiler ?            01/01/70 00:00      
      Get the manual when/where you get the compiler            01/01/70 00:00      
   and C in asm ?            01/01/70 00:00      
      C first?            01/01/70 00:00      
         not used to call compiler generated asm so translate by hand            01/01/70 00:00      
      if a compiler can do it            01/01/70 00:00      
      depends on the compiler            01/01/70 00:00      
         SDCC...            01/01/70 00:00      
            What assembler?            01/01/70 00:00      
               SB-asm            01/01/70 00:00      
                  In principle this should work.            01/01/70 00:00      
                  OTOH, why not simply write in ASM?            01/01/70 00:00      

Back to Subject List