NASM - The Netwide Assembler
NASM Forum => Using NASM => Topic started by: shbk 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. :
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:
segment code
start:
retf
it works but don't produce .obj file.
What did happen?
-
"..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:
; 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
-
ooowww ... my stupid head. i should write
n -f obj name_file.asm instead of n name_file.asm
thanks you