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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/26/07 09:16
Read: times


 
Msg Score: +1
 +1 Informative
#133691 - How else will they know?
Responding to: ???'s previous message
David Gal said:
I want to break up my project in to multiple asm files. I want, for example, to have a group of functions that deal with UART routines to live in a module

This is a very good idea - in fact, pretty much "standard practice"!

Is there a way to avoid using the public/extrn functions for every sub routine/data/equ/set between two asm files?

No, you cannot avoid it.
These are necessary to tell the "publishing" module to make the items available, and to inform the "receiving" module that they are coming from elsewhere.
Exactly the same principles apply in 'C' and other languages, should you ever get into them.

However, you can simplify the process by using Include Files (known as "header" files in 'C'):

You define[1] you code and data in, say, your UART.ASM file and you also provide a UART.INC file that contains all the EXTERN declarations[2] for the externally-available functions & data (you could call this the "API"[3] if you wanted to be posh).
Then, any other module that wants to make use of the UART facilities simply has to INCLUDE the UART.INC file.


[1] A definition is what actually creates executable code, or reserves physical memory.
Every "object" must have exactly one definition.

[2] A declaration simply supplies enough information to allow the "object" to be used, but does not actually create it.
An "object" may have many declarations.

[3] API = Application Program Interface

List of 53 messages in thread
TopicAuthorDate
lame linker related question            01/01/70 00:00      
   How else will they know?            01/01/70 00:00      
      why the **** not???            01/01/70 00:00      
         I so disagree            01/01/70 00:00      
            Small addition            01/01/70 00:00      
            how do you know?            01/01/70 00:00      
         Not the only reason!            01/01/70 00:00      
            Can I throw in another problem here...            01/01/70 00:00      
               it is IS a plain include...            01/01/70 00:00      
                  Thanks Jan...            01/01/70 00:00      
                  Proper Solution            01/01/70 00:00      
                     the problem is ...            01/01/70 00:00      
                     what???            01/01/70 00:00      
                        corrections            01/01/70 00:00      
                           path???? Which path?????            01/01/70 00:00      
                              do you REALLY think that a compiler/linker maker w            01/01/70 00:00      
                                 1 experiment > 3e8h words            01/01/70 00:00      
                                    experiment #2: SDCC            01/01/70 00:00      
                                    very hard            01/01/70 00:00      
                                       but it does not matter!            01/01/70 00:00      
                                          you suffer from a gross misconception            01/01/70 00:00      
               a common issue            01/01/70 00:00      
      i'm looking for something much simpler....            01/01/70 00:00      
         Well, that's fairly simple ... ?            01/01/70 00:00      
         Sure.            01/01/70 00:00      
         Contradiction!            01/01/70 00:00      
            not really.....            01/01/70 00:00      
               give an example            01/01/70 00:00      
                  example            01/01/70 00:00      
                     include ?            01/01/70 00:00      
                        Jon, I didn't know...            01/01/70 00:00      
                           I did not build a truck            01/01/70 00:00      
                     no            01/01/70 00:00      
                        Jan, please read my question            01/01/70 00:00      
                           chop it with axe            01/01/70 00:00      
                              chop & glue            01/01/70 00:00      
                                 ok ok ok            01/01/70 00:00      
                     You need to understand            01/01/70 00:00      
   Not quite the right question.            01/01/70 00:00      
   On modular programming            01/01/70 00:00      
      an example, please            01/01/70 00:00      
         \"Lead us not into temptation\"            01/01/70 00:00      
            the temptation is there anyway            01/01/70 00:00      
               Use all the help the tools can give you!            01/01/70 00:00      
                  if there ARE reasons NOT to use the \"tools\"...            01/01/70 00:00      
                     Famous last words.            01/01/70 00:00      
               A real life analogy:            01/01/70 00:00      
                  thin ice            01/01/70 00:00      
               Remove the Temptation            01/01/70 00:00      
                  Do you want less temptation?            01/01/70 00:00      
                     Thank you            01/01/70 00:00      
                     Cohesion & Coupling            01/01/70 00:00      
         Christoph put it nicely            01/01/70 00:00      

Back to Subject List