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 authored and WillLillis committed Jan 2, 2025
1 parent c350daa commit 87aa183
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ git repository.

- MASM and NASM directives sourced from the [asm-dude](https://github.com/HJLebbink/asm-dude)
Visual Studio extension project. Additions sourced from [Microsoft](https://learn.microsoft.com/en-us/cpp/assembler/masm/directives-reference?view=msvc-170)
and [NASM](https://www.nasm.us/xdoc/2.13.03/html/nasmdoc0.html) documentation.
and other [NASM](https://www.nasm.us/xdoc/2.13.03/html/nasmdoc0.html) [documentation](https://www.nasm.us/xdoc/2.16.03/html/nasmdoc7.html).

- ARM instruction documentation builds on top of ARM's official [Exploration tools documentation](https://developer.arm.com/Architectures/A-Profile%20Architecture#Downloads)

Expand Down
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 87aa183

Please sign in to comment.