.model small .code org 100h kronos: jmp body jumpfar db 0eah oldint dw 0,0 oldtime db "PETER2000",3 dup(0) message db "Tempo trascorso: ",0,0,3ah,0,0,3ah,0,0,0dh,0ah,24h body proc near mov ax,3550h int 21h mov di,bx add di,5 lea si,oldtime cld mov cx,9 repe cmpsb jne install mov ah,2ch int 21h sub dh,byte ptr es:[bx+14] sbb cl,byte ptr es:[bx+15] sbb ch,byte ptr es:[bx+16] cmp dh,0 jge minutes add dh,3ch minutes: cmp cl,0 jge hours add cl,3ch hours: cmp ch,0 jge store add ch,18h store: lea di,message+11h push es push es push cs pop es mov al,ch call decim mov al,cl call decim mov al,dh call decim lea dx,message mov ah,9 int 21h disinst: lea dx,oldint mov ax,2550h int 21h pop es mov es,es:[2ch] mov ah,49h int 21h pop es mov ah,49h int 21h int 20h install: mov cs:[oldint],bx mov bx,es mov cs:[oldint+2],bx push cs pop ds lea dx,jumpfar mov ax,2550h int 21h mov ah,2ch int 21h mov byte ptr cs:[oldtime+9],dh mov byte ptr cs:[oldtime+10],cl mov byte ptr cs:[oldtime+11],ch lea dx,message int 27h body endp decim proc near aam xchg ah,al add ax,3030h stosw inc di retn decim endp end kronos