NASM Not Working
Results 1 to 4 of 4

Thread: NASM Not Working

  1. #1
    Member
    Join Date
    Jun 2003
    Posts
    86

    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???
    You laugh because im different, i laugh because your all the same.

  2. #2
    Senior Member
    Join Date
    Nov 2003
    Posts
    107
    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.
    Is there a sum of an inifinite geometric series? Well, that all depends on what you consider a negligible amount.

  3. #3
    Member
    Join Date
    Jun 2003
    Posts
    86
    I did that, and now it says "bash: ./helloworld: cannot execute binary file"
    what should i do now??
    You laugh because im different, i laugh because your all the same.

  4. #4
    Member
    Join Date
    Jun 2003
    Posts
    86
    i figured out the problem... sorry...
    You laugh because im different, i laugh because your all the same.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •