Fichier

RM50Man Messages postés 314 Date d'inscription mercredi 1 novembre 2000 Statut Membre Dernière intervention 20 août 2006 - 5 juin 2005 à 16:50
ShareVB Messages postés 2676 Date d'inscription vendredi 28 juin 2002 Statut Membre Dernière intervention 13 janvier 2016 - 3 juil. 2005 à 10:51
Je lis dans un fichier et je reecris ce que g lu dans l autre, mais ca ne m ecrit pas dans le nouveau fichier ce que g lu ds l autre fichier !!!!
Si quelqu un peut m aider merci!!!!!

.386


data segment public
buffer db 64000 dup(?)
data ends


code segment


assume cs:code , ds:code, ss:code


start:


;créer fichier par le handle
mov ah, 3ch
xor cx, cx
mov dx, offset nom_fichier
int 21h


xor dx, dx


;stocke le handle
mov word ptr [handle2], ax


;ouvrir fichier
mov ah, 3dh
mov dx, offset image
mov al, 1 ;lecture
int 21h


;stocke le handle
mov word ptr [handle], ax


;lecture fichier
mov ah, 3fh
mov bx, word ptr [handle]
mov cx, 10
xor dx, dx
mov dx, offset buffer1


int 21h


;ecriture dans le fichier
mov bx, word ptr[handle2]
mov cx, 10
xor dx, dx
mov dx, ax
mov ah, 40h
int 21h



mov ax, 3eh
mov bx, word ptr[handle]
int 21h


mov ax, 3eh
mov bx, word ptr[handle2]
int 21h


ret


image db "image.txt", 0
handle dw ?
handle2 dw ?
buffer1 db 64000 dup(?)
nom_fichier db "image2.txt",0


code ends


end start

RM50man

1 réponse

ShareVB Messages postés 2676 Date d'inscription vendredi 28 juin 2002 Statut Membre Dernière intervention 13 janvier 2016 26
3 juil. 2005 à 10:51
salut,


data segment
image db "image.txt", 0

handle dw ?

handle2 dw ?

buffer1 db 64000 dup(?)

nom_fichier db "image2.txt",0

data ends



code segment

assume cs:code , ds:data ;pas besoin de pile



start:


;init ds


mov ax,data

mov ds,ax



;créer fichier par le handle
mov ah, 3ch
xor cx, cx
mov dx, offset nom_fichier
int 21h


;stocke le handle
mov word ptr [handle2], ax



;ouvrir fichier
mov ah, 3dh
mov dx, offset image
mov al, 1 ;lecture
int 21h



;stocke le handle
mov word ptr [handle], ax



;lecture fichier
mov ah, 3fh
mov bx, word ptr [handle]
mov cx, 10
mov dx, offset buffer1



int 21h



;ecriture dans le fichier
mov bx, word ptr[handle2]
mov cx, 10
mov dx, offset buffer1
mov ah, 40h
int 21h




mov ax, 3eh
mov bx, word ptr[handle]
int 21h



mov ax, 3eh
mov bx, word ptr[handle2]
int 21h



mov ah,4Ch

mov al,0

int 21h




code ends


end start

ShareVB
0
Rejoignez-nous