??? 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 |