Nasm in Linux + Bach files

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Profetas

Nasm in Linux + Bach files

Post by Profetas »

I have just started using Linux and I am trying to create what would be a bat file in dos my bat file in dos has the following syntax
Nasm –f bin %1.asm –o %1.com
How can I create that in Linux??

In dos I can compile asm to com and run the com file,
Which command should I use to compile it in Linux so I would be able to run it?

I have been facing some strange problem with nasm,
I have created a simple program that print a string in the monitor but when I run this program it will print the string and a lot of strange characters what could that be??
Jamethiel

RE:Nasm in Linux + Bach files

Post by Jamethiel »

To create your "bach file", properly known as a "shell script", try the following:

echo "#!/bin/sh" > foo.sh
echo "nasm -f bin $1.asm -o $1.com" >> foo.sh
chmod +x foo.sh

To create a Linux program entirely in assembly is what we refer to as a 'pain in the @$$'. There are HOWTO guides for it. I recommend you look for the 'Linux Assembly HOWTO'.

Your strange problem is caused by a bug. If you could be more specific as to how the program works, we can be more specific as to what the bug is.

--Jamethiel
profetas

RE:Nasm in Linux + Bach files

Post by profetas »

thanks ,about the bug I have already solved, i just had to specify the origem.
Post Reply