<<< Quick Disassembly Examination of Executable Image | Index | Building Your Own Stack Machine >>> |
C/C++ extern keyword specifies that external linkage conventions to link with other languages should used by the variable or function declarator.
extern-declared functions and data become visible to the linker accross multiple .OBJ modules.
However, the extern functions must be defined in a separately compiled translation unit(s).
The following sample demonstrates this technique: COPYNEW.zip contains C++ program calling COPYNEW( ) function defined by the module written in Assembly. The sample contains the following files:
M13_main.cpp ( download ) the main driver program.
M13_NEWARRAY.h ( download ) C++ header file declaring extern functions.
M13_NEWARRAY.cpp ( download ) C++ implementation file defining external functions.
M13_COPYNEW.ASM ( download ) Assembly program that dynamically allocates block of memory and makes copy of the source string.
M13_compile.bat ( download ) Batch command file to compile, assemble and link M13.exe.
<<< Quick Disassembly Examination of Executable Image | Index | Building Your Own Stack Machine >>> |