home *** CD-ROM | disk | FTP | other *** search
- CCode equ [bp+18]
- FileIndex equ [bp+20]
- FileHandle equ [bp+22]
- BitWidth equ [bp+24]
- BitHeight equ [bp+26]
- public _GetDOTS
- recovery segment byte public 'CODE'
- assume cs:recovery, ds:recovery
-
- data_3 dw 80h ; Data table (indexed access)
- db 60h, 00h, 60h, 00h, 60h, 00h
- db 60h, 00h, 80h, 00h, 80h, 00h
- db 80h, 00h, 60h, 00h, 80h, 00h
- db 60h, 00h, 80h, 00h, 80h, 00h
- db 80h, 00h, 80h, 00h, 80h, 00h
- db 60h, 00h, 60h, 00h, 60h, 00h
- db 60h, 00h, 60h, 00h, 60h, 00h
- db 00h, 01h, 00h, 01h, 00h, 01h
- db 00h, 01h, 00h, 01h, 80h, 00h
- db 00h, 01h, 00h, 01h
- data_4 dw 0
- data_6 dw 0
- data_7 dw 0
- data_8 dw 0
- data_9 dw 0
- data_10 dw 0
- data_11 dw 0
- data_12 dw 0
- db 0, 0
- data_13 dw 0
- data_14 dw 0
-
- ;**************************************************************************
- ; *
- ; External Entry Point *
- ;**************************************************************************
-
- _GetDOTS proc far
- push bp
- push ds
- push es
- push si
- push di
- push bx
- push cx
- mov bp,sp
- mov ax,CCode
- mov bx,100
- div bx
- mov bh,al
- mov bl,dl
- add bx,0a0a0h
- mov cx,BitHeight ;3--height of font
- mov si,0
- mov ax,cs
- mov ds,ax
- mov es,ax
- mov dx,FileHandle
- mov data_55,dx
- mov data_51,0
- mov dx,FileIndex ;6--index number
- xchg dh,dl ;?????
- mov ax,BitWidth ;5--width of font
- mov bp,ax
- jmp loc_1 ;????
- mov ax,0
- mov es,ax
- mov di,0
- here: ;There are two output data.
- ; mov ax,es ;1--seg address of output buffer
- ; mov dx,ax
- ; mov ax,di ;2--offset address of output buffer
-
- mov ax,di
- mov dx,es
-
- pop cx
- pop bx
- pop di
- pop si
- pop es
- pop ds
- pop bp
- retf ; Routine return
- _GetDOTS endp
-
- loc_1:
- xor dl,dl
- nop ; Zero register
- xchg dh,dl
- xchg dx,bx
- mov ax,bp
- mov bp,si
- mov bp,0
- mov si,1
- mov di,cx
- cld ; Clear direction
- or dx,dx ; Zero ?
- jnz loc_2 ; Jump if not zero
- mov dx,cs
- mov bx,offset data_56
- jmp here ; Routine return
- loc_2:
- push ds
- push es
- push cs
- pop ds
- push cs
- pop es
- or ax,ax ; Zero ?
- jnz loc_3 ; Jump if not zero
- jmp loc_22
- loc_3:
- or cx,cx ; Zero ?
- jnz loc_4 ; Jump if not zero
- jmp loc_22
- loc_4:
- cmp ax,140h
- jb loc_5 ; Jump if below
- mov ax,140h
- loc_5:
- cmp cx,140h
- jb loc_6 ; Jump if below
- mov cx,140h
- loc_6:
- test bp,1800h
- jz loc_7 ; Jump if zero
- shr ax,1 ; Shift w/zeros fill
- loc_7:
- mov data_6,cx
- mov data_4,ax
- mov data_7,si
- mov data_8,di
- mov data_9,bx
- or dh,dh ; Zero ?
- jnz loc_8 ; Jump if not zero
- jmp short loc_12
-
- loc_8:
- sub dx,0A0A0h ;????
- xor ax,ax ; Zero register
- xor cx,cx ; Zero register
- xor bx,bx ; Zero register
- dec dh
- dec dl
- mov al,dh
- mov cl,dl
- cmp dh,0Fh
- jb loc_9 ; Jump if below
- sub ax,0Fh
- add data_9,1
- jmp short loc_10
-
- loc_9:
- mov data_9,0
- loc_10:
- mov bx,data_9
- shl bx,1 ; Shift w/zeros fill
- mov bx,data_3[bx]
- mov data_13,bx
- mov data_14,bx
- mov bx,5Eh
- mul bx ; dx:ax = reg * ax
- add ax,cx
- call sub_2
- jc loc_11 ; Jump if carry Set
- call sub_4
- jmp short loc_18
-
- loc_11:
- mov data_65,0
- jmp short loc_18
-
- loc_12:
- cmp bx,2
- jb loc_13 ; Jump if below
- mov data_9,0
- loc_13:
- sub dl,21h ; '!'
- mov cx,dx
- mov ax,data_9
- mov bx,5Eh
- mul bx ; dx:ax = reg * ax
- add ax,34Eh
- add ax,cx
- mov data_9,0
- mov bx,data_3
- mov data_13,bx
- push ax
- mov ax,data_13
- shr ax,1 ; Shift w/zeros fill
- mov data_14,ax
- cmp cl,7Eh ; '~'
- jbe loc_14 ; Jump if below or =
- pop ax
- jmp short loc_15
-
- loc_14:
- pop ax
- call sub_2
- jc loc_15 ; Jump if carry Set
- call sub_4
- jmp short loc_16
-
- loc_15:
- mov data_65,0
- loc_16:
- test bp,8000h
- jz loc_17 ; Jump if zero
- jmp short loc_18
-
- loc_17:
- xor dx,dx ; Zero register
- mov ax,data_4
- shr ax,1 ; Shift w/zeros fill
- mov data_4,ax
- loc_18:
- mov ax,data_4
- add ax,7
- shr ax,1 ; Shift w/zeros fill
- shr ax,1 ; Shift w/zeros fill
- shr ax,1 ; Shift w/zeros fill
- mov si,offset data_65
- mov bx,data_8
- sub bx,data_7
- mov data_19,bx
- mov bx,data_7
- push bp
- mov bp,1
- call sub_7
- pop bp
- test bp,1
- jz loc_19 ; Jump if zero
- call sub_5
- loc_19:
- jmp short loc_00 ; delay for I/O
- nop
- loc_00:
- mov ax,data_4
- mov cx,data_6
- test bp,1
- jnz loc_20 ; Jump if not zero
- mov bx,offset data_56
- jmp short loc_21
-
- loc_20:
- mov bx,offset data_65
- loc_21:
- mov dx,ds
- loc_22:
- mov bp,ax
- mov di,bx
- ; call sub_22 ; ?????
- mov si,offset data_56
- mov di,offset data_64
- mov data_6,cx
- mov data_4,bp
- call sub_1
- pop es
- pop ds
- jmp here ; Interrupt return
-
- ;**************************************************************************
- ; SUBROUTINE 1 *
- ;**************************************************************************
-
- sub_1 proc near
- push si
- push di
- push bp
- push dx
- push cx
- push bx
- push ax
- mov ax,data_4
- add ax,7
- mov cl,8
- div cl ; al, ah rem = ax/reg
- mov cl,al
- mov bp,data_6
- xor ch,ch ; Zero register
- loc_23:
- xor dx,dx ; Zero register
- loc_24:
- mov ax,dx
- push cx
- push dx
- xor ch,ch ; Zero register
- mul cx ; dx:ax = reg * ax
- pop dx
- pop cx
- push cx
- mov cl,ch
- xor ch,ch ; Zero register
- add ax,cx
- pop cx
- mov bx,ax
- mov al,[bx+si]
- mov [di],al
- inc di
- inc dx
- cmp dx,bp
- jl loc_24 ; Jump if <
- inc ch
- cmp ch,cl
- jl loc_23 ; Jump if <
- pop ax
- pop bx
- pop cx
- pop dx
- pop bp
- pop di
- pop si
- retn
- sub_1 endp
-
-
- ;***********************************************************************
- ; SUBROUTINE 2 read Chinese library file *
- ;***********************************************************************
-
- sub_2 proc near
- cmp ax,1F40h
- jb loc_25 ; Jump if below
- mov ax,1F40h
- loc_25:
- push ax
- push bx
- push cx
- push dx
- mov cx,6
- mul cx ; dx:ax = reg * ax
- xor cx,cx ; Zero register
- mov dx,ax
- mov ah,42h ; 'B'
- mov al,0
- mov bx,data_55
- int 21h ; DOS Services ah=function 42h
- ; move file ptr, bx=file handle
- ; al=method, cx,dx=offset
- jc loc_28 ; Jump if carry Set
- mov ah,3Fh ; '?'
- mov bx,data_55
- mov cx,6
- mov dx,offset data_60
- int 21h ; DOS Services ah=function 3Fh
- ; read file, bx=file handle
- ; cx=bytes to ds:dx buffer
- jc loc_28 ; Jump if carry Set
- cmp data_62,0
- je loc_28 ; Jump if equal
- mov cx,data_61
- mov dx,data_60
- mov ah,42h ; 'B'
- mov al,0
- mov bx,data_55
- int 21h ; DOS Services ah=function 42h
- ; move file ptr, bx=file handle
- ; al=method, cx,dx=offset
- jc loc_28 ; Jump if carry Set
- mov bx,data_55
- mov ah,3Fh ; '?'
- mov cx,data_62
- mov dx,offset data_60
- int 21h ; DOS Services ah=function 3Fh
- ; read file, bx=file handle
- ; cx=bytes to ds:dx buffer
- jnc loc_26 ; Jump if carry=0
- loc_26:
- mov si,offset data_60
- mov di,offset data_56
- cmp data_9,16h
- jb loc_27 ; Jump if below
- mov cx,200h
- rep movsw ; Rep when cx >0 Mov [si] to es:[di]
- clc ; Clear carry flag
- jmp short loc_28
-
- loc_27:
- call sub_3
- clc ; Clear carry flag
- loc_28:
- pop dx
- pop cx
- pop bx
- pop ax
- retn
- sub_2 endp
-
- data_15 dw 0
- data_16 dw 0
-
- ;**************************************************************************
- ; SUBROUTINE 3 *
- ;**************************************************************************
-
- sub_3 proc near
- push bp
- cld ; Clear direction
- mov bx,cx
- mov cs:data_16,di
- mov cs:data_15,0
- loc_29:
- lodsb ; String [si] to al
- dec bx
- test al,80h
- jz loc_31 ; Jump if zero
- test al,40h ; '@'
- jnz loc_30 ; Jump if not zero
- jmp loc_38
- loc_30:
- push ax
- push bx
- mov bx,cs:data_16
- mov ax,cs:data_15
- mov [bx],ax
- mov cs:data_16,di
- inc di
- inc di
- pop bx
- pop ax
- mov cs:data_15,0
- mov ah,al
- lodsb ; String [si] to al
- dec bx
- and ah,3Fh ; '?'
- shl ax,1 ; Shift w/zeros fill
- shr al,1 ; Shift w/zeros fill
- xchg ah,al
- mov dx,ax
- jmp loc_56
- loc_31:
- test al,40h ; '@'
- jnz loc_32 ; Jump if not zero
- jmp loc_50
- loc_32:
- xor ah,ah ; Zero register
- mov bp,ax
- and bp,30h
- and al,0Fh
- xor cx,cx ; Zero register
- mov cl,al
- add cs:data_15,cx
-
- locloop_33:
- lodsb ; String [si] to al
- dec bx
- mov ah,al
- and ah,0Fh
- shr al,1 ; Shift w/zeros fill
- shr al,1 ; Shift w/zeros fill
- shr al,1 ; Shift w/zeros fill
- shr al,1 ; Shift w/zeros fill
- or bp,bp ; Zero ?
- jz loc_34 ; Jump if zero
- cmp bp,10h
- je loc_35 ; Jump if equal
- cmp bp,20h
- je loc_36 ; Jump if equal
- add dl,al
- sub dh,ah
- jmp short loc_37
-
- loc_34:
- add dl,al
- add dh,ah
- jmp short loc_37
-
- loc_35:
- sub dl,al
- add dh,ah
- jmp short loc_37
-
- loc_36:
- sub dl,al
- sub dh,ah
- loc_37:
- mov ax,dx
- stosw ; Store ax to es:[di]
- loop locloop_33 ; Loop if cx > 0
-
- jmp loc_57
- loc_38:
- xor ah,ah ; Zero register
- mov bp,ax
- and bp,30h
- or bp,bp ; Zero ?
- jz loc_42 ; Jump if zero
- cmp bp,10h
- je loc_46 ; Jump if equal
- lodsb ; String [si] to al
- dec bx
- mov ah,al
- lodsb ; String [si] to al
- dec bx
- xchg ah,al
- test al,80h
- jz loc_39 ; Jump if zero
- and al,7Fh
- sub dl,al
- jmp short loc_40
-
- loc_39:
- add dl,al
- loc_40:
- test ah,80h
- jz loc_41 ; Jump if zero
- and ah,7Fh
- sub dh,ah
- jmp loc_56
- loc_41:
- add dh,ah
- jmp loc_56
- loc_42:
- and al,0Fh
- mov ah,al
- lodsb ; String [si] to al
- dec bx
- xchg ah,al
- test al,8
- jz loc_43 ; Jump if zero
- and al,7
- sub dl,al
- jmp short loc_44
-
- loc_43:
- add dl,al
- loc_44:
- test ah,80h
- jz loc_45 ; Jump if zero
- and ah,7Fh
- sub dh,ah
- jmp short loc_56
-
- loc_45:
- add dh,ah
- jmp short loc_56
-
- loc_46:
- and al,0Fh
- mov ah,al
- lodsb ; String [si] to al
- dec bx
- test al,80h
- jz loc_47 ; Jump if zero
- and al,7Fh
- sub dl,al
- jmp short loc_48
-
- loc_47:
- add dl,al
- loc_48:
- test ah,8
- jz loc_49 ; Jump if zero
- and ah,7
- sub dh,ah
- jmp short loc_56
-
- loc_49:
- add dh,ah
- jmp short loc_56
-
- loc_50:
- and ax,3Fh
- mov cx,ax
- add cs:data_15,cx
-
- locloop_51:
- lodsb ; String [si] to al
- dec bx
- mov ah,al
- and ah,0Fh
- shr al,1 ; Shift w/zeros fill
- shr al,1 ; Shift w/zeros fill
- shr al,1 ; Shift w/zeros fill
- shr al,1 ; Shift w/zeros fill
- test al,8
- jz loc_52 ; Jump if zero
- and al,7
- sub dl,al
- jmp short loc_53
-
- loc_52:
- add dl,al
- loc_53:
- test ah,8
- jz loc_54 ; Jump if zero
- and ah,7
- sub dh,ah
- jmp short loc_55
-
- loc_54:
- add dh,ah
- loc_55:
- mov ax,dx
- stosw ; Store ax to es:[di]
- loop locloop_51 ; Loop if cx > 0
-
- jmp short loc_57
-
- loc_56:
- inc cs:data_15
- mov ax,dx
- stosw ; Store ax to es:[di]
- loc_57:
- test bx,0FFFFh
- jz loc_58 ; Jump if zero
- jmp loc_29
- loc_58:
- xor ax,ax ; Zero register
- stosw ; Store ax to es:[di]
- mov bx,cs:data_16
- mov ax,cs:data_15
- mov [bx],ax
- pop bp
- retn
- sub_3 endp
-
- data_17 dw 0
-
- ;**************************************************************************
- ; SUBROUTINE 4 fill input buffer *
- ;**************************************************************************
-
- sub_4 proc near
- push di
- push si
- test bp,1
- jz loc_59 ; Jump if zero
- xor dx,dx ; Zero register
- mov ax,data_6
- mov cx,18h
- div cx ; ax,dx rem=dx:ax/reg
- mov data_17,0
- or dx,dx ; Zero ?
- jz loc_59 ; Jump if zero
- sub cx,dx
- mov data_17,cx
- loc_59:
- mov si,offset data_56
- mov di,offset data_65
- loc_60:
- lodsw ; String [si] to ax
- or ax,ax ; Zero ?
- jnz loc_61 ; Jump if not zero
- jmp loc_74
- loc_61:
- stosw ; Store ax to es:[di]
- mov cx,ax
- loc_62:
- xor ax,ax ; Zero register
- lodsb ; String [si] to al
- cmp ax,data_13
- jb loc_63 ; Jump if below
- mov ax,data_13
- dec ax
- loc_63:
- push ax
- xor ax,ax ; Zero register
- lodsb ; String [si] to al
- cmp ax,data_13
- jb loc_64 ; Jump if below
- mov ax,data_13
- dec ax
- loc_64:
- mov bx,ax
- pop ax
- test bp,1000h
- jz loc_65 ; Jump if zero
- shr bx,1 ; Shift w/zeros fill
- jmp short loc_66
-
- loc_65:
- test bp,800h
- jz loc_66 ; Jump if zero
- shr bx,1 ; Shift w/zeros fill
- mov dx,data_13
- shr dx,1 ; Shift w/zeros fill
- add bx,dx
- loc_66:
- test bp,8000h
- jz loc_71 ; Jump if zero
- test bp,4000h
- jz loc_68 ; Jump if zero
- test bp,2000h
- jz loc_67 ; Jump if zero
- jmp short loc_69
-
- loc_67:
- mov dx,data_13
- sub dx,bx
- dec dx
- mov bx,ax
- mov ax,dx
- mov dx,data_13
- sub dx,data_14
- add bx,dx
- jmp short loc_71
-
- loc_68:
- test bp,2000h
- jz loc_70 ; Jump if zero
- loc_69:
- mov dx,data_13
- sub dx,bx
- dec dx
- mov bx,dx
- mov dx,data_14
- sub dx,ax
- dec dx
- mov ax,dx
- jmp short loc_71
-
- loc_70:
- mov dx,data_13
- sub dx,ax
- dec dx
- mov ax,bx
- mov bx,dx
- loc_71:
- push bx
- mov bx,data_4
- mul bx ; dx:ax = reg * ax
- mov bx,data_13
- div bx ; ax,dx rem=dx:ax/reg
- stosw ; Store ax to es:[di]
- pop ax
- mov bx,data_6
- mul bx ; dx:ax = reg * ax
- mov bx,data_13
- div bx ; ax,dx rem=dx:ax/reg
- test bp,1
- jz loc_72 ; Jump if zero
- add ax,data_17
- loc_72:
- stosw ; Store ax to es:[di]
- dec cx
- jz loc_73 ; Jump if zero
- jmp loc_62
- loc_73:
- jmp loc_60
- loc_74:
- stosw ; Store ax to es:[di]
- pop di
- pop si
- retn
- sub_4 endp
-
-
- ;**************************************************************************
- ; SUBROUTINE 5 *
- ;**************************************************************************
-
- sub_5 proc near
- xor dx,dx ; Zero register
- mov ax,data_19
- mov cx,8
- div cx ; ax,dx rem=dx:ax/reg
- mov data_11,dx
- mov data_10,ax
- mov cx,data_4
- add cx,7
- shr cx,1 ; Shift w/zeros fill
- shr cx,1 ; Shift w/zeros fill
- shr cx,1 ; Shift w/zeros fill
- mov data_12,cx
- mov si,offset data_56
- mov di,offset data_65
-
- locloop_75:
- push cx
- mov cx,8
-
- locloop_76:
- push si
- push cx
- mov dx,data_10
- loc_77:
- or dx,dx ; Zero ?
- jz loc_78 ; Jump if zero
- mov cx,8
- call sub_6
- inc di
- dec dx
- jmp short loc_77
- loc_78:
- mov cx,data_11
- or cx,cx ; Zero ?
- jz loc_79 ; Jump if zero
- call sub_6
- inc di
- loc_79:
- pop cx
- pop si
- loop locloop_76 ; Loop if cx > 0
-
- inc si
- pop cx
- loop locloop_75 ; Loop if cx > 0
-
- retn
- sub_5 endp
-
-
- ;**************************************************************************
- ; SUBROUTINE 6 *
- ;**************************************************************************
-
- sub_6 proc near
- or cx,cx ; Zero ?
- jz loc_ret_81 ; Jump if zero
- mov bx,cx
-
- locloop_80:
- shl byte ptr [si],1 ; Shift w/zeros fill
- rcl byte ptr [di],1 ; Rotate thru carry
- add si,data_12
- loop locloop_80 ; Loop if cx > 0
-
- mov cx,bx
- xchg ch,cl
- mov cl,8
- sub cl,ch
- jz loc_ret_81 ; Jump if zero
- shl byte ptr [di],cl ; Shift w/zeros fill
-
- loc_ret_81:
- retn
- sub_6 endp
-
- data_18 dw 0
- data_19 dw 18h
- data_20 db 0, 0
- data_21 dw 0
- data_22 db 0
- data_23 db 0
- data_24 dw 0
- data_25 dw 0
-
- ;**************************************************************************
- ; SUBROUTINE 7 *
- ;**************************************************************************
-
- sub_7 proc near
- push ax
- push bx
- push cx
- push dx
- push bp
- push di
- push es
- push cs
- pop es
- cld ; Clear direction
- mov cs:data_21,ax
- mov word ptr cs:data_20,bx
- mov cs:data_18,bp
- mov di,offset data_60
- mov cx,3200h
- xor ax,ax ; Zero register
- rep stosw ; Rep when cx >0 Store ax to es:[di]
- mov di,offset data_56
- mov cx,3200h
- rep stosb ; Rep when cx >0 Store al to es:[di]
- loc_82:
- xor ax,ax ; Zero register
- lodsw ; String [si] to ax
- mov cx,ax
- cmp cx,0
- jne loc_83 ; Jump if not equal
- jmp loc_101
- loc_83:
- push cx
- push si
- cmp cs:data_18,0
- jne loc_84 ; Jump if not equal
- lodsb ; String [si] to al
- mov cs:data_24,ax
- lodsb ; String [si] to al
- mov cs:data_25,ax
- jmp short loc_85
-
- loc_84:
- lodsw ; String [si] to ax
- mov cs:data_24,ax
- lodsw ; String [si] to ax
- mov cs:data_25,ax
- loc_85:
- dec cx
-
- locloop_86:
- push cx
- mov bx,cs:data_24
- mov dx,cs:data_25
- cmp cs:data_18,0
- jne loc_87 ; Jump if not equal
- lodsb ; String [si] to al
- mov di,ax
- lodsb ; String [si] to al
- jmp short loc_88
-
- loc_87:
- lodsw ; String [si] to ax
- mov di,ax
- lodsw ; String [si] to ax
- loc_88:
- push si
- mov si,ax
- xchg si,di
- mov cs:data_24,si
- mov cs:data_25,di
- call sub_8
- pop si
- pop cx
- jnc loc_89 ; Jump if carry=0
- loop locloop_86 ; Loop if cx > 0
-
- pop cx
- pop cx
- jmp short loc_82
- loc_89:
- pop si
- pop cx
- cmp cs:data_18,0
- jne loc_90 ; Jump if not equal
- lodsb ; String [si] to al
- mov bx,ax
- lodsb ; String [si] to al
- mov dx,ax
- jmp short loc_91
-
- loc_90:
- lodsw ; String [si] to ax
- mov bx,ax
- lodsw ; String [si] to ax
- mov dx,ax
- loc_91:
- mov cs:data_30,bx
- mov cs:data_31,dx
- mov cs:data_24,bx
- mov cs:data_25,dx
- sub dx,word ptr cs:data_20
- js loc_92 ; Jump if sign=1
- cmp dx,cs:data_19
- jae loc_92 ; Jump if above or =
- mov cs:data_22,1
- mov cs:data_23,1
- loc_92:
- dec cx
-
- locloop_93:
- push cx
- mov bx,cs:data_24
- mov dx,cs:data_25
- xor ax,ax ; Zero register
- cmp cs:data_18,0
- jne loc_94 ; Jump if not equal
- lodsb ; String [si] to al
- jmp short loc_95
-
- loc_94:
- lodsw ; String [si] to ax
- loc_95:
- mov di,ax
- cmp cs:data_18,0
- jne loc_96 ; Jump if not equal
- lodsb ; String [si] to al
- jmp short loc_97
-
- loc_96:
- lodsw ; String [si] to ax
- loc_97:
- push si
- push ds
- push cs
- pop ds
- mov si,ax
- xchg si,di
- mov cs:data_24,si
- mov cs:data_25,di
- call sub_8
- jc loc_98 ; Jump if carry Set
- call sub_9
- loc_98:
- pop ds
- pop si
- pop cx
- loop locloop_93 ; Loop if cx > 0
-
- push ds
- push si
- push cs
- pop ds
- mov bx,cs:data_24
- mov dx,cs:data_25
- mov si,cs:data_30
- mov di,cs:data_31
- call sub_8
- jc loc_99 ; Jump if carry Set
- call sub_9
- loc_99:
- cmp cs:data_22,0
- je loc_100 ; Jump if equal
- call sub_13
- loc_100:
- pop si
- pop ds
- mov cs:data_22,0
- mov cs:data_23,0
- jmp loc_82
- loc_101:
- call sub_19
- push cs
- pop ds
- mov si,offset data_56
- pop es
- pop di
- pop bp
- pop dx
- pop cx
- pop bx
- pop ax
- retn
- sub_7 endp
-
-
- ;*************************************************************************
- ; SUBROUTINE 8 *
- ;*************************************************************************
-
- sub_8 proc near
- push bx
- push si
- push dx
- push di
- mov ax,word ptr cs:data_20
- xor bp,bp ; Zero register
- sub dx,ax
- js loc_102 ; Jump if sign=1
- cmp dx,cs:data_19
- jb loc_103 ; Jump if below
- or bp,8000h
- loc_102:
- sub di,ax
- js loc_108 ; Jump if sign=1
- cmp di,cs:data_19
- jae loc_109 ; Jump if above or =
- loc_103:
- pop di
- pop dx
- push dx
- push di
- sub di,dx
- jnz loc_104 ; Jump if not zero
- or bp,4
- loc_104:
- js loc_105 ; Jump if sign=1
- or bp,1
- loc_105:
- sub si,bx
- jnz loc_106 ; Jump if not zero
- or bp,8
- loc_106:
- js loc_107 ; Jump if sign=1
- or bp,2
- loc_107:
- and bp,0Fh
- push bp
- and bp,0Ch
- cmp bp,0Ch
- pop bp
- jz loc_110 ; Jump if zero
- pop di
- pop dx
- pop si
- pop bx
- clc ; Clear carry flag
- retn
- loc_108:
- test bp,8000h
- jnz loc_103 ; Jump if not zero
- jmp short loc_110
-
- loc_109:
- test bp,8000h
- jz loc_103 ; Jump if zero
- loc_110:
- pop di
- pop dx
- pop si
- pop bx
- stc ; Set carry flag
- retn
- sub_8 endp
-
- data_26 db 0
- data_27 dw 0
- data_28 dw 0
- data_29 dw 0
-
- ;**************************************************************************
- ; SUBROUTINE 9 *
- ;**************************************************************************
-
- sub_9 proc near
- test bp,4
- jnz loc_111 ; Jump if not zero
- test bp,8
- jnz loc_112 ; Jump if not zero
- jmp short loc_117
-
- loc_111:
- mov ah,0
- call sub_12
- mov al,0
- or ax,bp
- and al,3
- mov cx,6
- shl al,cl ; Shift w/zeros fill
- mov data_26,al
- retn
- loc_112:
- mov ah,4
- call sub_12
- sub di,dx
- js loc_114 ; Jump if sign=1
- loc_113:
- dec di
- jz loc_ret_116 ; Jump if zero
- inc dx
- mov ah,4
- call sub_14
- jmp short loc_113
- loc_114:
- neg di
- loc_115:
- dec di
- jz loc_ret_116 ; Jump if zero
- dec dx
- mov ah,4
- call sub_14
- jmp short loc_115
-
- loc_ret_116:
- retn
- loc_117:
- mov data_27,si
- sub data_27,bx
- jns loc_118 ; Jump if not sign
- neg data_27
- loc_118:
- mov data_28,di
- sub data_28,dx
- jns loc_119 ; Jump if not sign
- neg data_28
- loc_119:
- mov cx,data_27
- cmp cx,data_28
- jb loc_125 ; Jump if below
- inc cx
- shr cx,1 ; Shift w/zeros fill
- mov data_29,cx
- sub si,bx
- jns loc_120 ; Jump if not sign
- neg si
- loc_120:
- mov cx,data_28
- cmp cx,data_29
- jb loc_121 ; Jump if below
- push cx
- mov ah,4
- call sub_12
- mov ah,4
- call sub_10
- pop cx
- sub cx,data_27
- jmp short loc_122
-
- loc_121:
- push cx
- mov ah,0
- call sub_12
- mov ah,0
- call sub_10
- pop cx
- loc_122:
- dec si
- jz loc_ret_124 ; Jump if zero
- add cx,data_28
- test cx,8000h
- jnz loc_123 ; Jump if not zero
- cmp cx,data_29
- jb loc_123 ; Jump if below
- push cx
- mov ah,4
- call sub_14
- mov ah,4
- call sub_10
- pop cx
- sub cx,data_27
- jmp short loc_122
- loc_123:
- push cx
- mov ah,0
- call sub_14
- mov ah,0
- call sub_10
- pop cx
- jmp short loc_122
-
- loc_ret_124:
- retn
- loc_125:
- mov cx,data_28
- xchg cx,data_27
- xchg cx,data_28
- inc cx
- shr cx,1 ; Shift w/zeros fill
- mov data_29,cx
- sub di,dx
- jns loc_126 ; Jump if not sign
- neg di
- loc_126:
- mov cx,data_28
- cmp cx,data_29
- jb loc_127 ; Jump if below
- push cx
- mov ah,4
- call sub_12
- mov ah,4
- call sub_11
- pop cx
- sub cx,data_27
- jmp short loc_128
-
- loc_127:
- push cx
- mov ah,4
- call sub_12
- mov ah,0
- call sub_11
- pop cx
- loc_128:
- dec di
- jz loc_ret_130 ; Jump if zero
- add cx,data_28
- test cx,8000h
- jnz loc_129 ; Jump if not zero
- cmp cx,data_29
- jb loc_129 ; Jump if below
- push cx
- mov ah,4
- call sub_14
- mov ah,4
- call sub_11
- pop cx
- sub cx,data_27
- jmp short loc_128
- loc_129:
- push cx
- mov ah,4
- call sub_14
- mov ah,0
- call sub_11
- pop cx
- jmp short loc_128
-
- loc_ret_130:
- retn
- sub_9 endp
-
-
- ;*************************************************************************
- ; SUBROUTINE 10 *
- ;*************************************************************************
-
- sub_10 proc near
- test bp,2
- jz loc_131 ; Jump if zero
- inc bx
- jmp short loc_132
-
- loc_131:
- dec bx
- loc_132:
- test ah,4
- jz loc_ret_134 ; Jump if zero
- test bp,1
- jz loc_133 ; Jump if zero
- inc dx
- retn
- loc_133:
- dec dx
-
- loc_ret_134:
- retn
- sub_10 endp
-
-
- ;**************************************************************************
- ; SUBROUTINE 11 *
- ;**************************************************************************
-
- sub_11 proc near
- test bp,1
- jz loc_135 ; Jump if zero
- inc dx
- jmp short loc_136
-
- loc_135:
- dec dx
- loc_136:
- test ah,4
- jz loc_ret_138 ; Jump if zero
- test bp,2
- jz loc_137 ; Jump if zero
- inc bx
- retn
- loc_137:
- dec bx
-
- loc_ret_138:
- retn
- sub_11 endp
-
- data_30 dw 0
- data_31 dw 0
- data_32 db 0
-
- ;**************************************************************************
- ; SUBROUTINE 12 *
- ;**************************************************************************
-
- sub_12 proc near
- cmp data_23,1
- jne loc_139 ; Jump if not equal
- mov data_30,bx
- mov data_31,dx
- mov al,0
- or ax,bp
- and al,3
- mov cx,4
- shl al,cl ; Shift w/zeros fill
- or ah,al
- shl al,1 ; Shift w/zeros fill
- shl al,1 ; Shift w/zeros fill
- or ah,al
- mov al,ah
- mov data_32,al
- mov data_26,al
- mov data_23,0
- retn
- loc_139:
- mov al,0
- or ax,bp
- and al,3
- mov cx,4
- shl al,cl ; Shift w/zeros fill
- push ax
- and data_26,0CFh
- or data_26,al
- call sub_14
- pop ax
- shl al,1 ; Shift w/zeros fill
- shl al,1 ; Shift w/zeros fill
- and data_26,3Fh ; '?'
- or data_26,al
- retn
- sub_12 endp
-
-
- ;**************************************************************************
- ; SUBROUTINE 13 *
- ;**************************************************************************
-
- sub_13 proc near
- mov bx,data_30
- mov dx,data_31
- mov ah,data_32
- and ah,4
- mov al,data_32
- and al,30h ; '0'
- and data_26,0CFh
- or data_26,al
- call sub_14
- retn
- sub_13 endp
-
- data_33 db 0 ; Data table (indexed access)
- db 01h, 02h, 03h, 00h, 01h, 02h
- db 03h, 02h, 03h, 0Ah, 02h, 02h
- db 03h, 0Ah, 02h, 00h, 01h, 02h
- db 03h, 01h, 05h, 03h, 01h, 02h
- db 03h, 0Ah, 02h, 03h, 01h, 02h
- db 03h, 01h, 05h, 03h, 01h, 00h
- db 01h, 02h, 03h, 00h, 01h, 02h
- db 03h, 02h, 03h, 0Ah, 02h, 01h
- db 05h, 03h, 01h, 01h, 05h, 03h
- db 01h, 03h, 01h, 02h, 03h, 03h
- db 01h, 02h, 03h, 00h, 01h, 02h
- db 03h, 00h, 01h, 02h, 03h, 00h
- db 01h, 02h, 03h, 00h, 01h, 02h
- db 03h, 00h, 01h, 02h, 03h, 01h
- db 05h, 03h, 01h, 00h, 01h, 02h
- db 03h, 01h, 05h, 03h, 01h, 01h
- db 05h, 03h, 01h, 03h, 01h, 02h
- db 03h, 01h, 05h, 03h, 01h, 03h
- db 01h, 02h, 03h, 01h, 05h, 03h
- db 01h, 01h, 05h, 03h, 01h, 01h
- db 05h, 03h, 01h, 01h, 05h, 03h
- db 01h, 02h, 03h, 0Ah, 02h, 02h
- db 03h, 0Ah, 02h, 02h, 03h, 0Ah
- db 02h, 02h, 03h, 0Ah, 02h, 02h
- db 03h, 0Ah, 02h, 03h, 01h, 02h
- db 03h, 02h, 03h, 0Ah, 02h, 03h
- db 01h, 02h, 03h, 00h, 01h, 02h
- db 03h, 02h, 03h, 0Ah, 02h, 00h
- db 01h, 02h, 03h, 02h, 03h, 0Ah
- db 02h, 00h, 01h, 02h, 03h, 00h
- db 01h, 02h, 03h, 00h, 01h, 02h
- db 03h, 00h, 01h, 02h, 03h, 02h
- db 03h, 0Ah, 02h, 02h, 03h, 0Ah
- db 02h, 03h, 01h, 02h, 03h, 03h
- db 01h, 02h, 03h, 02h, 03h, 0Ah
- db 02h, 00h, 01h, 02h, 03h, 00h
- db 01h, 02h, 03h, 01h, 05h, 03h
- db 01h, 00h, 01h, 02h, 03h, 02h
- db 03h, 0Ah, 02h, 01h, 05h, 03h
- db 01h, 03h, 01h, 02h, 03h, 00h
- db 01h, 02h, 03h, 00h, 01h, 02h
- db 03h, 01h, 05h, 03h, 01h, 01h
- db 05h, 03h, 01h
-
- ;**************************************************************************
- ; SUBROUTINE 14 *
- ;**************************************************************************
-
- sub_14 proc near
- push bx
- push dx
- sub dx,word ptr data_20
- js loc_142 ; Jump if sign=1
- cmp dx,cs:data_19
- jae loc_142 ; Jump if above or =
- push ax
- mov ax,dx
- mul data_21 ; ax = data * ax
- shl ax,1 ; Shift w/zeros fill
- mov cx,bx
- and cx,3
- shr bx,1 ; Shift w/zeros fill
- shr bx,1 ; Shift w/zeros fill
- add ax,bx
- shl cx,1 ; Shift w/zeros fill
- mov bx,ax
- pop ax
- mov al,byte ptr data_60[bx]
- shl al,cl ; Shift w/zeros fill
- and al,0C0h
- rol al,1 ; Rotate
- rol al,1 ; Rotate
- or al,ah
- call sub_17
- push bx
- xor bh,bh ; Zero register
- mov bl,data_26
- mov al,data_33[bx]
- pop bx
- test al,3
- jz loc_141 ; Jump if zero
- test al,4
- jnz loc_143 ; Jump if not zero
- test al,8
- jnz loc_145 ; Jump if not zero
- loc_140:
- call sub_18
- loc_141:
- pop dx
- pop bx
- retn
- loc_142:
- mov al,ah
- call sub_17
- pop dx
- pop bx
- retn
- loc_143:
- push cx
- push bx
- push ax
- inc cl
- inc cl
- cmp cl,8
- jne loc_144 ; Jump if not equal
- mov cl,0
- inc bx
- loc_144:
- mov al,1
- call sub_15
- pop ax
- pop bx
- pop cx
- jmp short loc_140
- loc_145:
- push cx
- push bx
- push ax
- dec cl
- dec cl
- jns loc_146 ; Jump if not sign
- mov cl,6
- dec bx
- loc_146:
- mov al,2
- call sub_16
- pop ax
- pop bx
- pop cx
- jmp short loc_140
- sub_14 endp
-
- data_34 dw offset loc_147 ; Data table (indexed access)
- data_35 dw offset loc_150
- data_36 dw offset loc_149
- data_37 dw offset loc_147
-
- ;**************************************************************************
- ; SUBROUTINE 15 *
- ;**************************************************************************
-
- sub_15 proc near
- push cx
- push bx
- push ax
- mov al,byte ptr data_60[bx]
- shl al,cl ; Shift w/zeros fill
- and al,0C0h
- rol al,1 ; Rotate
- rol al,1 ; Rotate
- push bx
- xor bh,bh ; Zero register
- mov bl,al
- shl bx,1 ; Shift w/zeros fill
- jmp word ptr cs:data_34[bx] ;*4 entries
-
- ;--------Indexed Entry Point ----------------------------------------------
-
- loc_147:
- mov al,1
- loc_148:
- pop bx
- call sub_18
- jmp short loc_152
- db 90h
-
- ;----- Indexed Entry Point -------------------------------------------------
-
- loc_149:
- mov al,3
- jmp short loc_148
-
- ;----- Indexed Entry Point -----------------------------------------------─
-
- loc_150:
- pop bx
- inc cl
- inc cl
- cmp cl,8
- jne loc_151 ; Jump if not equal
- mov cl,0
- inc bx
- loc_151:
- call sub_15
- loc_152:
- pop ax
- pop bx
- pop cx
- retn
- sub_15 endp
-
- data_38 dw offset loc_153 ; Data table (indexed access)
- data_39 dw offset loc_155
- data_40 dw offset loc_156
- data_41 dw offset loc_153
-
- ;**************************************************************************
- ; SUBROUTINE 16 *
- ;**************************************************************************
-
- sub_16 proc near
- push cx
- push bx
- push ax
- mov al,byte ptr data_60[bx]
- shl al,cl ; Shift w/zeros fill
- and al,0C0h
- rol al,1 ; Rotate
- rol al,1 ; Rotate
- push bx
- xor bh,bh ; Zero register
- mov bl,al
- shl bx,1 ; Shift w/zeros fill
- jmp word ptr cs:data_38[bx] ;*4 entries
-
- ;----- Indexed Entry Point -------------------------------------------------
-
- loc_153:
- mov al,2
- loc_154:
- pop bx
- call sub_18
- jmp short loc_152
-
- ;----- Indexed Entry Point -------------------------------------------------
-
- loc_155:
- mov al,3
- jmp short loc_154
-
- ;----- Indexed Entry Point ------------------------------------------------
-
- loc_156:
- pop bx
- dec cl
- dec cl
- jns loc_157 ; Jump if not sign
- mov cl,6
- dec bx
- loc_157:
- call sub_16
- pop ax
- pop bx
- pop cx
- retn
- sub_16 endp
-
-
- ;**************************************************************************
- ; SUBROUTINE 17 *
- ;**************************************************************************
-
- sub_17 proc near
- mov ah,data_26
- and ah,4
- shl ah,1 ; Shift w/zeros fill
- or al,ah
- and data_26,0F0h
- or data_26,al
- retn
- sub_17 endp
-
-
- ;**************************************************************************
- ; SUBROUTINE 18 *
- ;**************************************************************************
-
- sub_18 proc near
- mov ah,al
- mov al,byte ptr data_60[bx]
- rol al,cl ; Rotate
- shl al,1 ; Shift w/zeros fill
- shl al,1 ; Shift w/zeros fill
- shr ax,1 ; Shift w/zeros fill
- shr ax,1 ; Shift w/zeros fill
- ror al,cl ; Rotate
- mov byte ptr data_60[bx],al
- retn
- sub_18 endp
-
- data_42 dw offset loc_162 ; Data table (indexed access)
- data_43 dw offset loc_164
- data_44 dw offset loc_165
- data_45 dw offset loc_166
-
- ;***************************************************************************
- ; SUBROUTINE 19 *
- ;***************************************************************************
-
- sub_19 proc near
- xor ax,ax ; Zero register
- xor bx,bx ; Zero register
- push cs
- push cs
- pop ds
- pop es
- mov si,offset data_60
- mov di,offset data_56
- mov dx,cs:data_19
- loc_158:
- xor bp,bp ; Zero register
- mov cx,data_21
-
- locloop_159:
- push cx
- mov cx,2
-
- locloop_160:
- push cx
- mov cx,4
- mov al,[si]
-
- locloop_161:
- shl ax,1 ; Shift w/zeros fill
- shl ax,1 ; Shift w/zeros fill
- mov bl,ah
- shl bx,1 ; Shift w/zeros fill
- jmp word ptr cs:data_42[bx] ;*4 entries
-
- ;----- Indexed Entry Point ---------------------------------------------
-
- loc_162:
- cmp bp,0
- jne loc_163 ; Jump if not equal
- clc ; Clear carry flag
- jmp short loc_167
- db 90h
- loc_163:
- stc ; Set carry flag
- jmp short loc_167
- db 90h
-
- ;----- Indexed Entry Point -----------------------------------------------─
-
- loc_164:
- inc bp
- stc ; Set carry flag
- jmp short loc_167
- db 90h
-
- ;----- Indexed Entry Point ------------------------------------------------
-
- loc_165:
- dec bp
-
- ;----- Indexed Entry Point ------------------------------------------------
-
- loc_166:
- stc ; Set carry flag
- loc_167:
- rcl byte ptr [di],1 ; Rotate thru carry
- xor ah,ah ; Zero register
- loop locloop_161 ; Loop if cx > 0
-
- pop cx
- inc si
- loop locloop_160 ; Loop if cx > 0
-
- pop cx
- inc di
- loop locloop_159 ; Loop if cx > 0
-
- dec dx
- jnz loc_158 ; Jump if not zero
- retn
- sub_19 endp
-
- data_49 dw 0
- data_51 db 0
-
- ;**************************************************************************
- ; SUBROUTINE 21 open file *
- ;**************************************************************************
-
- sub_21 proc near
- push ax
- push bx
- push cx
- push bp
- push dx
- push si
- push di
- push es
- mov cs:data_51,0
- push ds
- mov ds,ax
- mov ax,3D00h
- int 21h ; DOS Services ah=function 3Dh
- pop ds ; open file, al=mode,name@ds:dx
- jc loc_174 ; Jump if carry Set
- mov data_55,ax
- jmp short loc_175
- loc_174:
- mov ax,80h
- mov data_55,ax
- stc ; Set carry flag
- loc_175:
- pop es
- pop di
- pop si
- pop dx
- pop bp
- pop cx
- pop bx
- pop ax
- retn
- sub_21 endp
-
-
- ;**************************************************************************
- ; SUBROUTINE 22 close file *
- ;**************************************************************************
-
- sub_22 proc near
- push ax
- push bx
- push cx
- push dx
- mov ah,3Eh ; '>'
- mov bx,cs:data_55
- cmp bx,5
- jl loc_176 ; Jump if <
- int 21h ; DOS Services ah=function 3Eh
- ; close file, bx=file handle
- loc_176:
- pop dx
- pop cx
- pop bx
- pop ax
- retn
- sub_22 endp
-
- ;*************************************************************************
- ; The following area is data buffer of the program.
-
- data_55 dw 80h
- data_56 dw 8932 dup (0)
- db 0
- db 2297 dup (0)
- db 0 ; Data table (indexed access)
- db 5437 dup (0)
- data_60 dw 0 ; Data table (indexed access)
- data_61 dw 0
- data_62 dw 0
- db 2748 dup (0)
- db 0 ; Data table (indexed access)
- db 10045 dup (0)
- data_64 db 0
- db 12799 dup (0)
- data_65 dw 0
- db 1998 dup (0)
-
-
- recovery ends
- end
-