Hi - I'm new to asm programming and I get the subject error while trying to run the following program:
section .text ;Executable code hhere.
global_start ;For the linker (ld).
-start: ;Where execution begins.
mov eax, 4 ;Kernel call no.: write.
mov ebx, 1 ;Where to write: stdout.
mov ecx, message ;Location of string.
mov edx, message_length ;No. of chars to write.
int 0x80 ;Call the kernel!
mov eax, 1 ;Kernel call no.: exit.
int 0x80 ;Call the kernel!
section .data
message db "Assembly rules!", 10
message_length equ $ - message
I get error message after entering: nasm -f elf32 -o myfirst.o myfirst.asm
myfirst.asm:3: error: label or instruction expected at start of line
Any help will be appreciated.
jane@gdawg-Inspiron-530s ~ $ uname -a
Linux gdawg-Inspiron-530s 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 i686 i686 i386 GNU/Linux