Skip to content

Commit

Permalink
Added docs for NASM directives 'EXTERN' and 'GLOBAL'
Browse files Browse the repository at this point in the history
  • Loading branch information
obemu committed Dec 31, 2024
1 parent c350daa commit 789f77b
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions docs_store/directives/nasm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -336,17 +336,25 @@
<directive name=".ATT_SYNTAX" tool="nasm">
<description>switch to AT&amp;T syntax</description>
</directive>

<!-- See https://www.nasm.us/xdoc/2.16.03/html/nasmdoc7.html -->
<directive name="EXTERN" tool="nasm">
<description>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.</description>
</directive>
<directive name="GLOBAL" tool="nasm">
<description>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.</description>
</directive>

<!-- No need for this, see ALIGN and ALIGNB macro -->
<!-- <directive name=".ALIGN" tool="nasm"> -->
<!-- <description>TODO</description> -->
<!-- </directive> -->

<!-- NOTE: Wasn't able to find any reference to .TEXT, .GLOBAL, .ALIGN, or
.NOPREFIX as a NASM directive online, commenting these out for now -->
<!-- <directive name=".TEXT" tool="nasm"> -->
<!-- <description>TODO</description> -->
<!-- </directive> -->
<!-- <directive name=".GLOBAL" tool="nasm"> -->
<!-- <description>TODO</description> -->
<!-- </directive> -->
<!-- <directive name=".ALIGN" tool="nasm"> -->
<!-- <description>TODO</description> -->
<!-- </directive> -->
<!-- <directive name=".NOPREFIX" tool="nasm"> -->
<!-- <description>TODO</description> -->
<!-- </directive> -->
Expand Down

0 comments on commit 789f77b

Please sign in to comment.