Advertisement
Guest User

Untitled

a guest
Mar 30th, 2019
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .model tiny
  2. .code
  3. .186
  4. org 100h
  5.  
  6. start proc near
  7.       mov ax,351ch
  8.       int 21h
  9.       mov word ptr old_int1ch,bx
  10.       mov word ptr old_int1ch+2,es
  11.      
  12.  
  13.       mov ax,251ch
  14.       mov dx,offset int1ch_handler
  15.       int 21h
  16. ; программы код
  17.       mov ah,1
  18.       int 21h
  19.  
  20.       mov ax,251ch
  21.       mov dx,word ptr old_int1ch+2
  22.       mov ds,dx
  23.       mov dx,word ptr cs:old_int1ch
  24.       int 21h
  25.  
  26.       ret
  27.       old_int1ch dd ?
  28.       start_position dw 0
  29.  
  30.       start endp
  31.  
  32.       int1ch_handler proc far
  33.       pusha
  34.       push es
  35.       push ds
  36.       push cs
  37.       pop ds
  38.       mov ah,02h
  39.       int 1ah
  40.       jc exit_handler ; если часы заняты
  41.       ; ал часы
  42.  
  43.       call bcd2asc
  44.       mov byte ptr output_line[2],ah
  45.       mov byte ptr output_line[4],al
  46.  
  47.       mov al,cl
  48.  
  49.       call bcd2asc
  50.  
  51.       mov byte ptr output_line[10],ah
  52.       mov byte ptr output_line[12],al
  53.  
  54.       mov al,dh
  55.       call bcd2asc
  56.       mov byte ptr output_line[16],ah
  57.       mov byte ptr output_line[18],al
  58.  
  59.       mov cx, output_line_1
  60.       push 0b800h
  61.       pop es
  62.  
  63.       mov di,word ptr start_position
  64.       mov si,offset output_line
  65.       cld  
  66.       rep movsb
  67.  
  68.       exit_handler:
  69.       pop ds
  70.       pop es
  71.       popa
  72.       jmp cs:old_int1ch
  73.  
  74.       bcd2asc proc near
  75.             mov ah,al
  76.             and al,0fh
  77.             shr ah,4
  78.             or ax,3030h
  79.             ret
  80.             endp
  81.  
  82.  
  83.       output_line db ' ', 1fh, ' ', 1fh, '0', 1fh, 'h', 1fh
  84.                   db ' ', 1fh, '0', 1fh, '0', 1fh, ':', 1fh
  85.                   db '0', 1fh, '0', 1fh, ' ', 1fh
  86.        output_line_1 equ $ - output_line
  87.        int1ch_handler endp
  88.        end start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement