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 86 87 88 89 90 91 92 93 94 95 96 97 98 99
| include libshow.inc
.386
data segment use16
msg1 db 'lecture heure',10,13,'$'
msg2 db 'erreur de lecture !',10,13,'$'
barre db ':','$'
heu db 0
min db 0
sec db 0
data ends
pile segment stack
db 256 dup(?)
pile ends
code segment use16
assume cs:code,ds:data,ss:pile
MainProc:
;initialise segment
mov ax,data
mov ds,ax
mov es,ax
push cx dx
mov ah,02h
int 1Ah
jc erreur
fonctionne:
;enregistrement des resustats
mov sec,dh
mov min,cl
mov heu,ch
lea dx,msg1
mov ah,09h
int 21h
;affiche l'heure
xor ax,ax
mov al,heu
mov cl,4
shr al,cl
ecrit_ent
mov al,heu
and al,00001111b
ecrit_ent
lea dx,barre
call affiche_string
;affiche la minute
xor ax,ax
mov al,min
mov cl,4
shr al,cl
ecrit_ent
mov al,min
and al,00001111b
ecrit_ent
lea dx,barre
call affiche_string
;affiche la seconde
xor ax,ax
mov al,sec
mov cl,4
shr al,cl
ecrit_ent
mov al,sec
and al,00001111b
ecrit_ent
pop dx cx
jmp quitter
affiche_string proc near
mov ah,09h
int 21h
ret
affiche_string endp
erreur:
lea dx,msg2
mov ah,09h
int 21h
quitter:
mov ah,4ch
int 21h
code ends
end MainProc |
Partager