forked from uia-worker/is105-lab3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hellow.asm
18 lines (17 loc) · 851 Bytes
/
hellow.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
; ----------------------------------------------------------------------------------------
; This is a Win64 console program that writes "Hello" on one line and then exits. It
; uses puts from the C library. To assemble and run:
;
; nasm -fwin64 hello.asm && gcc hello.obj && a
; ----------------------------------------------------------------------------------------
global main
extern puts
section .text
main:
sub rsp, 28h ; Reserve the shadow space
mov rcx, message ; First argument is address of message
call puts ; puts(message)
add rsp, 28h ; Remove shadow space
ret
message:
db 'Hello', 0 ; C strings need a zero byte at the end