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
| .386
.model small
.stack 100h
.data
phrase db 10,13,"Nous avons besoin de l'age de 20 individus pour commencer$"
phrase1 db 10,13,"Entrez l'age:$"
tabealu db 20 dup (0)
.code
main proc
mov ax,@data
mov ds,ax
mov dx,offset phrase
mov ah,09h
int 21h
mov dx,offset phrase1
mov ah,09h
int 21h
mov bx,0
mov ax,0
boucle:
mov byte ptr[ds:tableau+bx],01h
inc bx
cmp ax,19
jne boucle
mov ax,0
boucle2:
mov dl,byte ptr [ds:tableau+bx]
inc bx
cmp ax,19
jne boucle2
mov ax,4c00h
int21h
Maximum proc uses bx cx dx, \
a:ptr, \
n:dword
mov bx,a
mov cx,0
mov ax,[bx]
while1:
cmp cx,n
jge endwhile1
if_1:
mov dx,[bx+4*cx]
cmp dx,ax
jle endif_1
mov ax,[bx+4*cx]
endif_1:
inc cx
jmp while1
endwhile1:
ret
Maximum endp
end maximum
sum:
mov ebx,tableau
mov dx,0
mov ecx,sizeof tableau
lp:
add,dl[ebx]
jnc next
inc dh
next:
inc ebx
loop lp
shr dx, cl
int21h
main endp
end main |
Partager