From 789f77bf17283d515deed7b904410a937ac4d77b Mon Sep 17 00:00:00 2001 From: obemu Date: Tue, 31 Dec 2024 14:48:02 +0100 Subject: [PATCH] Added docs for NASM directives 'EXTERN' and 'GLOBAL' --- docs_store/directives/nasm.xml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/docs_store/directives/nasm.xml b/docs_store/directives/nasm.xml index 7fc8b0f0..183fdd61 100644 --- a/docs_store/directives/nasm.xml +++ b/docs_store/directives/nasm.xml @@ -336,17 +336,25 @@ switch to AT&T syntax + + + + EXTERN is similar to the MASM directive EXTRN and the C keyword extern: it is used to declare a symbol which is not defined anywhere in the module being assembled, but is assumed to be defined in some other module and needs to be referred to by this one. Not every object-file format can support external variables: the bin format cannot. + + + GLOBAL is the other end of EXTERN: if one module declares a symbol as EXTERN and refers to it, then in order to prevent linker errors, some other module must actually define the symbol and declare it as GLOBAL. Some assemblers use the name PUBLIC for this purpose. + + + + + + + - - - - - -