Author Topic: ..start unrecognized symbol  (Read 21546 times)

Offline shbk

  • Jr. Member
  • *
  • Posts: 2
..start unrecognized symbol
« on: January 01, 2011, 09:52:56 AM »
i wrote programs using nasm two weeks ago. i use ubuntu and use nasm under dosbox. two weeks ago all was right.
but now, when i tryied to  write new code , f.e. :
Code: [Select]
segment code

..start:
 
 retf
 

i receive error   58: unrecognized symbol '..start'
 what is this???   i tryed re-compile my old programs what worked earlier, but i !!! receive similar error.

if i write:
Code: [Select]
segment code

start:
 
 retf
 

it works but don't produce .obj file.
What did happen?
« Last Edit: January 01, 2011, 06:00:11 PM by shbk »

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: ..start unrecognized symbol
« Reply #1 on: January 01, 2011, 12:55:16 PM »
"..start" is a special symbol known only to "-f obj" output format. What command line are you giving Nasm?

For Ubuntu (native, not for dosbox), you'd probably want to use something like:

Code: [Select]
; nasm -f elf32 myprog.asm
; ld -o myprog myprog.o

global _start

section .text

; code (subroutines) can go here, if you like

_start:
; your code will begin execution here

; do your thing

; don't forget to exit back to shell!
mov bl, 42 ; return 42 - "echo $?" to see it
mov eax, 1
int 80h

But for dosbox, whatever you were doing should still work. The problem is almost certainly in the command line you're giving Nasm. Did you, by any chance, have an environment variable set in a previous session that's not set now? Pretty sure Nasm doesn't have a "Y2011 bug". :)

Get back to us if you can't solve it!

Best,
Frank


Offline shbk

  • Jr. Member
  • *
  • Posts: 2
Re: ..start unrecognized symbol
« Reply #2 on: January 01, 2011, 06:02:51 PM »
ooowww ... my stupid head.  i should write   
  n -f obj name_file.asm     instead of n name_file.asm
   thanks you