home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c007 / 23.ddi / CV10.SRC / GET1.ASM < prev    next >
Encoding:
Assembly Source File  |  1993-04-18  |  35.8 KB  |  1,846 lines

  1. CCode        equ [bp+18]
  2. FileIndex    equ [bp+20]
  3. FileHandle    equ [bp+22]
  4. BitWidth    equ [bp+24]
  5. BitHeight    equ [bp+26]
  6. public          _GetDOTS
  7. recovery        segment    byte public 'CODE'
  8.         assume    cs:recovery, ds:recovery
  9.  
  10. data_3        dw    80h            ; Data table (indexed access)
  11.         db     60h, 00h, 60h, 00h, 60h, 00h
  12.         db     60h, 00h, 80h, 00h, 80h, 00h
  13.         db     80h, 00h, 60h, 00h, 80h, 00h
  14.         db     60h, 00h, 80h, 00h, 80h, 00h
  15.         db     80h, 00h, 80h, 00h, 80h, 00h
  16.         db     60h, 00h, 60h, 00h, 60h, 00h
  17.         db     60h, 00h, 60h, 00h, 60h, 00h
  18.         db     00h, 01h, 00h, 01h, 00h, 01h
  19.         db     00h, 01h, 00h, 01h, 80h, 00h
  20.         db     00h, 01h, 00h, 01h
  21. data_4        dw    0
  22. data_6        dw    0
  23. data_7        dw    0
  24. data_8        dw    0
  25. data_9        dw    0
  26. data_10        dw    0
  27. data_11        dw    0
  28. data_12        dw    0
  29.         db    0, 0
  30. data_13        dw    0
  31. data_14        dw    0
  32.  
  33. ;**************************************************************************
  34. ;                                                                         *
  35. ;                       External Entry Point                              *
  36. ;**************************************************************************
  37.  
  38. _GetDOTS    proc    far
  39.         push    bp
  40.         push    ds
  41.         push    es
  42.         push    si
  43.         push    di
  44.         push    bx
  45.         push    cx
  46.         mov     bp,sp
  47.         mov     ax,CCode
  48.         mov    bx,100
  49.         div    bx
  50.         mov    bh,al
  51.         mov    bl,dl
  52.         add    bx,0a0a0h
  53.         mov     cx,BitHeight      ;3--height of font
  54.         mov     si,0
  55.         mov    ax,cs
  56.         mov    ds,ax
  57.         mov    es,ax
  58.         mov    dx,FileHandle
  59.         mov    data_55,dx
  60.         mov    data_51,0
  61.         mov     dx,FileIndex      ;6--index number
  62.         xchg dh,dl                    ;?????
  63.         mov     ax,BitWidth      ;5--width of font
  64.         mov     bp,ax
  65.         jmp    loc_1      ;????
  66.         mov     ax,0
  67.         mov     es,ax
  68.         mov     di,0
  69. here:                                   ;There are two output data.
  70. ;        mov     ax,es           ;1--seg address of output buffer
  71. ;        mov     dx,ax
  72. ;        mov     ax,di           ;2--offset address of output buffer
  73.  
  74.         mov ax,di
  75.         mov dx,es
  76.  
  77.         pop     cx
  78.         pop     bx
  79.         pop     di
  80.         pop     si
  81.         pop     es
  82.         pop     ds
  83.         pop     bp
  84.         retf                ; Routine  return
  85. _GetDOTS        endp
  86.  
  87. loc_1:
  88.         xor    dl,dl
  89.         nop    ; Zero register
  90.         xchg    dh,dl
  91.         xchg    dx,bx
  92.         mov    ax,bp
  93.         mov    bp,si
  94.         mov    bp,0
  95.         mov    si,1
  96.         mov    di,cx
  97.         cld                ; Clear direction
  98.         or    dx,dx            ; Zero ?
  99.         jnz    loc_2            ; Jump if not zero
  100.         mov    dx,cs
  101.         mov    bx,offset data_56
  102.         jmp     here                ; Routine return
  103. loc_2:
  104.         push    ds
  105.         push    es
  106.         push    cs
  107.         pop    ds
  108.         push    cs
  109.         pop    es
  110.         or    ax,ax            ; Zero ?
  111.         jnz    loc_3            ; Jump if not zero
  112.         jmp    loc_22
  113. loc_3:
  114.         or    cx,cx            ; Zero ?
  115.         jnz    loc_4            ; Jump if not zero
  116.         jmp    loc_22
  117. loc_4:
  118.         cmp    ax,140h
  119.         jb    loc_5            ; Jump if below
  120.         mov    ax,140h
  121. loc_5:
  122.         cmp    cx,140h
  123.         jb    loc_6            ; Jump if below
  124.         mov    cx,140h
  125. loc_6:
  126.         test    bp,1800h
  127.         jz    loc_7            ; Jump if zero
  128.         shr    ax,1            ; Shift w/zeros fill
  129. loc_7:
  130.         mov    data_6,cx
  131.         mov    data_4,ax
  132.         mov    data_7,si
  133.         mov    data_8,di
  134.         mov    data_9,bx
  135.         or    dh,dh            ; Zero ?
  136.         jnz    loc_8            ; Jump if not zero
  137.         jmp    short loc_12
  138.         
  139. loc_8:
  140.         sub    dx,0A0A0h               ;????
  141.         xor    ax,ax            ; Zero register
  142.         xor    cx,cx            ; Zero register
  143.         xor    bx,bx            ; Zero register
  144.         dec    dh
  145.         dec    dl
  146.         mov    al,dh
  147.         mov    cl,dl
  148.         cmp    dh,0Fh
  149.         jb    loc_9            ; Jump if below
  150.         sub    ax,0Fh
  151.         add    data_9,1
  152.         jmp    short loc_10
  153.  
  154. loc_9:
  155.         mov    data_9,0
  156. loc_10:
  157.         mov    bx,data_9
  158.         shl    bx,1            ; Shift w/zeros fill
  159.         mov    bx,data_3[bx]
  160.         mov    data_13,bx
  161.         mov    data_14,bx
  162.         mov    bx,5Eh
  163.         mul    bx            ; dx:ax = reg * ax
  164.         add    ax,cx
  165.         call    sub_2
  166.         jc    loc_11            ; Jump if carry Set
  167.         call    sub_4
  168.         jmp    short loc_18
  169.         
  170. loc_11:
  171.         mov    data_65,0
  172.         jmp    short loc_18
  173.         
  174. loc_12:
  175.         cmp    bx,2
  176.         jb    loc_13            ; Jump if below
  177.         mov    data_9,0
  178. loc_13:
  179.         sub    dl,21h            ; '!'
  180.         mov    cx,dx
  181.         mov    ax,data_9
  182.         mov    bx,5Eh
  183.         mul    bx            ; dx:ax = reg * ax
  184.         add    ax,34Eh
  185.         add    ax,cx
  186.         mov    data_9,0
  187.         mov    bx,data_3
  188.         mov    data_13,bx
  189.         push    ax
  190.         mov    ax,data_13
  191.         shr    ax,1            ; Shift w/zeros fill
  192.         mov    data_14,ax
  193.         cmp    cl,7Eh            ; '~'
  194.         jbe    loc_14            ; Jump if below or =
  195.         pop    ax
  196.         jmp    short loc_15
  197.         
  198. loc_14:
  199.         pop    ax
  200.         call    sub_2
  201.         jc    loc_15            ; Jump if carry Set
  202.         call    sub_4
  203.         jmp    short loc_16
  204.         
  205. loc_15:
  206.         mov    data_65,0
  207. loc_16:
  208.         test    bp,8000h
  209.         jz    loc_17            ; Jump if zero
  210.         jmp    short loc_18
  211.         
  212. loc_17:
  213.         xor    dx,dx            ; Zero register
  214.         mov    ax,data_4
  215.         shr    ax,1            ; Shift w/zeros fill
  216.         mov    data_4,ax
  217. loc_18:
  218.         mov    ax,data_4
  219.         add    ax,7
  220.         shr    ax,1            ; Shift w/zeros fill
  221.         shr    ax,1            ; Shift w/zeros fill
  222.         shr    ax,1            ; Shift w/zeros fill
  223.         mov    si,offset data_65
  224.         mov    bx,data_8
  225.         sub    bx,data_7
  226.         mov    data_19,bx
  227.         mov    bx,data_7
  228.         push    bp
  229.         mov    bp,1
  230.         call    sub_7
  231.         pop    bp
  232.         test    bp,1
  233.         jz    loc_19            ; Jump if zero
  234.         call    sub_5
  235. loc_19:
  236.         jmp    short loc_00        ; delay for I/O
  237.         nop
  238. loc_00:
  239.         mov    ax,data_4
  240.         mov    cx,data_6
  241.         test    bp,1
  242.         jnz    loc_20            ; Jump if not zero
  243.         mov    bx,offset data_56
  244.         jmp    short loc_21
  245.         
  246. loc_20:
  247.         mov    bx,offset data_65
  248. loc_21:
  249.         mov    dx,ds
  250. loc_22:
  251.         mov    bp,ax
  252.         mov    di,bx
  253. ;        call    sub_22                      ; ?????
  254.         mov    si,offset data_56
  255.         mov    di,offset data_64
  256.         mov    data_6,cx
  257.         mov    data_4,bp
  258.         call    sub_1
  259.         pop    es
  260.         pop    ds
  261.         jmp    here            ; Interrupt return
  262.  
  263. ;**************************************************************************
  264. ;        SUBROUTINE  1                                                    *
  265. ;**************************************************************************
  266.  
  267. sub_1        proc    near
  268.         push    si
  269.         push    di
  270.         push    bp
  271.         push    dx
  272.         push    cx
  273.         push    bx
  274.         push    ax
  275.         mov    ax,data_4
  276.         add    ax,7
  277.         mov    cl,8
  278.         div    cl            ; al, ah rem = ax/reg
  279.         mov    cl,al
  280.         mov    bp,data_6
  281.         xor    ch,ch            ; Zero register
  282. loc_23:
  283.         xor    dx,dx            ; Zero register
  284. loc_24:
  285.         mov    ax,dx
  286.         push    cx
  287.         push    dx
  288.         xor    ch,ch            ; Zero register
  289.         mul    cx            ; dx:ax = reg * ax
  290.         pop    dx
  291.         pop    cx
  292.         push    cx
  293.         mov    cl,ch
  294.         xor    ch,ch            ; Zero register
  295.         add    ax,cx
  296.         pop    cx
  297.         mov    bx,ax
  298.         mov    al,[bx+si]
  299.         mov    [di],al
  300.         inc    di
  301.         inc    dx
  302.         cmp    dx,bp
  303.         jl    loc_24            ; Jump if <
  304.         inc    ch
  305.         cmp    ch,cl
  306.         jl    loc_23            ; Jump if <
  307.         pop    ax
  308.         pop    bx
  309.         pop    cx
  310.         pop    dx
  311.         pop    bp
  312.         pop    di
  313.         pop    si
  314.         retn
  315. sub_1        endp
  316.  
  317.  
  318. ;***********************************************************************
  319. ;   SUBROUTINE     2    read Chinese library file                      *
  320. ;***********************************************************************
  321.  
  322. sub_2        proc    near
  323.         cmp    ax,1F40h
  324.         jb    loc_25            ; Jump if below
  325.         mov    ax,1F40h
  326. loc_25:
  327.         push    ax
  328.         push    bx
  329.         push    cx
  330.         push    dx
  331.         mov    cx,6
  332.         mul    cx            ; dx:ax = reg * ax
  333.         xor    cx,cx            ; Zero register
  334.         mov    dx,ax
  335.         mov    ah,42h            ; 'B'
  336.         mov    al,0
  337.         mov    bx,data_55
  338.         int    21h            ; DOS Services  ah=function 42h
  339.                         ;  move file ptr, bx=file handle
  340.                         ;   al=method, cx,dx=offset
  341.         jc    loc_28            ; Jump if carry Set
  342.         mov    ah,3Fh            ; '?'
  343.         mov    bx,data_55
  344.         mov    cx,6
  345.         mov    dx,offset data_60
  346.         int    21h            ; DOS Services  ah=function 3Fh
  347.                         ;  read file, bx=file handle
  348.                         ;   cx=bytes to ds:dx buffer
  349.         jc    loc_28            ; Jump if carry Set
  350.         cmp    data_62,0
  351.         je    loc_28            ; Jump if equal
  352.         mov    cx,data_61
  353.         mov    dx,data_60
  354.         mov    ah,42h            ; 'B'
  355.         mov    al,0
  356.         mov    bx,data_55
  357.         int    21h            ; DOS Services  ah=function 42h
  358.                         ;  move file ptr, bx=file handle
  359.                         ;   al=method, cx,dx=offset
  360.         jc    loc_28            ; Jump if carry Set
  361.         mov    bx,data_55
  362.         mov    ah,3Fh            ; '?'
  363.         mov    cx,data_62
  364.         mov    dx,offset data_60
  365.         int    21h            ; DOS Services  ah=function 3Fh
  366.                         ;  read file, bx=file handle
  367.                         ;   cx=bytes to ds:dx buffer
  368.         jnc    loc_26            ; Jump if carry=0
  369. loc_26:
  370.         mov    si,offset data_60
  371.         mov    di,offset data_56
  372.         cmp    data_9,16h
  373.         jb    loc_27            ; Jump if below
  374.         mov    cx,200h
  375.         rep    movsw            ; Rep when cx >0 Mov [si] to es:[di]
  376.         clc                ; Clear carry flag
  377.         jmp    short loc_28
  378.         
  379. loc_27:
  380.         call    sub_3
  381.         clc                ; Clear carry flag
  382. loc_28:
  383.         pop    dx
  384.         pop    cx
  385.         pop    bx
  386.         pop    ax
  387.         retn
  388. sub_2        endp
  389.  
  390. data_15        dw    0
  391. data_16        dw    0
  392.  
  393. ;**************************************************************************
  394. ;            SUBROUTINE   3                                               *
  395. ;**************************************************************************
  396.  
  397. sub_3        proc    near
  398.         push    bp
  399.         cld                ; Clear direction
  400.         mov    bx,cx
  401.         mov    cs:data_16,di
  402.         mov    cs:data_15,0
  403. loc_29:
  404.         lodsb                ; String [si] to al
  405.         dec    bx
  406.         test    al,80h
  407.         jz    loc_31            ; Jump if zero
  408.         test    al,40h            ; '@'
  409.         jnz    loc_30            ; Jump if not zero
  410.         jmp    loc_38
  411. loc_30:
  412.         push    ax
  413.         push    bx
  414.         mov    bx,cs:data_16
  415.         mov    ax,cs:data_15
  416.         mov    [bx],ax
  417.         mov    cs:data_16,di
  418.         inc    di
  419.         inc    di
  420.         pop    bx
  421.         pop    ax
  422.         mov    cs:data_15,0
  423.         mov    ah,al
  424.         lodsb                ; String [si] to al
  425.         dec    bx
  426.         and    ah,3Fh            ; '?'
  427.         shl    ax,1            ; Shift w/zeros fill
  428.         shr    al,1            ; Shift w/zeros fill
  429.         xchg    ah,al
  430.         mov    dx,ax
  431.         jmp    loc_56
  432. loc_31:
  433.         test    al,40h            ; '@'
  434.         jnz    loc_32            ; Jump if not zero
  435.         jmp    loc_50
  436. loc_32:
  437.         xor    ah,ah            ; Zero register
  438.         mov    bp,ax
  439.         and    bp,30h
  440.         and    al,0Fh
  441.         xor    cx,cx            ; Zero register
  442.         mov    cl,al
  443.         add    cs:data_15,cx
  444.  
  445. locloop_33:
  446.         lodsb                ; String [si] to al
  447.         dec    bx
  448.         mov    ah,al
  449.         and    ah,0Fh
  450.         shr    al,1            ; Shift w/zeros fill
  451.         shr    al,1            ; Shift w/zeros fill
  452.         shr    al,1            ; Shift w/zeros fill
  453.         shr    al,1            ; Shift w/zeros fill
  454.         or    bp,bp            ; Zero ?
  455.         jz    loc_34            ; Jump if zero
  456.         cmp    bp,10h
  457.         je    loc_35            ; Jump if equal
  458.         cmp    bp,20h
  459.         je    loc_36            ; Jump if equal
  460.         add    dl,al
  461.         sub    dh,ah
  462.         jmp    short loc_37
  463.         
  464. loc_34:
  465.         add    dl,al
  466.         add    dh,ah
  467.         jmp    short loc_37
  468.         
  469. loc_35:
  470.         sub    dl,al
  471.         add    dh,ah
  472.         jmp    short loc_37
  473.         
  474. loc_36:
  475.         sub    dl,al
  476.         sub    dh,ah
  477. loc_37:
  478.         mov    ax,dx
  479.         stosw                ; Store ax to es:[di]
  480.         loop    locloop_33        ; Loop if cx > 0
  481.  
  482.         jmp    loc_57
  483. loc_38:
  484.         xor    ah,ah            ; Zero register
  485.         mov    bp,ax
  486.         and    bp,30h
  487.         or    bp,bp            ; Zero ?
  488.         jz    loc_42            ; Jump if zero
  489.         cmp    bp,10h
  490.         je    loc_46            ; Jump if equal
  491.         lodsb                ; String [si] to al
  492.         dec    bx
  493.         mov    ah,al
  494.         lodsb                ; String [si] to al
  495.         dec    bx
  496.         xchg    ah,al
  497.         test    al,80h
  498.         jz    loc_39            ; Jump if zero
  499.         and    al,7Fh
  500.         sub    dl,al
  501.         jmp    short loc_40
  502.         
  503. loc_39:
  504.         add    dl,al
  505. loc_40:
  506.         test    ah,80h
  507.         jz    loc_41            ; Jump if zero
  508.         and    ah,7Fh
  509.         sub    dh,ah
  510.         jmp    loc_56
  511. loc_41:
  512.         add    dh,ah
  513.         jmp    loc_56
  514. loc_42:
  515.         and    al,0Fh
  516.         mov    ah,al
  517.         lodsb                ; String [si] to al
  518.         dec    bx
  519.         xchg    ah,al
  520.         test    al,8
  521.         jz    loc_43            ; Jump if zero
  522.         and    al,7
  523.         sub    dl,al
  524.         jmp    short loc_44
  525.         
  526. loc_43:
  527.         add    dl,al
  528. loc_44:
  529.         test    ah,80h
  530.         jz    loc_45            ; Jump if zero
  531.         and    ah,7Fh
  532.         sub    dh,ah
  533.         jmp    short loc_56
  534.         
  535. loc_45:
  536.         add    dh,ah
  537.         jmp    short loc_56
  538.         
  539. loc_46:
  540.         and    al,0Fh
  541.         mov    ah,al
  542.         lodsb                ; String [si] to al
  543.         dec    bx
  544.         test    al,80h
  545.         jz    loc_47            ; Jump if zero
  546.         and    al,7Fh
  547.         sub    dl,al
  548.         jmp    short loc_48
  549.         
  550. loc_47:
  551.         add    dl,al
  552. loc_48:
  553.         test    ah,8
  554.         jz    loc_49            ; Jump if zero
  555.         and    ah,7
  556.         sub    dh,ah
  557.         jmp    short loc_56
  558.         
  559. loc_49:
  560.         add    dh,ah
  561.         jmp    short loc_56
  562.         
  563. loc_50:
  564.         and    ax,3Fh
  565.         mov    cx,ax
  566.         add    cs:data_15,cx
  567.  
  568. locloop_51:
  569.         lodsb                ; String [si] to al
  570.         dec    bx
  571.         mov    ah,al
  572.         and    ah,0Fh
  573.         shr    al,1            ; Shift w/zeros fill
  574.         shr    al,1            ; Shift w/zeros fill
  575.         shr    al,1            ; Shift w/zeros fill
  576.         shr    al,1            ; Shift w/zeros fill
  577.         test    al,8
  578.         jz    loc_52            ; Jump if zero
  579.         and    al,7
  580.         sub    dl,al
  581.         jmp    short loc_53
  582.         
  583. loc_52:
  584.         add    dl,al
  585. loc_53:
  586.         test    ah,8
  587.         jz    loc_54            ; Jump if zero
  588.         and    ah,7
  589.         sub    dh,ah
  590.         jmp    short loc_55
  591.         
  592. loc_54:
  593.         add    dh,ah
  594. loc_55:
  595.         mov    ax,dx
  596.         stosw                ; Store ax to es:[di]
  597.         loop    locloop_51        ; Loop if cx > 0
  598.  
  599.         jmp    short loc_57
  600.         
  601. loc_56:
  602.         inc    cs:data_15
  603.         mov    ax,dx
  604.         stosw                ; Store ax to es:[di]
  605. loc_57:
  606.         test    bx,0FFFFh
  607.         jz    loc_58            ; Jump if zero
  608.         jmp    loc_29
  609. loc_58:
  610.         xor    ax,ax            ; Zero register
  611.         stosw                ; Store ax to es:[di]
  612.         mov    bx,cs:data_16
  613.         mov    ax,cs:data_15
  614.         mov    [bx],ax
  615.         pop    bp
  616.         retn
  617. sub_3        endp
  618.  
  619. data_17        dw    0
  620.  
  621. ;**************************************************************************
  622. ;        SUBROUTINE  4 fill input buffer                                  *
  623. ;**************************************************************************
  624.  
  625. sub_4        proc    near
  626.         push    di
  627.         push    si
  628.         test    bp,1
  629.         jz    loc_59            ; Jump if zero
  630.         xor    dx,dx            ; Zero register
  631.         mov    ax,data_6
  632.         mov    cx,18h
  633.         div    cx            ; ax,dx rem=dx:ax/reg
  634.         mov    data_17,0
  635.         or    dx,dx            ; Zero ?
  636.         jz    loc_59            ; Jump if zero
  637.         sub    cx,dx
  638.         mov    data_17,cx
  639. loc_59:
  640.         mov    si,offset data_56
  641.         mov    di,offset data_65
  642. loc_60:
  643.         lodsw                ; String [si] to ax
  644.         or    ax,ax            ; Zero ?
  645.         jnz    loc_61            ; Jump if not zero
  646.         jmp    loc_74
  647. loc_61:
  648.         stosw                ; Store ax to es:[di]
  649.         mov    cx,ax
  650. loc_62:
  651.         xor    ax,ax            ; Zero register
  652.         lodsb                ; String [si] to al
  653.         cmp    ax,data_13
  654.         jb    loc_63            ; Jump if below
  655.         mov    ax,data_13
  656.         dec    ax
  657. loc_63:
  658.         push    ax
  659.         xor    ax,ax            ; Zero register
  660.         lodsb                ; String [si] to al
  661.         cmp    ax,data_13
  662.         jb    loc_64            ; Jump if below
  663.         mov    ax,data_13
  664.         dec    ax
  665. loc_64:
  666.         mov    bx,ax
  667.         pop    ax
  668.         test    bp,1000h
  669.         jz    loc_65            ; Jump if zero
  670.         shr    bx,1            ; Shift w/zeros fill
  671.         jmp    short loc_66
  672.         
  673. loc_65:
  674.         test    bp,800h
  675.         jz    loc_66            ; Jump if zero
  676.         shr    bx,1            ; Shift w/zeros fill
  677.         mov    dx,data_13
  678.         shr    dx,1            ; Shift w/zeros fill
  679.         add    bx,dx
  680. loc_66:
  681.         test    bp,8000h
  682.         jz    loc_71            ; Jump if zero
  683.         test    bp,4000h
  684.         jz    loc_68            ; Jump if zero
  685.         test    bp,2000h
  686.         jz    loc_67            ; Jump if zero
  687.         jmp    short loc_69
  688.         
  689. loc_67:
  690.         mov    dx,data_13
  691.         sub    dx,bx
  692.         dec    dx
  693.         mov    bx,ax
  694.         mov    ax,dx
  695.         mov    dx,data_13
  696.         sub    dx,data_14
  697.         add    bx,dx
  698.         jmp    short loc_71
  699.         
  700. loc_68:
  701.         test    bp,2000h
  702.         jz    loc_70            ; Jump if zero
  703. loc_69:
  704.         mov    dx,data_13
  705.         sub    dx,bx
  706.         dec    dx
  707.         mov    bx,dx
  708.         mov    dx,data_14
  709.         sub    dx,ax
  710.         dec    dx
  711.         mov    ax,dx
  712.         jmp    short loc_71
  713.         
  714. loc_70:
  715.         mov    dx,data_13
  716.         sub    dx,ax
  717.         dec    dx
  718.         mov    ax,bx
  719.         mov    bx,dx
  720. loc_71:
  721.         push    bx
  722.         mov    bx,data_4
  723.         mul    bx            ; dx:ax = reg * ax
  724.         mov    bx,data_13
  725.         div    bx            ; ax,dx rem=dx:ax/reg
  726.         stosw                ; Store ax to es:[di]
  727.         pop    ax
  728.         mov    bx,data_6
  729.         mul    bx            ; dx:ax = reg * ax
  730.         mov    bx,data_13
  731.         div    bx            ; ax,dx rem=dx:ax/reg
  732.         test    bp,1
  733.         jz    loc_72            ; Jump if zero
  734.         add    ax,data_17
  735. loc_72:
  736.         stosw                ; Store ax to es:[di]
  737.         dec    cx
  738.         jz    loc_73            ; Jump if zero
  739.         jmp    loc_62
  740. loc_73:
  741.         jmp    loc_60
  742. loc_74:
  743.         stosw                ; Store ax to es:[di]
  744.         pop    di
  745.         pop    si
  746.         retn
  747. sub_4        endp
  748.  
  749.  
  750. ;**************************************************************************
  751. ;         SUBROUTINE  5                                                   *
  752. ;**************************************************************************
  753.  
  754. sub_5        proc    near
  755.         xor    dx,dx            ; Zero register
  756.         mov    ax,data_19
  757.         mov    cx,8
  758.         div    cx            ; ax,dx rem=dx:ax/reg
  759.         mov    data_11,dx
  760.         mov    data_10,ax
  761.         mov    cx,data_4
  762.         add    cx,7
  763.         shr    cx,1            ; Shift w/zeros fill
  764.         shr    cx,1            ; Shift w/zeros fill
  765.         shr    cx,1            ; Shift w/zeros fill
  766.         mov    data_12,cx
  767.         mov    si,offset data_56
  768.         mov    di,offset data_65
  769.  
  770. locloop_75:
  771.         push    cx
  772.         mov    cx,8
  773.  
  774. locloop_76:
  775.         push    si
  776.         push    cx
  777.         mov    dx,data_10
  778. loc_77:
  779.         or    dx,dx            ; Zero ?
  780.         jz    loc_78            ; Jump if zero
  781.         mov    cx,8
  782.         call    sub_6
  783.         inc    di
  784.         dec    dx
  785.         jmp    short loc_77
  786. loc_78:
  787.         mov    cx,data_11
  788.         or    cx,cx            ; Zero ?
  789.         jz    loc_79            ; Jump if zero
  790.         call    sub_6
  791.         inc    di
  792. loc_79:
  793.         pop    cx
  794.         pop    si
  795.         loop    locloop_76        ; Loop if cx > 0
  796.  
  797.         inc    si
  798.         pop    cx
  799.         loop    locloop_75        ; Loop if cx > 0
  800.  
  801.         retn
  802. sub_5        endp
  803.  
  804.  
  805. ;**************************************************************************
  806. ;           SUBROUTINE  6                                                 *
  807. ;**************************************************************************
  808.  
  809. sub_6        proc    near
  810.         or    cx,cx            ; Zero ?
  811.         jz    loc_ret_81        ; Jump if zero
  812.         mov    bx,cx
  813.  
  814. locloop_80:
  815.         shl    byte ptr [si],1        ; Shift w/zeros fill
  816.         rcl    byte ptr [di],1        ; Rotate thru carry
  817.         add    si,data_12
  818.         loop    locloop_80        ; Loop if cx > 0
  819.  
  820.         mov    cx,bx
  821.         xchg    ch,cl
  822.         mov    cl,8
  823.         sub    cl,ch
  824.         jz    loc_ret_81        ; Jump if zero
  825.         shl    byte ptr [di],cl    ; Shift w/zeros fill
  826.  
  827. loc_ret_81:
  828.         retn
  829. sub_6        endp
  830.  
  831. data_18        dw    0
  832. data_19        dw    18h
  833. data_20        db    0, 0
  834. data_21        dw    0
  835. data_22        db    0
  836. data_23        db    0
  837. data_24        dw    0
  838. data_25        dw    0
  839.  
  840. ;**************************************************************************
  841. ;        SUBROUTINE   7                                                   *
  842. ;**************************************************************************
  843.  
  844. sub_7        proc    near
  845.         push    ax
  846.         push    bx
  847.         push    cx
  848.         push    dx
  849.         push    bp
  850.         push    di
  851.         push    es
  852.         push    cs
  853.         pop    es
  854.         cld                ; Clear direction
  855.         mov    cs:data_21,ax
  856.         mov    word ptr cs:data_20,bx
  857.         mov    cs:data_18,bp
  858.         mov    di,offset data_60
  859.         mov    cx,3200h
  860.         xor    ax,ax            ; Zero register
  861.         rep    stosw            ; Rep when cx >0 Store ax to es:[di]
  862.         mov    di,offset data_56
  863.         mov    cx,3200h
  864.         rep    stosb            ; Rep when cx >0 Store al to es:[di]
  865. loc_82:
  866.         xor    ax,ax            ; Zero register
  867.         lodsw                ; String [si] to ax
  868.         mov    cx,ax
  869.         cmp    cx,0
  870.         jne    loc_83            ; Jump if not equal
  871.         jmp    loc_101
  872. loc_83:
  873.         push    cx
  874.         push    si
  875.         cmp    cs:data_18,0
  876.         jne    loc_84            ; Jump if not equal
  877.         lodsb                ; String [si] to al
  878.         mov    cs:data_24,ax
  879.         lodsb                ; String [si] to al
  880.         mov    cs:data_25,ax
  881.         jmp    short loc_85
  882.         
  883. loc_84:
  884.         lodsw                ; String [si] to ax
  885.         mov    cs:data_24,ax
  886.         lodsw                ; String [si] to ax
  887.         mov    cs:data_25,ax
  888. loc_85:
  889.         dec    cx
  890.  
  891. locloop_86:
  892.         push    cx
  893.         mov    bx,cs:data_24
  894.         mov    dx,cs:data_25
  895.         cmp    cs:data_18,0
  896.         jne    loc_87            ; Jump if not equal
  897.         lodsb                ; String [si] to al
  898.         mov    di,ax
  899.         lodsb                ; String [si] to al
  900.         jmp    short loc_88
  901.         
  902. loc_87:
  903.         lodsw                ; String [si] to ax
  904.         mov    di,ax
  905.         lodsw                ; String [si] to ax
  906. loc_88:
  907.         push    si
  908.         mov    si,ax
  909.         xchg    si,di
  910.         mov    cs:data_24,si
  911.         mov    cs:data_25,di
  912.         call    sub_8
  913.         pop    si
  914.         pop    cx
  915.         jnc    loc_89            ; Jump if carry=0
  916.         loop    locloop_86        ; Loop if cx > 0
  917.  
  918.         pop    cx
  919.         pop    cx
  920.         jmp    short loc_82
  921. loc_89:
  922.         pop    si
  923.         pop    cx
  924.         cmp    cs:data_18,0
  925.         jne    loc_90            ; Jump if not equal
  926.         lodsb                ; String [si] to al
  927.         mov    bx,ax
  928.         lodsb                ; String [si] to al
  929.         mov    dx,ax
  930.         jmp    short loc_91
  931.         
  932. loc_90:
  933.         lodsw                ; String [si] to ax
  934.         mov    bx,ax
  935.         lodsw                ; String [si] to ax
  936.         mov    dx,ax
  937. loc_91:
  938.         mov    cs:data_30,bx
  939.         mov    cs:data_31,dx
  940.         mov    cs:data_24,bx
  941.         mov    cs:data_25,dx
  942.         sub    dx,word ptr cs:data_20
  943.         js    loc_92            ; Jump if sign=1
  944.         cmp    dx,cs:data_19
  945.         jae    loc_92            ; Jump if above or =
  946.         mov    cs:data_22,1
  947.         mov    cs:data_23,1
  948. loc_92:
  949.         dec    cx
  950.  
  951. locloop_93:
  952.         push    cx
  953.         mov    bx,cs:data_24
  954.         mov    dx,cs:data_25
  955.         xor    ax,ax            ; Zero register
  956.         cmp    cs:data_18,0
  957.         jne    loc_94            ; Jump if not equal
  958.         lodsb                ; String [si] to al
  959.         jmp    short loc_95
  960.         
  961. loc_94:
  962.         lodsw                ; String [si] to ax
  963. loc_95:
  964.         mov    di,ax
  965.         cmp    cs:data_18,0
  966.         jne    loc_96            ; Jump if not equal
  967.         lodsb                ; String [si] to al
  968.         jmp    short loc_97
  969.         
  970. loc_96:
  971.         lodsw                ; String [si] to ax
  972. loc_97:
  973.         push    si
  974.         push    ds
  975.         push    cs
  976.         pop    ds
  977.         mov    si,ax
  978.         xchg    si,di
  979.         mov    cs:data_24,si
  980.         mov    cs:data_25,di
  981.         call    sub_8
  982.         jc    loc_98            ; Jump if carry Set
  983.         call    sub_9
  984. loc_98:
  985.         pop    ds
  986.         pop    si
  987.         pop    cx
  988.         loop    locloop_93        ; Loop if cx > 0
  989.  
  990.         push    ds
  991.         push    si
  992.         push    cs
  993.         pop    ds
  994.         mov    bx,cs:data_24
  995.         mov    dx,cs:data_25
  996.         mov    si,cs:data_30
  997.         mov    di,cs:data_31
  998.         call    sub_8
  999.         jc    loc_99            ; Jump if carry Set
  1000.         call    sub_9
  1001. loc_99:
  1002.         cmp    cs:data_22,0
  1003.         je    loc_100            ; Jump if equal
  1004.         call    sub_13
  1005. loc_100:
  1006.         pop    si
  1007.         pop    ds
  1008.         mov    cs:data_22,0
  1009.         mov    cs:data_23,0
  1010.         jmp    loc_82
  1011. loc_101:
  1012.         call    sub_19
  1013.         push    cs
  1014.         pop    ds
  1015.         mov    si,offset data_56
  1016.         pop    es
  1017.         pop    di
  1018.         pop    bp
  1019.         pop    dx
  1020.         pop    cx
  1021.         pop    bx
  1022.         pop    ax
  1023.         retn
  1024. sub_7        endp
  1025.  
  1026.  
  1027. ;*************************************************************************
  1028. ;            SUBROUTINE    8                                             *
  1029. ;*************************************************************************
  1030.  
  1031. sub_8        proc    near
  1032.         push    bx
  1033.         push    si
  1034.         push    dx
  1035.         push    di
  1036.         mov    ax,word ptr cs:data_20
  1037.         xor    bp,bp            ; Zero register
  1038.         sub    dx,ax
  1039.         js    loc_102            ; Jump if sign=1
  1040.         cmp    dx,cs:data_19
  1041.         jb    loc_103            ; Jump if below
  1042.         or    bp,8000h
  1043. loc_102:
  1044.         sub    di,ax
  1045.         js    loc_108            ; Jump if sign=1
  1046.         cmp    di,cs:data_19
  1047.         jae    loc_109            ; Jump if above or =
  1048. loc_103:
  1049.         pop    di
  1050.         pop    dx
  1051.         push    dx
  1052.         push    di
  1053.         sub    di,dx
  1054.         jnz    loc_104            ; Jump if not zero
  1055.         or    bp,4
  1056. loc_104:
  1057.         js    loc_105            ; Jump if sign=1
  1058.         or    bp,1
  1059. loc_105:
  1060.         sub    si,bx
  1061.         jnz    loc_106            ; Jump if not zero
  1062.         or    bp,8
  1063. loc_106:
  1064.         js    loc_107            ; Jump if sign=1
  1065.         or    bp,2
  1066. loc_107:
  1067.         and    bp,0Fh
  1068.         push    bp
  1069.         and    bp,0Ch
  1070.         cmp    bp,0Ch
  1071.         pop    bp
  1072.         jz    loc_110            ; Jump if zero
  1073.         pop    di
  1074.         pop    dx
  1075.         pop    si
  1076.         pop    bx
  1077.         clc                ; Clear carry flag
  1078.         retn
  1079. loc_108:
  1080.         test    bp,8000h
  1081.         jnz    loc_103            ; Jump if not zero
  1082.         jmp    short loc_110
  1083.         
  1084. loc_109:
  1085.         test    bp,8000h
  1086.         jz    loc_103            ; Jump if zero
  1087. loc_110:
  1088.         pop    di
  1089.         pop    dx
  1090.         pop    si
  1091.         pop    bx
  1092.         stc                ; Set carry flag
  1093.         retn
  1094. sub_8        endp
  1095.  
  1096. data_26        db    0
  1097. data_27        dw    0
  1098. data_28        dw    0
  1099. data_29        dw    0
  1100.  
  1101. ;**************************************************************************
  1102. ;            SUBROUTINE   9                                               *
  1103. ;**************************************************************************
  1104.  
  1105. sub_9        proc    near
  1106.         test    bp,4
  1107.         jnz    loc_111            ; Jump if not zero
  1108.         test    bp,8
  1109.         jnz    loc_112            ; Jump if not zero
  1110.         jmp    short loc_117
  1111.         
  1112. loc_111:
  1113.         mov    ah,0
  1114.         call    sub_12
  1115.         mov    al,0
  1116.         or    ax,bp
  1117.         and    al,3
  1118.         mov    cx,6
  1119.         shl    al,cl            ; Shift w/zeros fill
  1120.         mov    data_26,al
  1121.         retn
  1122. loc_112:
  1123.         mov    ah,4
  1124.         call    sub_12
  1125.         sub    di,dx
  1126.         js    loc_114            ; Jump if sign=1
  1127. loc_113:
  1128.         dec    di
  1129.         jz    loc_ret_116        ; Jump if zero
  1130.         inc    dx
  1131.         mov    ah,4
  1132.         call    sub_14
  1133.         jmp    short loc_113
  1134. loc_114:
  1135.         neg    di
  1136. loc_115:
  1137.         dec    di
  1138.         jz    loc_ret_116        ; Jump if zero
  1139.         dec    dx
  1140.         mov    ah,4
  1141.         call    sub_14
  1142.         jmp    short loc_115
  1143.  
  1144. loc_ret_116:
  1145.         retn
  1146. loc_117:
  1147.         mov    data_27,si
  1148.         sub    data_27,bx
  1149.         jns    loc_118            ; Jump if not sign
  1150.         neg    data_27
  1151. loc_118:
  1152.         mov    data_28,di
  1153.         sub    data_28,dx
  1154.         jns    loc_119            ; Jump if not sign
  1155.         neg    data_28
  1156. loc_119:
  1157.         mov    cx,data_27
  1158.         cmp    cx,data_28
  1159.         jb    loc_125            ; Jump if below
  1160.         inc    cx
  1161.         shr    cx,1            ; Shift w/zeros fill
  1162.         mov    data_29,cx
  1163.         sub    si,bx
  1164.         jns    loc_120            ; Jump if not sign
  1165.         neg    si
  1166. loc_120:
  1167.         mov    cx,data_28
  1168.         cmp    cx,data_29
  1169.         jb    loc_121            ; Jump if below
  1170.         push    cx
  1171.         mov    ah,4
  1172.         call    sub_12
  1173.         mov    ah,4
  1174.         call    sub_10
  1175.         pop    cx
  1176.         sub    cx,data_27
  1177.         jmp    short loc_122
  1178.         
  1179. loc_121:
  1180.         push    cx
  1181.         mov    ah,0
  1182.         call    sub_12
  1183.         mov    ah,0
  1184.         call    sub_10
  1185.         pop    cx
  1186. loc_122:
  1187.         dec    si
  1188.         jz    loc_ret_124        ; Jump if zero
  1189.         add    cx,data_28
  1190.         test    cx,8000h
  1191.         jnz    loc_123            ; Jump if not zero
  1192.         cmp    cx,data_29
  1193.         jb    loc_123            ; Jump if below
  1194.         push    cx
  1195.         mov    ah,4
  1196.         call    sub_14
  1197.         mov    ah,4
  1198.         call    sub_10
  1199.         pop    cx
  1200.         sub    cx,data_27
  1201.         jmp    short loc_122
  1202. loc_123:
  1203.         push    cx
  1204.         mov    ah,0
  1205.         call    sub_14
  1206.         mov    ah,0
  1207.         call    sub_10
  1208.         pop    cx
  1209.         jmp    short loc_122
  1210.  
  1211. loc_ret_124:
  1212.         retn
  1213. loc_125:
  1214.         mov    cx,data_28
  1215.         xchg    cx,data_27
  1216.         xchg    cx,data_28
  1217.         inc    cx
  1218.         shr    cx,1            ; Shift w/zeros fill
  1219.         mov    data_29,cx
  1220.         sub    di,dx
  1221.         jns    loc_126            ; Jump if not sign
  1222.         neg    di
  1223. loc_126:
  1224.         mov    cx,data_28
  1225.         cmp    cx,data_29
  1226.         jb    loc_127            ; Jump if below
  1227.         push    cx
  1228.         mov    ah,4
  1229.         call    sub_12
  1230.         mov    ah,4
  1231.         call    sub_11
  1232.         pop    cx
  1233.         sub    cx,data_27
  1234.         jmp    short loc_128
  1235.         
  1236. loc_127:
  1237.         push    cx
  1238.         mov    ah,4
  1239.         call    sub_12
  1240.         mov    ah,0
  1241.         call    sub_11
  1242.         pop    cx
  1243. loc_128:
  1244.         dec    di
  1245.         jz    loc_ret_130        ; Jump if zero
  1246.         add    cx,data_28
  1247.         test    cx,8000h
  1248.         jnz    loc_129            ; Jump if not zero
  1249.         cmp    cx,data_29
  1250.         jb    loc_129            ; Jump if below
  1251.         push    cx
  1252.         mov    ah,4
  1253.         call    sub_14
  1254.         mov    ah,4
  1255.         call    sub_11
  1256.         pop    cx
  1257.         sub    cx,data_27
  1258.         jmp    short loc_128
  1259. loc_129:
  1260.         push    cx
  1261.         mov    ah,4
  1262.         call    sub_14
  1263.         mov    ah,0
  1264.         call    sub_11
  1265.         pop    cx
  1266.         jmp    short loc_128
  1267.  
  1268. loc_ret_130:
  1269.         retn
  1270. sub_9        endp
  1271.  
  1272.  
  1273. ;*************************************************************************
  1274. ;              SUBROUTINE   10                                           *
  1275. ;*************************************************************************
  1276.  
  1277. sub_10        proc    near
  1278.         test    bp,2
  1279.         jz    loc_131            ; Jump if zero
  1280.         inc    bx
  1281.         jmp    short loc_132
  1282.         
  1283. loc_131:
  1284.         dec    bx
  1285. loc_132:
  1286.         test    ah,4
  1287.         jz    loc_ret_134        ; Jump if zero
  1288.         test    bp,1
  1289.         jz    loc_133            ; Jump if zero
  1290.         inc    dx
  1291.         retn
  1292. loc_133:
  1293.         dec    dx
  1294.  
  1295. loc_ret_134:
  1296.         retn
  1297. sub_10        endp
  1298.  
  1299.  
  1300. ;**************************************************************************
  1301. ;            SUBROUTINE    11                                             *
  1302. ;**************************************************************************
  1303.  
  1304. sub_11        proc    near
  1305.         test    bp,1
  1306.         jz    loc_135            ; Jump if zero
  1307.         inc    dx
  1308.         jmp    short loc_136
  1309.         
  1310. loc_135:
  1311.         dec    dx
  1312. loc_136:
  1313.         test    ah,4
  1314.         jz    loc_ret_138        ; Jump if zero
  1315.         test    bp,2
  1316.         jz    loc_137            ; Jump if zero
  1317.         inc    bx
  1318.         retn
  1319. loc_137:
  1320.         dec    bx
  1321.  
  1322. loc_ret_138:
  1323.         retn
  1324. sub_11        endp
  1325.  
  1326. data_30        dw    0
  1327. data_31        dw    0
  1328. data_32        db    0
  1329.  
  1330. ;**************************************************************************
  1331. ;          SUBROUTINE  12                                                 *
  1332. ;**************************************************************************
  1333.  
  1334. sub_12        proc    near
  1335.         cmp    data_23,1
  1336.         jne    loc_139            ; Jump if not equal
  1337.         mov    data_30,bx
  1338.         mov    data_31,dx
  1339.         mov    al,0
  1340.         or    ax,bp
  1341.         and    al,3
  1342.         mov    cx,4
  1343.         shl    al,cl            ; Shift w/zeros fill
  1344.         or    ah,al
  1345.         shl    al,1            ; Shift w/zeros fill
  1346.         shl    al,1            ; Shift w/zeros fill
  1347.         or    ah,al
  1348.         mov    al,ah
  1349.         mov    data_32,al
  1350.         mov    data_26,al
  1351.         mov    data_23,0
  1352.         retn
  1353. loc_139:
  1354.         mov    al,0
  1355.         or    ax,bp
  1356.         and    al,3
  1357.         mov    cx,4
  1358.         shl    al,cl            ; Shift w/zeros fill
  1359.         push    ax
  1360.         and    data_26,0CFh
  1361.         or    data_26,al
  1362.         call    sub_14
  1363.         pop    ax
  1364.         shl    al,1            ; Shift w/zeros fill
  1365.         shl    al,1            ; Shift w/zeros fill
  1366.         and    data_26,3Fh        ; '?'
  1367.         or    data_26,al
  1368.         retn
  1369. sub_12        endp
  1370.  
  1371.  
  1372. ;**************************************************************************
  1373. ;           SUBROUTINE  13                                                *
  1374. ;**************************************************************************
  1375.  
  1376. sub_13        proc    near
  1377.         mov    bx,data_30
  1378.         mov    dx,data_31
  1379.         mov    ah,data_32
  1380.         and    ah,4
  1381.         mov    al,data_32
  1382.         and    al,30h            ; '0'
  1383.         and    data_26,0CFh
  1384.         or    data_26,al
  1385.         call    sub_14
  1386.         retn
  1387. sub_13        endp
  1388.  
  1389. data_33        db    0            ; Data table (indexed access)
  1390.         db     01h, 02h, 03h, 00h, 01h, 02h
  1391.         db     03h, 02h, 03h, 0Ah, 02h, 02h
  1392.         db     03h, 0Ah, 02h, 00h, 01h, 02h
  1393.         db     03h, 01h, 05h, 03h, 01h, 02h
  1394.         db     03h, 0Ah, 02h, 03h, 01h, 02h
  1395.         db     03h, 01h, 05h, 03h, 01h, 00h
  1396.         db     01h, 02h, 03h, 00h, 01h, 02h
  1397.         db     03h, 02h, 03h, 0Ah, 02h, 01h
  1398.         db     05h, 03h, 01h, 01h, 05h, 03h
  1399.         db     01h, 03h, 01h, 02h, 03h, 03h
  1400.         db     01h, 02h, 03h, 00h, 01h, 02h
  1401.         db     03h, 00h, 01h, 02h, 03h, 00h
  1402.         db     01h, 02h, 03h, 00h, 01h, 02h
  1403.         db     03h, 00h, 01h, 02h, 03h, 01h
  1404.         db     05h, 03h, 01h, 00h, 01h, 02h
  1405.         db     03h, 01h, 05h, 03h, 01h, 01h
  1406.         db     05h, 03h, 01h, 03h, 01h, 02h
  1407.         db     03h, 01h, 05h, 03h, 01h, 03h
  1408.         db     01h, 02h, 03h, 01h, 05h, 03h
  1409.         db     01h, 01h, 05h, 03h, 01h, 01h
  1410.         db     05h, 03h, 01h, 01h, 05h, 03h
  1411.         db     01h, 02h, 03h, 0Ah, 02h, 02h
  1412.         db     03h, 0Ah, 02h, 02h, 03h, 0Ah
  1413.         db     02h, 02h, 03h, 0Ah, 02h, 02h
  1414.         db     03h, 0Ah, 02h, 03h, 01h, 02h
  1415.         db     03h, 02h, 03h, 0Ah, 02h, 03h
  1416.         db     01h, 02h, 03h, 00h, 01h, 02h
  1417.         db     03h, 02h, 03h, 0Ah, 02h, 00h
  1418.         db     01h, 02h, 03h, 02h, 03h, 0Ah
  1419.         db     02h, 00h, 01h, 02h, 03h, 00h
  1420.         db     01h, 02h, 03h, 00h, 01h, 02h
  1421.         db     03h, 00h, 01h, 02h, 03h, 02h
  1422.         db     03h, 0Ah, 02h, 02h, 03h, 0Ah
  1423.         db     02h, 03h, 01h, 02h, 03h, 03h
  1424.         db     01h, 02h, 03h, 02h, 03h, 0Ah
  1425.         db     02h, 00h, 01h, 02h, 03h, 00h
  1426.         db     01h, 02h, 03h, 01h, 05h, 03h
  1427.         db     01h, 00h, 01h, 02h, 03h, 02h
  1428.         db     03h, 0Ah, 02h, 01h, 05h, 03h
  1429.         db     01h, 03h, 01h, 02h, 03h, 00h
  1430.         db     01h, 02h, 03h, 00h, 01h, 02h
  1431.         db     03h, 01h, 05h, 03h, 01h, 01h
  1432.         db     05h, 03h, 01h
  1433.  
  1434. ;**************************************************************************
  1435. ;          SUBROUTINE    14                                               *
  1436. ;**************************************************************************
  1437.  
  1438. sub_14        proc    near
  1439.         push    bx
  1440.         push    dx
  1441.         sub    dx,word ptr data_20
  1442.         js    loc_142            ; Jump if sign=1
  1443.         cmp    dx,cs:data_19
  1444.         jae    loc_142            ; Jump if above or =
  1445.         push    ax
  1446.         mov    ax,dx
  1447.         mul    data_21            ; ax = data * ax
  1448.         shl    ax,1            ; Shift w/zeros fill
  1449.         mov    cx,bx
  1450.         and    cx,3
  1451.         shr    bx,1            ; Shift w/zeros fill
  1452.         shr    bx,1            ; Shift w/zeros fill
  1453.         add    ax,bx
  1454.         shl    cx,1            ; Shift w/zeros fill
  1455.         mov    bx,ax
  1456.         pop    ax
  1457.         mov    al,byte ptr data_60[bx]
  1458.         shl    al,cl            ; Shift w/zeros fill
  1459.         and    al,0C0h
  1460.         rol    al,1            ; Rotate
  1461.         rol    al,1            ; Rotate
  1462.         or    al,ah
  1463.         call    sub_17
  1464.         push    bx
  1465.         xor    bh,bh            ; Zero register
  1466.         mov    bl,data_26
  1467.         mov    al,data_33[bx]
  1468.         pop    bx
  1469.         test    al,3
  1470.         jz    loc_141            ; Jump if zero
  1471.         test    al,4
  1472.         jnz    loc_143            ; Jump if not zero
  1473.         test    al,8
  1474.         jnz    loc_145            ; Jump if not zero
  1475. loc_140:
  1476.         call    sub_18
  1477. loc_141:
  1478.         pop    dx
  1479.         pop    bx
  1480.         retn
  1481. loc_142:
  1482.         mov    al,ah
  1483.         call    sub_17
  1484.         pop    dx
  1485.         pop    bx
  1486.         retn
  1487. loc_143:
  1488.         push    cx
  1489.         push    bx
  1490.         push    ax
  1491.         inc    cl
  1492.         inc    cl
  1493.         cmp    cl,8
  1494.         jne    loc_144            ; Jump if not equal
  1495.         mov    cl,0
  1496.         inc    bx
  1497. loc_144:
  1498.         mov    al,1
  1499.         call    sub_15
  1500.         pop    ax
  1501.         pop    bx
  1502.         pop    cx
  1503.         jmp    short loc_140
  1504. loc_145:
  1505.         push    cx
  1506.         push    bx
  1507.         push    ax
  1508.         dec    cl
  1509.         dec    cl
  1510.         jns    loc_146            ; Jump if not sign
  1511.         mov    cl,6
  1512.         dec    bx
  1513. loc_146:
  1514.         mov    al,2
  1515.         call    sub_16
  1516.         pop    ax
  1517.         pop    bx
  1518.         pop    cx
  1519.         jmp    short loc_140
  1520. sub_14        endp
  1521.  
  1522. data_34        dw    offset loc_147        ; Data table (indexed access)
  1523. data_35        dw    offset loc_150
  1524. data_36        dw    offset loc_149
  1525. data_37        dw    offset loc_147
  1526.  
  1527. ;**************************************************************************
  1528. ;            SUBROUTINE   15                                              *
  1529. ;**************************************************************************
  1530.  
  1531. sub_15        proc    near
  1532.         push    cx
  1533.         push    bx
  1534.         push    ax
  1535.         mov    al,byte ptr data_60[bx]
  1536.         shl    al,cl            ; Shift w/zeros fill
  1537.         and    al,0C0h
  1538.         rol    al,1            ; Rotate
  1539.         rol    al,1            ; Rotate
  1540.         push    bx
  1541.         xor    bh,bh            ; Zero register
  1542.         mov    bl,al
  1543.         shl    bx,1            ; Shift w/zeros fill
  1544.         jmp    word ptr cs:data_34[bx]    ;*4 entries
  1545.  
  1546. ;--------Indexed Entry Point ----------------------------------------------
  1547.  
  1548. loc_147:
  1549.         mov    al,1
  1550. loc_148:
  1551.         pop    bx
  1552.         call    sub_18
  1553.         jmp    short loc_152
  1554.         db    90h
  1555.  
  1556. ;----- Indexed Entry Point -------------------------------------------------
  1557.  
  1558. loc_149:
  1559.         mov    al,3
  1560.         jmp    short loc_148
  1561.  
  1562. ;----- Indexed Entry Point -----------------------------------------------─
  1563.  
  1564. loc_150:
  1565.         pop    bx
  1566.         inc    cl
  1567.         inc    cl
  1568.         cmp    cl,8
  1569.         jne    loc_151            ; Jump if not equal
  1570.         mov    cl,0
  1571.         inc    bx
  1572. loc_151:
  1573.         call    sub_15
  1574. loc_152:
  1575.         pop    ax
  1576.         pop    bx
  1577.         pop    cx
  1578.         retn
  1579. sub_15        endp
  1580.  
  1581. data_38        dw    offset loc_153        ; Data table (indexed access)
  1582. data_39        dw    offset loc_155
  1583. data_40        dw    offset loc_156
  1584. data_41        dw    offset loc_153
  1585.  
  1586. ;**************************************************************************
  1587. ;         SUBROUTINE  16                                                  *
  1588. ;**************************************************************************
  1589.  
  1590. sub_16        proc    near
  1591.         push    cx
  1592.         push    bx
  1593.         push    ax
  1594.         mov    al,byte ptr data_60[bx]
  1595.         shl    al,cl            ; Shift w/zeros fill
  1596.         and    al,0C0h
  1597.         rol    al,1            ; Rotate
  1598.         rol    al,1            ; Rotate
  1599.         push    bx
  1600.         xor    bh,bh            ; Zero register
  1601.         mov    bl,al
  1602.         shl    bx,1            ; Shift w/zeros fill
  1603.         jmp    word ptr cs:data_38[bx]    ;*4 entries
  1604.  
  1605. ;----- Indexed Entry Point -------------------------------------------------
  1606.  
  1607. loc_153:
  1608.         mov    al,2
  1609. loc_154:
  1610.         pop    bx
  1611.         call    sub_18
  1612.         jmp    short loc_152
  1613.  
  1614. ;----- Indexed Entry Point -------------------------------------------------
  1615.  
  1616. loc_155:
  1617.         mov    al,3
  1618.         jmp    short loc_154
  1619.  
  1620. ;----- Indexed Entry Point ------------------------------------------------
  1621.  
  1622. loc_156:
  1623.         pop    bx
  1624.         dec    cl
  1625.         dec    cl
  1626.         jns    loc_157            ; Jump if not sign
  1627.         mov    cl,6
  1628.         dec    bx
  1629. loc_157:
  1630.         call    sub_16
  1631.         pop    ax
  1632.         pop    bx
  1633.         pop    cx
  1634.         retn
  1635. sub_16        endp
  1636.  
  1637.  
  1638. ;**************************************************************************
  1639. ;           SUBROUTINE   17                                               *
  1640. ;**************************************************************************
  1641.  
  1642. sub_17        proc    near
  1643.         mov    ah,data_26
  1644.         and    ah,4
  1645.         shl    ah,1            ; Shift w/zeros fill
  1646.         or    al,ah
  1647.         and    data_26,0F0h
  1648.         or    data_26,al
  1649.         retn
  1650. sub_17        endp
  1651.  
  1652.  
  1653. ;**************************************************************************
  1654. ;          SUBROUTINE  18                                                 *
  1655. ;**************************************************************************
  1656.  
  1657. sub_18        proc    near
  1658.         mov    ah,al
  1659.         mov    al,byte ptr data_60[bx]
  1660.         rol    al,cl            ; Rotate
  1661.         shl    al,1            ; Shift w/zeros fill
  1662.         shl    al,1            ; Shift w/zeros fill
  1663.         shr    ax,1            ; Shift w/zeros fill
  1664.         shr    ax,1            ; Shift w/zeros fill
  1665.         ror    al,cl            ; Rotate
  1666.         mov    byte ptr data_60[bx],al
  1667.         retn
  1668. sub_18        endp
  1669.  
  1670. data_42        dw    offset loc_162        ; Data table (indexed access)
  1671. data_43        dw    offset loc_164
  1672. data_44        dw    offset loc_165
  1673. data_45        dw    offset loc_166
  1674.  
  1675. ;***************************************************************************
  1676. ;           SUBROUTINE    19                                               *
  1677. ;***************************************************************************
  1678.  
  1679. sub_19        proc    near
  1680.         xor    ax,ax            ; Zero register
  1681.         xor    bx,bx            ; Zero register
  1682.         push    cs
  1683.         push    cs
  1684.         pop    ds
  1685.         pop    es
  1686.         mov    si,offset data_60
  1687.         mov    di,offset data_56
  1688.         mov    dx,cs:data_19
  1689. loc_158:
  1690.         xor    bp,bp            ; Zero register
  1691.         mov    cx,data_21
  1692.  
  1693. locloop_159:
  1694.         push    cx
  1695.         mov    cx,2
  1696.  
  1697. locloop_160:
  1698.         push    cx
  1699.         mov    cx,4
  1700.         mov    al,[si]
  1701.  
  1702. locloop_161:
  1703.         shl    ax,1            ; Shift w/zeros fill
  1704.         shl    ax,1            ; Shift w/zeros fill
  1705.         mov    bl,ah
  1706.         shl    bx,1            ; Shift w/zeros fill
  1707.         jmp    word ptr cs:data_42[bx]    ;*4 entries
  1708.  
  1709. ;----- Indexed Entry Point ---------------------------------------------
  1710.  
  1711. loc_162:
  1712.         cmp    bp,0
  1713.         jne    loc_163            ; Jump if not equal
  1714.         clc                ; Clear carry flag
  1715.         jmp    short loc_167
  1716.         db    90h
  1717. loc_163:
  1718.         stc                ; Set carry flag
  1719.         jmp    short loc_167
  1720.         db    90h
  1721.  
  1722. ;----- Indexed Entry Point -----------------------------------------------─
  1723.  
  1724. loc_164:
  1725.         inc    bp
  1726.         stc                ; Set carry flag
  1727.         jmp    short loc_167
  1728.         db    90h
  1729.  
  1730. ;----- Indexed Entry Point ------------------------------------------------
  1731.  
  1732. loc_165:
  1733.         dec    bp
  1734.  
  1735. ;----- Indexed Entry Point ------------------------------------------------
  1736.  
  1737. loc_166:
  1738.         stc                ; Set carry flag
  1739. loc_167:
  1740.         rcl    byte ptr [di],1        ; Rotate thru carry
  1741.         xor    ah,ah            ; Zero register
  1742.         loop    locloop_161        ; Loop if cx > 0
  1743.  
  1744.         pop    cx
  1745.         inc    si
  1746.         loop    locloop_160        ; Loop if cx > 0
  1747.  
  1748.         pop    cx
  1749.         inc    di
  1750.         loop    locloop_159        ; Loop if cx > 0
  1751.  
  1752.         dec    dx
  1753.         jnz    loc_158            ; Jump if not zero
  1754.         retn
  1755. sub_19        endp
  1756.  
  1757. data_49        dw    0
  1758. data_51        db    0
  1759.  
  1760. ;**************************************************************************
  1761. ;           SUBROUTINE  21  open file                                     *
  1762. ;**************************************************************************
  1763.  
  1764. sub_21        proc    near
  1765.         push    ax
  1766.         push    bx
  1767.         push    cx
  1768.         push    bp
  1769.         push    dx
  1770.         push    si
  1771.         push    di
  1772.         push    es
  1773.         mov    cs:data_51,0
  1774.         push    ds
  1775.         mov     ds,ax
  1776.         mov    ax,3D00h
  1777.         int    21h            ; DOS Services  ah=function 3Dh
  1778.         pop     ds            ;  open file, al=mode,name@ds:dx
  1779.         jc    loc_174            ; Jump if carry Set
  1780.         mov    data_55,ax
  1781.         jmp    short loc_175
  1782. loc_174:
  1783.         mov    ax,80h
  1784.         mov    data_55,ax
  1785.         stc                ; Set carry flag
  1786. loc_175:
  1787.         pop    es
  1788.         pop    di
  1789.         pop    si
  1790.         pop    dx
  1791.         pop    bp
  1792.         pop    cx
  1793.         pop    bx
  1794.         pop    ax
  1795.         retn
  1796. sub_21        endp
  1797.  
  1798.  
  1799. ;**************************************************************************
  1800. ;            SUBROUTINE  22     close file                                *
  1801. ;**************************************************************************
  1802.  
  1803. sub_22        proc    near
  1804.         push    ax
  1805.         push    bx
  1806.         push    cx
  1807.         push    dx
  1808.         mov    ah,3Eh            ; '>'
  1809.         mov    bx,cs:data_55
  1810.         cmp    bx,5
  1811.         jl    loc_176            ; Jump if <
  1812.         int    21h            ; DOS Services  ah=function 3Eh
  1813.                         ;  close file, bx=file handle
  1814. loc_176:
  1815.         pop    dx
  1816.         pop    cx
  1817.         pop    bx
  1818.         pop    ax
  1819.         retn
  1820. sub_22        endp
  1821.  
  1822. ;*************************************************************************
  1823. ; The following area is data buffer of the program.
  1824.  
  1825. data_55        dw    80h
  1826. data_56        dw    8932 dup (0)
  1827.         db    0
  1828.         db    2297 dup (0)
  1829.         db    0            ; Data table (indexed access)
  1830.         db    5437 dup (0)
  1831. data_60        dw    0            ; Data table (indexed access)
  1832. data_61        dw    0
  1833. data_62        dw    0
  1834.         db    2748 dup (0)
  1835.         db    0            ; Data table (indexed access)
  1836.         db    10045 dup (0)
  1837. data_64        db    0
  1838.         db    12799 dup (0)
  1839. data_65        dw    0
  1840.         db    1998 dup (0)
  1841.  
  1842.  
  1843. recovery    ends
  1844.         end
  1845. 
  1846.