%include "asm_io.inc"
;
; initialized data is put in the .data segment
;
%define N 100
	
segment .data
chaine db "TOTO"	
format db "%x",0
	
;
; uninitialized data is put in the .bss segment
;
segment .bss



;
; code is put in the .text segment
;
segment .text
        global  asm_main
	extern printf
asm_main:
        enter   0,0               ; mise en place 
        pusha
	mov ebp,esp
	mov ebx,[chaine]
boucle: mov eax,[ebp]
	cmp eax,ebx
	je fin
	inc ebp
	jmp boucle

	
fin:    push ebp
	push format
	call printf
	pop eax
	pop eax
        popa
        mov     eax, 0            ; retour vers le C
        leave                     
        ret


