Author Topic: Little Problem Debian/Squeeze NASM  (Read 20505 times)

Offline Louce21

  • Jr. Member
  • *
  • Posts: 5
Little Problem Debian/Squeeze NASM
« on: April 13, 2012, 01:49:53 PM »
Good Afternoon,
I installed NASM version 2.08.01with apt-get on Debian/Squeeze 32bit x86 intel.
When i want to assemble the file "hello.asm", I get this: "nasm: fatal: unable to open input file `hello.asm'".
I am in the directory of the "hello.asm" :" and the executable is in /usr/bin.
I tried to assemble with different commands, but it processes always the same.
So now i hope you can help me. Thanks :)



Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: Little Problem Debian/Squeeze NASM
« Reply #1 on: April 13, 2012, 09:48:14 PM »
Mmmm... Permissions? Can you successfully edit and save your "hello.asm"? Strange. Maybe try a different file...

Best,
Frank

P.S. Nasm 2.10 is out - http://www.nasm.us - I don't think it'll help your problem, but several bugs have been fixed.


Offline Louce21

  • Jr. Member
  • *
  • Posts: 5
Re: Little Problem Debian/Squeeze NASM
« Reply #2 on: April 15, 2012, 12:46:08 PM »
Thank you Frank, But it is not working.
I installed the new version.... ./configure, etc....  and "mv nasm /usr/bin" --> NASM version 2.10 compiled on Apr 15 2012
I tried to assemble as root.... Both suggestions not working.
By the way, i use the Oracle-Virtual-Machine: Debian/Squeeze as host and quest. But i think it doesn't matter. :)

Offline Keith Kanios

  • Full Member
  • **
  • Posts: 383
  • Country: us
    • Personal Homepage
Re: Little Problem Debian/Squeeze NASM
« Reply #3 on: April 15, 2012, 02:07:57 PM »
You can use ./autoconf.sh && ./configure && make && sudo make install for a full build and install.

Try assembling using the full path to hello.asm, e.g. nasm -f elf -o hello.o /home/louce21/hello.asm

Offline Louce21

  • Jr. Member
  • *
  • Posts: 5
Re: Little Problem Debian/Squeeze NASM
« Reply #4 on: April 15, 2012, 08:31:00 PM »
Thanks, but I build and installed it like you wrote, except ./autoconf.sh: bash: ./autoconf.sh: No such file or directory.
I already used the absolute path in the prompt, but it doesn't work.

Offline Keith Kanios

  • Full Member
  • **
  • Posts: 383
  • Country: us
    • Personal Homepage
Re: Little Problem Debian/Squeeze NASM
« Reply #5 on: April 16, 2012, 01:27:18 AM »
Thanks, but I build and installed it like you wrote, except ./autoconf.sh: bash: ./autoconf.sh: No such file or directory.

Whoops. It's actually ./autogen.sh, so ./autogen.sh && ./configure && make && sudo make install in total.

I already used the absolute path in the prompt, but it doesn't work.

Is the exact name of the file hello.asm, in that exact casing, not possibly Hello.asm or something else with uppercase letters?

Offline Louce21

  • Jr. Member
  • *
  • Posts: 5
Re: Little Problem Debian/Squeeze NASM
« Reply #6 on: April 16, 2012, 02:23:55 PM »
Oh okay :) Thanks! ^^
Now it says:
Code: [Select]
Programms/nasm-2.10# ./autogen.sh
                           + autoheader
                            ./autogen.sh: 1: autoheader: not found

Do you have an idea?
And i am sure that I have spelled all right. :)

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: Little Problem Debian/Squeeze NASM
« Reply #7 on: April 16, 2012, 10:44:24 PM »
Well... you could install autoheader... but you shouldn't need that stuff in autogen.sh unless you've done a "make spotless". Just "./configure" and (I like) "make install_everything" (as root) should do it.

Nasm "seems" to be installed correctly right from the beginning. I think something's "wrong" with your hello.asm. Can you do "cat hello.asm"? (or some other indication that something can open hello.asm?) Very puzzling that, if this file exists and has reasonable permissions, Nasm can't open it!

I'm not familiar with the "virtual machine" part. Do you need to "mount" the directory? I ASSume that if you can see it Nasm should be able to open it, but maybe there's some problem with that(?).

"The first days are the hardest days..." - Grateful Dead

Best,
Frank


Offline Louce21

  • Jr. Member
  • *
  • Posts: 5
Re: Little Problem Debian/Squeeze NASM
« Reply #8 on: April 18, 2012, 05:03:18 PM »
First, Thank you for your patience with me :)
I can't cat the files firstp.asm and hello.asm:
Quote
/assembler$ cat hello.asm
cat: hello.asm: No such file or directory
for example.
The code of both is from tutorials in the internet for example wikipedia: https://de.wikibooks.org/wiki/Assembler
The content from hello.asm:
Code: [Select]
SECTION .data ; data section
msg: db "Hello World",10 ; the string to print, 10=cr
len: equ $-msg ; "$" means "here"
; len is a value, not an address

SECTION .text ; code section
        global main ; make label available to linker
main: ; standard  gcc  entry point

mov edx,len ; arg3, length of string to print
mov ecx,msg ; arg2, pointer to string
mov ebx,1 ; arg1, where to write, screen
mov eax,4 ; write command to int 80 hex
int 0x80 ; interrupt 80 hex, call kernel

mov ebx,0 ; exit code, 0=normal
mov eax,1 ; exit command to kernel
int 0x80 ; interrupt 80 hex, call kernel

and of firstp.asm:
Code: [Select]
org 100h
start:
mov ax, 5522h
        mov cx, 1234h
        xchg cx,ax
        mov al, 0
        mov ah,4Ch
        int 21h
:D

Offline puttyios

  • Jr. Member
  • *
  • Posts: 26
Re: Little Problem Debian/Squeeze NASM
« Reply #9 on: June 16, 2012, 01:28:45 PM »
what is the tool  you use to  write the asm file?  vi ? or other ?