org 100h mov bx,secbot ;place le nombre magique AA55h a la fin du add bx,1FEh ;premier secteur de la disquette mov ax,0AA55h mov [bx],ax mov ax,cs ;charge l'ancien secteur mov es,ax xor bp,bp mov bx,secbot+512 mov cx,1 xor dx,dx alfn: mov al,1 mov ah,2 int 13h jnc chpar inc bp cmp bp,3 jge errf jmp alfn chpar: ;recopie certain paramŠtres mov ax,cs mov ds,ax mov bx,baset boclll: mov al,[bx+512] mov [bx],al inc bx cmp bx,baset+27 jne boclll mov ax,cs ;charge le nouveau secteur mov es,ax xor bp,bp mov bx,secbot mov cx,1 xor dx,dx alft: mov al,1 mov ah,3 int 13h jnc fifn inc bp cmp bp,3 jge errf jmp alft errf: mov ah,9 mov dx,msg int 21h jmp fino fifn: mov ah,9 mov dx,msg2 int 21h fino: mov ax,4C00h ;fin int 21h msg: db "ERREUR !!$" msg2: db "C'EST FAIT$" secbot: ;c'est le secteur qui rempla‡era celui de la disquette jmp strb nop db "AMORC4 " ;3 baset: dw 512 ;11 db 1 ;13 dw 1 ;14 db 2 ;16 dw 0E0h ;? ;17 dw 2880 ;19 db 0F0h ;21 dw 9 ;? ;22 dw 12h ;? ;24 dw 2h ;? ;26 dd 0 ;? ;28 dd 0 ;? ;32 db 0 ;? ;36 db 0 ;37 db 29h ;38 dd 0FADABAFFh ;39 db "SYST BAZ" ;43 db "FAT12 " ;54 stra: ;62 db "fichier SYST.BAZ absent" strb: mov ax,7C0h mov ds,ax mov ax,2000h ;charge une FAT en 2000h:0000 mov es,ax xor si,si mov bp,[22] mov bx,1 bchf: call chcl dec bp inc bx add si,200h cmp bp,0 jne bchf mov ax,3000h ;charge repertoire racine en 3000h:0000 mov es,ax xor si,si mov bp,[17] mov ax,[22] mov cl,[16] mul cl inc ax mov bx,ax bchd: call chcl sub bp,16 inc bx add si,200h cmp bp,0 jne bchd ;***************************************** mov cx,[17] xor bx,bx testp: xor di,di boucp: mov al,[43+di] es mov ah,[bx+di] cmp al,ah jne rate inc di cmp di,11 je fin jmp boucp rate: add bx,32 dec cx cmp cx,0 je stop jmp testp stop: mov cx,23 mov si,62 call afmg nopp: nop jmp nopp fin: es mov ax,[bx+26] mov bx,ax ;***************************************** mov ax,5000h ;charge le fichier en 5000h:0000h mov es,ax xor si,si mov bp,[17] shr bp,4 mov ax,[22] mov cl,[16] mul cl dec ax add ax,bp bocharg: add bx,ax call chcl sub bx,ax call chnb cmp bx,0FF0h jge sauverfic add si,200h jmp bocharg sauverfic: mov ax,5000h ;chargement des segment mov ds,ax mov es,ax mov ax,9000h mov ss,ax xor ax,ax ;remise a zero des registre xor bx,bx xor cx,cx xor dx,dx xor si,si xor di,di xor bp,bp xor sp,sp ;reinitialisation de la pile jmp 5000h:0000h chnb: ;charge nø de FAT push ax ;entr‚e: bx=Nøde FAT push cx ;Sortie bx=Nøcontenue dans la FAT push dx push es mov ax,2000h mov es,ax shr bx,1 jc unns mov ax,bx mov cl,3 mul cl mov bx,ax es mov ax,[bx] mov bx,ax and bx,0FFFh jmp kirk unns: mov ax,bx mov cl,3 mul cl mov bx,ax inc bx es mov ax,[bx] mov bx,ax shr bx,4 and bx,0FFFh kirk: pop es pop dx pop cx pop ax ret chcl: ;bx=Nøcluster es:si=zone ou copier push ax push bx push cx push dx push bp push si mov cx,[24] mov ax,[26] mul cx mov cx,ax mov ax,bx xor dx,dx div cx mov bx,ax mov ax,dx mov cl,[24] div cl mov dh,al mov cx,bx xchg cl,ch shl cl,6 and cl,0C0h inc ah and ah,03Fh or cl,ah mov bp,5 mov bx,si alfq: mov al,1 mov ah,2 xor dl,dl int 13h jnc findec dec bp jnz alfq findec: pop si pop bp pop dx pop cx pop bx pop ax ret afmg: ;affiche message en ds:si cx=nb carac push ax push bx push si mov ah,0Eh mov bl,0Ah bome: mov al,[si] int 10h inc si dec cx jnz bome pop si pop bx pop ax ret vide: dd 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 dd 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0