views:

116

answers:

1

Hello,I study assembly on High-school and I would like to try to make assembly programs at home.
I downloaded NASM but I don't understand how to run the .s files with it - if you can write a simple way here to run it I'd glad :-)

and in addition I have a question: when I use ADC for exmaple: AL = 01 and BL = 02, and CF = 1, when I make this: ADC AL,BL Will AL be 3 or 4? (with the CF addition or without?)

Thank you!!

+1  A: 

From your command prompt (bash for Linux):

nasm myasm.s -o myasm.bin -f bin

This is the basic command line structure. I don't know which OS you are writing on, but for Linux use:

nasm -h  // (I believe, or --help)

for a list of command parameters.

Anyway, the -o tells nasm what the output file is, and the -f tells nasm what the format is. In this example, we are simply writing a flat binary.

For a lot more information see Compiling an assembly program...

For more information on using ADC, see this question.

dboarman
nasm -hf to see the list of the available output formats.Mainly, nasm -f win32 for Windows, nasm -f elf for Linux, and nasm -f macho for OSX.
Macmade