Author Topic: compling program  (Read 9911 times)

Adam Campel

  • Guest
compling program
« on: July 02, 2009, 07:39:50 PM »
I've made a basic "Hello World" program that everyone does, i'm using notepad, and have installed NASM for windows. How do I get NASM to compile my program? I'm sure it's really simple and I'm just missing some obvious step.

Adam

nobody

  • Guest
Re: compling program
« Reply #1 on: July 03, 2009, 05:17:23 PM »
usage: nasm [-@ response file] [-o outfile] [-f format] [-l listfile]
            [options...] [--] filename

nobody

  • Guest
Re: compling program
« Reply #2 on: July 04, 2009, 07:28:38 PM »
I'm also having trouble making my program work. I'm using widows vista This is what I tried:
nasm -f obj first.asm
I have 'asm_io.inc' in my program, and nasm says that it can't open the include file. I don't know why it's not working, any help would be great.

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: compling program
« Reply #3 on: July 04, 2009, 08:34:16 PM »
"asm_io.inc" should be in the same directory as "first.asm"... and "asm_io.o" (".obj" for Windows, I guess). You'll also want "driver.c". You can have Nasm look elsewhere for include files with the "-I" switch - "nasm -f obj -I\path\to\my\incs\ first.asm" (note that the trailing backslash - or slash - is required!). I'd suggest you do it all in one directory, for now, although that directory will get pretty cluttered, pretty quick...

Once you've beaten Nasm into producing "first.obj", " -o first.exe driver.c first.obj asm_io.obj". (from memory) I hope you downloaded the examples that match the compiler you're using. The differences are very small, and could  be "fixed", but you'll save yourself a world of pain by getting the "right" one.

Best,
Frank