Assembly code:
section .text
global _start
_start:
mov eax, 4
mov ebx, 1
mov ecx, message
mov edx, message_len
int 0x80
section .data
message db "Hello, World!", 0x0a
message_len equ $-message
compiling code:
rm Lab.o
rm lab
nasm -f elf -F dwarf -g Lab.asm
ld -m elf_i386 -o lab Lab.o
This is a basic Hello World program (called Lab.asm
.)
When I compile the code and run it I get the following error:
Bad system call (core dumped)
.
I can't seem to find the core dump to do gdb debugging, and I've tried compiling it in different ways. Any ideas what is going wrong here?