Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old Dec 24, 2012, 02:58 PM   #1
Bloupies
macrumors newbie
 
Join Date: Dec 2012
NASM et mac os ( french man sorry )

Good evening

I apologize beforehand, I am French. It has been several days since I look for solutions concerning NASM and mAC bone, but I find only the English forums..

I am thus on mac bone and I would like to compile a program assembler

For exemple :

Code:
%include "iut.inc" 
segment .text 
global start 

start:
	mov 	eax, msg_Accueil
	call 	write_string

	mov 	eax,msg_Nombre
	call 	write_string

	call 	read_int
	mov 	ebx,eax
	
	mov 	eax,msg_Base
	call 	write_string

	call 	read_int
	mov		ecx,eax

	call 	SousProg	;APPEL DU SOUS PROGRAMME
	mov		edx,eax
	
	mov 	eax, msgResultat
	call	write_string
		
	mov 	eax, ebx
	call	write_int
		
	mov 	eax, msgResultat1
	call	write_string
	
	mov		eax, ecx
	call	write_int
		
	mov 	eax, msgResultat2
	call	write_string

	mov		eax, edx
	call	write_int
		
	ret

SousProg:
	;EMPILEMENT DES REGISTRES UTILISES
	push	ebx
	push	ecx
	;TRAITEMENT
	

	mov 	ebx,1312
	mov 	ecx,5476
	
	mov		eax,45
	;FIN DU TRAITEMENT
	;J'AI MODIFIE LA VALEUR DE ebx ET DE ecx POUR LES BESOINS DU TRAITEMENT
	
	;RESTAURATION DES REGISTRES UTILISES
	pop		ecx
	pop		ebx
	ret
		
segment .data

msg_Accueil:	db	"Convertion d'un nombre en base b en decimal",10,0
msg_Nombre:		db	"Saissez le nombre a convertir",10,0
msg_Base:		db	"Saissez la base du nombre",10,0
msgResultat:	db	10,"le resultat de la convertion du nombre ",0
msgResultat1	db	" en base ",0
msgResultat2	db	" en decimal est ",0

In class, to I was told that to compile under Linux, it was necessary to make:

Code:
nasm f elf exemple.asm
gcc o exemple exemple.o L. lIUT -lncurses -lpanel
And have librairies : iut.int , libIUT.a

So , when i do
Code:
 nasm -v
in terminal , it's said :
Code:
NASM version 0.98.40 (Apple Computer, Inc. build 11) compiled on Aug  4 2012
So , i try to compile :

Code:
MacBook-Pro-de-Rebouh:Assembleur rebouhaymen$ nasm -f elf Ex_SousP_Pile.asm
MacBook-Pro-de-Rebouh:Assembleur rebouhaymen$ gcc -o Ex_SousP_Pile Ex_SousP_Pile.o -L. -lIUT -lncurses -lpanel
ld: warning: ld: warning: ignoring file ./libIUT.a, file was built for archive which is not the architecture being linked (x86_64): ./libIUT.aignoring file Ex_SousP_Pile.o, file was built for unsupported file format ( 0x7f 0x45 0x4c 0x46 0x 1 0x 1 0x 1 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 0x 0 ) which is not the architecture being linked (x86_64): Ex_SousP_Pile.o

Undefined symbols for architecture x86_64:
  "_main", referenced from:
      start in crt1.10.6.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
MacBook-Pro-de-Rebouh:Assembleur rebouhaymen$
Can you help me ? Thanxs you so much ..
Bloupies is offline   0 Reply With Quote

 
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
"Utter French!" : new French pronunciation app javamex iPhone and iPod touch Apps 4 Jul 30, 2014 11:18 AM
french site annonce that the graphic cards of the new mac pro are on daughter cards fhenry Mac Pro 15 Oct 27, 2013 10:46 AM
Can someone Upload the built-in French Dictionary in mac os x Aze300 OS X 3 Jan 9, 2013 05:02 PM

Forum Jump

All times are GMT -5. The time now is 03:11 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC