-
NASM Not Working
i wrote a simple hello world program in NASM and when i compiled it and tried to run it it said "permision denied". im running linux and the code follows:
section .data ;declare data here
msg db "Hello, World!!!", 0xa ;declare msg as the string 'hello, world!'
len equ $ - msg ;declare len as the length of msg
section .text ;declare code here
global _start ;declare where to start
_start:
;sys_write msg to stdout and stop writing at len
mov edx, len; length
mov ecx, msg; string
mov ebx, 1; stdout
mov eax, 4; sys_write
int 0x80; interupt 80h
mov ebx, 0;
mov eax, 1;
int 0x80; exit
when i compiled it i typed in
nasm helloworld.asm -o helloworld
what could be wrong???
-
Do you have permissions set so you can execute the file. Since you're the owner i'm assuming, just a quick chmod +x should do the trick for you.
-
I did that, and now it says "bash: ./helloworld: cannot execute binary file"
what should i do now??
-
i figured out the problem... sorry...