nasm code example

Example 1: nasm assembler

<h1>Netwide Assembler</h1>
<!--Assembler for the machine language or assembly language-->
The Netwide Assembler is an assembler and disassembler for the 
Intel x86 architecture. It can be used to write 16-bit, 32-bit 
and 64-bit programs. NASM is considered to be one of the most popular assemblers for Linux

Example 2: nasm

; ----------------------------------------------------------------------------
; helloworld.asm
;
; This is a Win32 console program that writes "Hello, World" on one line and
; then exits.  It needs to be linked with a C library.
; ----------------------------------------------------------------------------

    global  _main
    extern  _printf

    section .text
_main:
    push    message
    call    _printf
    add     esp, 4
    ret
message:
    db  'Hello, World', 10, 0

Tags:

Misc Example