NASM - The Netwide Assembler
NASM Forum => Using NASM => Topic started by: Louce21 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 :)
-
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.
-
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. :)
-
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
-
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.
-
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?
-
Oh okay :) Thanks! ^^
Now it says: 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. :)
-
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
-
First, Thank you for your patience with me :)
I can't cat the files firstp.asm and hello.asm: /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: 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: org 100h
start:
mov ax, 5522h
mov cx, 1234h
xchg cx,ax
mov al, 0
mov ah,4Ch
int 21h
:D
-
what is the tool you use to write the asm file? vi ? or other ?