blob: 7d824c1f913f672784deb1cc4c0831853aa06645 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
global _start
section .data ; defines a section
msg db "Hello, x86 Assembly Language!", 0x0a
len equ $ - msg ; subtract the location before the message (msg) from the location after the message ($) to get the length
section .text
_start:
mov eax, 4 ; sys_write syscall
mov ebx, 1 ; stdout file descriptor
mov ecx, msg ; bytes to write
mov edx, len ; number of bytes to write
int 0x80 ; perform syscall
mov eax, 1 ; sys_exit syscall
mov ebx, 0 ; exit status 0
int 0x80 ; perform syscall
|