Welcome to our Blog. This is first post. Let’s try to write some code.
section .data
msg db ‘Hello, world!’, 0xA ; the message to print followed by a newline
len equ $ – msg ; calculate the length of the message
section .text
global _start ; entry point
_start:
; syscall: write(int fd, const void *buf, size_t count)
mov eax, 4 ; syscall number for sys_write
mov ebx, 1 ; file descriptor 1 = standard output (stdout)
mov ecx, msg ; address of the message buffer
mov edx, len ; length of the message
int 0x80 ; make the system call
; syscall: exit(int status)
mov eax, 1 ; syscall number for sys_exit
xor ebx, ebx ; set exit status to 0
int 0x80 ; make the system call