Assembly – Hello World – Variation 2

email me

Tested in Windows 10, with NASM v2.14.02.

; ----------------------------------------------------------------------------------------
; INFORMATION
; MrNetTek
; Check Prime Number
; eddiejackson.net/blog
; 3/10/2020
; free for public use
; free to claim as your own
;
; DOWNLOAD
; https://www.nasm.us/pub/nasm/releasebuilds/2.14.02/win64/
;
; SAVE AS
; hello2.asm
;
; COMPILE
; nasm -fwin64 hello2.asm && gcc -o hello2.exe hello2.obj && hello2
; ----------------------------------------------------------------------------------------

bits 64
default rel

SECTION .data					
    MSG	db      "Hello, World!",0		

EXTERN  puts

SECTION .text
GLOBAL main
main:
        SUB     RSP, 28h                        ; reserve shadow space
        MOV     RCX, MSG                        ; address of msg
        CALL    puts                            ; display msg
        ADD     RSP, 28h                        ; delete shadow space
        RET