Hello,

I want to display content of a file with the name has been entered by the user, but I have to enter the name of the file when I run the program (eg:. / myprogram test.asm). I would not have to specify the file name each time you run, but whether the user to do so when prompted for the name. I said that reading and viewing work properly. That's what I've done so far:

segment .data
nom_fichier : db "Entrez le nom du fichier : ", 10
nom_fichier_len equ $-nom_fichier
bufsize dw 1024

segment .bss
fichier resb 32
buf resb 1024
;; Message qui demande Ã* l'utilisateur d'entrer un nom de fichier
mov eax, 4
mov ebx, 1
mov ecx, nom_fichier
mov edx, nom_fichier_len
int 0x80

;; Lecture nom du fichier
mov eax, 3
mov ebx, 0
mov ecx, fichier
mov edx, 32
int 0x80

; get the filename in ebx
pop ebx
pop ebx
pop ebx
pop ebx

; ouvrir le fichier
mov eax, 5 ; ouverture
mov ecx, 0 ; lecture seulement
int 80h
; lire le fichier
mov eax, 3 ; lecture
mov ebx, eax ; descripteur
mov ecx, buf ; *buf,
mov edx, bufsize ; *bufsize
int 80h

; afficher le contenu Ã* l'écran
mov eax, 4 ; affiche Ã* l'écran
mov ebx, 1
int 80h

thanks