0

Hello guys, am an assembly rookie.

Wrote this code in notepad++
section .text
global_start ;must be declared for linker (ld)

_start: ;tells linker entry point
mov edx,len ;message length
mov ecx,msg ;message to write
mov ebx,1 ;file descriptor (stdout)
mov eax,4 ;system call number (sys_write)
int 0x80 ;call kernel

mov eax,1 ;system call number (sys_exit)
int 0x80 ;call kernel

section .data
msg db 'Hello, world!', 0xa ;our dear string
len equ $ - msg ;length of our dear string

After trying to assemble it with these commands:
nasm -f elf32 ass.asm
nasm -o ass ass.o

Throws an error:
ass.o.:1: error: label or instruction expected at start of line

How can I solve it please?
Am using NASM on a 32bit windows 7 machine.
Thanks.

2
Contributors
2
Replies
9
Views
1 Year
Discussion Span
Last Post by rproffitt
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.