Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .model tiny
- .code
- .186
- org 100h
- start proc near
- mov ax,351ch
- int 21h
- mov word ptr old_int1ch,bx
- mov word ptr old_int1ch+2,es
- mov ax,251ch
- mov dx,offset int1ch_handler
- int 21h
- ; программы код
- mov ah,1
- int 21h
- mov ax,251ch
- mov dx,word ptr old_int1ch+2
- mov ds,dx
- mov dx,word ptr cs:old_int1ch
- int 21h
- ret
- old_int1ch dd ?
- start_position dw 0
- start endp
- int1ch_handler proc far
- pusha
- push es
- push ds
- push cs
- pop ds
- mov ah,02h
- int 1ah
- jc exit_handler ; если часы заняты
- ; ал часы
- call bcd2asc
- mov byte ptr output_line[2],ah
- mov byte ptr output_line[4],al
- mov al,cl
- call bcd2asc
- mov byte ptr output_line[10],ah
- mov byte ptr output_line[12],al
- mov al,dh
- call bcd2asc
- mov byte ptr output_line[16],ah
- mov byte ptr output_line[18],al
- mov cx, output_line_1
- push 0b800h
- pop es
- mov di,word ptr start_position
- mov si,offset output_line
- cld
- rep movsb
- exit_handler:
- pop ds
- pop es
- popa
- jmp cs:old_int1ch
- bcd2asc proc near
- mov ah,al
- and al,0fh
- shr ah,4
- or ax,3030h
- ret
- endp
- output_line db ' ', 1fh, ' ', 1fh, '0', 1fh, 'h', 1fh
- db ' ', 1fh, '0', 1fh, '0', 1fh, ':', 1fh
- db '0', 1fh, '0', 1fh, ' ', 1fh
- output_line_1 equ $ - output_line
- int1ch_handler endp
- end start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement