1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
|
code segment
assume cs:code
assume ds:data
assume ss:pile
debut:
xor cx, cx
mov cl, es:[80h]
cmp cl, 0
jne @ParametreOk
mov ax, data
mov ds, ax
mov dx, offset AucunPara
mov ah, 09h
int 21h
jmp @Fin
@ParametreOk:
mov ax,data
mov es,ax
mov si, 81h
mov di, offset Parametre
cld
@RecupPara:
lodsb
cmp al, ' '
jnbe @AucunEspace
cmp al,0Dh ; la touche [Enter] vaut en ASCII 0Dh puis 0Ah
je @fini_de_lire_param
jmp @RecupPara
@AucunEspace:
stosb
loop @RecupPara
@fini_de_lire_param:
xor al,al ; al = 0
stosb
mov al,'$'
stosb
;;;;;;;;
mov ax,data
mov ds,ax
mov dx, offset Parametre
mov ah, 09h
int 21h
;;;;;;;;
mov dx, offset Parametre
mov ah, 3dh
mov al, 0
int 21h
jnc @HandleValide
mov dx, offset ErreurFil
mov ah, 09h
int 21h
jmp @Fin
@HandleValide:
;;;;;;;;
mov dx, offset good
mov ah, 09h
int 21h
;;;;;;;;
@Fin:
mov ah, 4ch
int 21h
code ends
data segment
;;;;;;;;
Good DB 'Fichier trouve et ouvert$'
;;;;;;;;
AucunPara DB 'Debug un fichier executable',10,13,10
DB 'Debug [NomFichier]',10,'$'
ErreurFil DB 'Fichier ou non de chemin invalide','$'
Parametre DB 128 dup (0)
data ends
pile segment stack
remplissage db 256 DUP (?)
pile ends
end debut |
Partager