Author Topic: drpaulcarter.com help  (Read 41061 times)

Offline dstudentx

  • Jr. Member
  • *
  • Posts: 18
Re: drpaulcarter.com help
« Reply #15 on: February 16, 2010, 06:43:47 AM »
Thank you it seems to work but nothing happens.  shouldn't the code run? like when you use netbeans eclipse, when you run the prog.
[/URL][/img]
http://yfrog.com/5mscreenshottip

Offline Keith Kanios

  • Full Member
  • **
  • Posts: 383
  • Country: us
    • Personal Homepage
Re: drpaulcarter.com help
« Reply #16 on: February 16, 2010, 07:12:52 AM »
An IDE (e.g. Eclipse) and a Compiler are generally two different things.

You've just assembled, compiled and linked a program by running nasm and gcc, from the command line.

The next step is to run/execute the program itself: ./first

Offline srikwit

  • New Member
  • Posts: 1
Re: drpaulcarter.com help
« Reply #17 on: July 06, 2017, 09:24:39 PM »
You have no idea how much I appreciate the help.
been trying to load this dr paul carter code. with ubuntu (linux).
When i try

cl -o first first.o driver.c asm_io.o

I get this message

Unrecognized command line argument 'first.o

When I tried
nasm -f elf -dELF_TYPE asm_io.asm
nasm -f elf -dELF_TYPE first.asm
gcc -o first first.o driver.c asm_io.o

when I used
gcc -o first first.o driver.c asm_io.o
I got this message

/tmp/ccwFBbkM.o: In function 'main'
driver.c:(.text+0xa): undefined reference to 'asm_main'
collect2: ld returned l exit status

I loaded nasm through sudo and cl-launch
this is driving me crazy.

I renamed the functions in asm_io.asm(Linux) without the underscore which are being called(call _scanf is now call scanf) as well as defined those defined in the extern(extern _scanf is now extern scanf). After this it worked for me. :)

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: drpaulcarter.com help
« Reply #18 on: July 06, 2017, 10:57:30 PM »
Thanks for the help, srikwit. My understanding is that "-dELF_TYPE" on Nasm's command line is supposed to remove those underscores, but doing it "by hand" isn't too big a job if it's not working.

Best,
Frank