Rechercher dans ce blog

samedi 5 mars 2011

TP3


pile segment para stack
dw 256 dup(?)
pile ends

data segment para
msg1 db "bonjour",'$'
msg2 db "l'affichage c'est terminer",'$'
msg_choix db " pour fermer le programme appuyer sur et pour continuer appuyer sur : ","$"
data ends

code segment para
assume cs:code,ds:data,ssile

start proc far
push cs
pop ds
mov ax,2523h
mov dx,offset ctrl_break
int 21h
mov ax,data
mov ds,ax
xor cx,cx
affiche_bonjour:
mov ah,09h
mov dx,offset msg1
int 21h
inc cx
cmp cx,32000
jle affiche_bonjour
mov ah,09h
mov dx,offset msg2
int 21h
fin:
mov ax,4c00h
int 21h
start endp

ctrl_break proc far
push ds
mov ax,data
mov ds,ax
choix:
mov ah,09h
mov dx,offset msg_choix
int 21h
mov ah,1
int 21h
cmp al,'n'
je continue
cmp al,'y'
je  fin:
jmp choix
continue:
pop ds
iret
ctrl_break endp

code ends
end start

Aucun commentaire:

Enregistrer un commentaire