mirror of https://github.com/nmlgc/ReC98.git
6455 lines
103 KiB
NASM
6455 lines
103 KiB
NASM
;
|
||
; +-------------------------------------------------------------------------+
|
||
; | This file has been generated by The Interactive Disassembler (IDA) |
|
||
; | Copyright (c) 2009 by Hex-Rays, <support@hex-rays.com> |
|
||
; +-------------------------------------------------------------------------+
|
||
;
|
||
; Input MD5 : DE5454973591EBD937B11452A8B4882D
|
||
|
||
; File Name : th01/ZUNSOFT.COM
|
||
; Format : MS-DOS COM-file
|
||
; Base Address: 0h Range: 100h-2870h Loaded length: 2770h
|
||
; OS type : MS DOS
|
||
; Application type: Executable 16bit
|
||
|
||
.386
|
||
.model tiny
|
||
|
||
include libs/BorlandC/RULES.ASI
|
||
|
||
; ===========================================================================
|
||
|
||
; Segment type: Pure code
|
||
seg000 segment byte public 'CODE' use16
|
||
assume cs:seg000
|
||
org 100h
|
||
assume es:nothing, ss:nothing, ds:seg000, fs:nothing, gs:nothing
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: library function noreturn
|
||
|
||
public start
|
||
start proc near
|
||
mov dx, cs
|
||
mov cs:DGROUP@, dx
|
||
mov ah, 30h
|
||
int 21h ; DOS - GET DOS VERSION
|
||
; Return: AL = major version number (00h for DOS 1.x)
|
||
mov bp, ds:2
|
||
mov bx, ds:2Ch
|
||
mov ds, dx
|
||
mov word_21B8, ax
|
||
mov word_21B6, es
|
||
mov word_21B2, bx
|
||
mov word_21CC, bp
|
||
call sub_26E
|
||
mov ax, word_21B2
|
||
mov es, ax
|
||
xor ax, ax
|
||
mov bx, ax
|
||
mov di, ax
|
||
mov cx, 7FFFh
|
||
cld
|
||
|
||
loc_136:
|
||
repne scasb
|
||
jcxz short loc_19B
|
||
inc bx
|
||
cmp es:[di], al
|
||
jnz short loc_136
|
||
or ch, 80h
|
||
neg cx
|
||
mov word_21B0, cx
|
||
mov cx, 1
|
||
shl bx, cl
|
||
add bx, 8
|
||
and bx, 0FFF8h
|
||
mov word_21B4, bx
|
||
mov dx, ds
|
||
sub bp, dx
|
||
mov di, word_285C
|
||
cmp di, 200h
|
||
jnb short loc_16D
|
||
mov di, 200h
|
||
mov word_285C, di
|
||
|
||
loc_16D:
|
||
add di, 33A0h
|
||
jb short loc_19B
|
||
add di, word_27FE
|
||
jb short loc_19B
|
||
mov cl, 4
|
||
shr di, cl
|
||
inc di
|
||
cmp bp, di
|
||
jb short loc_19B
|
||
cmp word_285C, 0
|
||
jz short loc_190
|
||
cmp word_27FE, 0
|
||
jnz short loc_19E
|
||
|
||
loc_190:
|
||
mov di, 1000h
|
||
cmp bp, di
|
||
ja short loc_19E
|
||
mov di, bp
|
||
jmp short loc_19E
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_19B:
|
||
call __abort
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_19E:
|
||
mov bx, di
|
||
add bx, dx
|
||
mov word_21C4, bx
|
||
mov word_21C8, bx
|
||
mov ax, word_21B6
|
||
sub bx, ax
|
||
mov es, ax
|
||
mov ah, 4Ah
|
||
push di
|
||
int 21h ; DOS - 2+ - ADJUST MEMORY BLOCK SIZE (SETBLOCK)
|
||
; ES = segment address of block to change
|
||
; BX = new size in paragraphs
|
||
pop di
|
||
shl di, cl
|
||
cli
|
||
mov ss, dx
|
||
mov sp, di
|
||
sti
|
||
xor ax, ax
|
||
mov es, cs:DGROUP@
|
||
mov di, 2870h
|
||
mov cx, 33A0h
|
||
sub cx, di
|
||
cld
|
||
rep stosb
|
||
cmp word_27D4, 14h
|
||
jbe short loc_21F
|
||
cmp byte ptr word_21B8, 3
|
||
jb short loc_21F
|
||
ja short loc_1E8
|
||
cmp byte ptr word_21B8+1, 1Eh
|
||
jb short loc_21F
|
||
|
||
loc_1E8:
|
||
mov ax, 5801h
|
||
mov bx, 2
|
||
int 21h ; DOS - 3+ - GET/SET MEMORY ALLOCATION STRATEGY
|
||
; AL = function code: set allocation strategy
|
||
jb short loc_21C
|
||
mov ah, 67h
|
||
mov bx, word_27D4
|
||
int 21h ; DOS - 3.3+ - SET HANDLE COUNT
|
||
; BX = desired number of handles (max 255)
|
||
jb short loc_21C
|
||
mov ah, 48h
|
||
mov bx, 1
|
||
int 21h ; DOS - 2+ - ALLOCATE MEMORY
|
||
; BX = number of 16-byte paragraphs desired
|
||
jb short loc_21C
|
||
inc ax
|
||
mov word_21CC, ax
|
||
dec ax
|
||
mov es, ax
|
||
assume es:nothing
|
||
mov ah, 49h
|
||
int 21h ; DOS - 2+ - FREE MEMORY
|
||
; ES = segment address of area to be freed
|
||
jb short loc_21C
|
||
mov ax, 5801h
|
||
mov bx, 0
|
||
int 21h ; DOS - 3+ - GET/SET MEMORY ALLOCATION STRATEGY
|
||
; AL = function code: set allocation strategy
|
||
jnb short loc_21F
|
||
|
||
loc_21C:
|
||
call __abort
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_21F:
|
||
xor bp, bp
|
||
mov es, cs:DGROUP@
|
||
assume es:nothing
|
||
mov si, 286Ah
|
||
mov di, 2870h
|
||
call sub_2DE
|
||
push envp ; envp
|
||
push argv ; argv
|
||
push argc ; argc
|
||
call _main
|
||
push ax ; status
|
||
call _exit
|
||
; ---------------------------------------------------------------------------
|
||
|
||
__cleanup:
|
||
mov es, cs:DGROUP@
|
||
push si
|
||
push di
|
||
mov si, 2870h
|
||
mov di, 2870h
|
||
call sub_322
|
||
pop di
|
||
pop si
|
||
retn
|
||
start endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: library function
|
||
|
||
__checknull proc near
|
||
retn
|
||
__checknull endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: library function noreturn bp-based frame
|
||
|
||
__terminate proc near
|
||
|
||
arg_0 = byte ptr 2
|
||
|
||
mov bp, sp
|
||
mov ah, 4Ch
|
||
mov al, [bp+arg_0]
|
||
int 21h ; DOS - 2+ - QUIT WITH EXIT CODE (EXIT)
|
||
__terminate endp ; AL = exit code
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: noreturn
|
||
|
||
sub_25F proc near
|
||
mov dx, 218Bh
|
||
push dx ; buf
|
||
call ___ErrorMessage
|
||
pop dx
|
||
mov ax, 3
|
||
push ax ; status
|
||
call __exit
|
||
sub_25F endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
|
||
sub_26E proc near
|
||
push ds
|
||
mov ax, 3500h
|
||
int 21h ; DOS - 2+ - GET INTERRUPT VECTOR
|
||
; AL = interrupt number
|
||
; Return: ES:BX = value of interrupt vector
|
||
mov word ptr dword_219A, bx
|
||
mov word ptr dword_219A+2, es
|
||
mov ax, 3504h
|
||
int 21h ; DOS - 2+ - GET INTERRUPT VECTOR
|
||
; AL = interrupt number
|
||
; Return: ES:BX = value of interrupt vector
|
||
mov word ptr dword_219E, bx
|
||
mov word ptr dword_219E+2, es
|
||
mov ax, 3505h
|
||
int 21h ; DOS - 2+ - GET INTERRUPT VECTOR
|
||
; AL = interrupt number
|
||
; Return: ES:BX = value of interrupt vector
|
||
mov word ptr dword_21A2, bx
|
||
mov word ptr dword_21A2+2, es
|
||
mov ax, 3506h
|
||
int 21h ; DOS - 2+ - GET INTERRUPT VECTOR
|
||
; AL = interrupt number
|
||
; Return: ES:BX = value of interrupt vector
|
||
mov word ptr dword_21A6, bx
|
||
mov word ptr dword_21A6+2, es
|
||
mov ax, 2500h
|
||
mov dx, cs
|
||
mov ds, dx
|
||
mov dx, 25Fh
|
||
int 21h ; DOS - SET INTERRUPT VECTOR
|
||
; AL = interrupt number
|
||
; DS:DX = new vector to be used for specified interrupt
|
||
pop ds
|
||
retn
|
||
sub_26E endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: library function
|
||
|
||
__restorezero proc near
|
||
push ds
|
||
mov ax, 2500h
|
||
lds dx, dword_219A
|
||
int 21h ; DOS - SET INTERRUPT VECTOR
|
||
; AL = interrupt number
|
||
; DS:DX = new vector to be used for specified interrupt
|
||
pop ds
|
||
push ds
|
||
mov ax, 2504h
|
||
lds dx, dword_219E
|
||
int 21h ; DOS - SET INTERRUPT VECTOR
|
||
; AL = interrupt number
|
||
; DS:DX = new vector to be used for specified interrupt
|
||
pop ds
|
||
push ds
|
||
mov ax, 2505h
|
||
lds dx, dword_21A2
|
||
int 21h ; DOS - SET INTERRUPT VECTOR
|
||
; AL = interrupt number
|
||
; DS:DX = new vector to be used for specified interrupt
|
||
pop ds
|
||
push ds
|
||
mov ax, 2506h
|
||
lds dx, dword_21A6
|
||
int 21h ; DOS - SET INTERRUPT VECTOR
|
||
; AL = interrupt number
|
||
; DS:DX = new vector to be used for specified interrupt
|
||
pop ds
|
||
retn
|
||
__restorezero endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
|
||
sub_2DE proc near
|
||
mov ax, 100h
|
||
mov dx, di
|
||
mov bx, si
|
||
|
||
loc_2E5:
|
||
cmp bx, di
|
||
jz short loc_302
|
||
cmp byte ptr es:[bx], 0FFh
|
||
jz short loc_2FD
|
||
mov cl, es:[bx+1]
|
||
xor ch, ch
|
||
cmp cx, ax
|
||
jnb short loc_2FD
|
||
mov ax, cx
|
||
mov dx, bx
|
||
|
||
loc_2FD:
|
||
add bx, 6
|
||
jmp short loc_2E5
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_302:
|
||
cmp dx, di
|
||
jz short locret_321
|
||
mov bx, dx
|
||
cmp byte ptr es:[bx], 0
|
||
mov byte ptr es:[bx], 0FFh
|
||
push es
|
||
jz short loc_31A
|
||
call dword ptr es:[bx+2]
|
||
pop es
|
||
jmp short sub_2DE
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_31A:
|
||
call word ptr es:[bx+2]
|
||
pop es
|
||
jmp short sub_2DE
|
||
; ---------------------------------------------------------------------------
|
||
|
||
locret_321:
|
||
retn
|
||
sub_2DE endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
|
||
sub_322 proc near
|
||
mov ah, 0
|
||
mov dx, di
|
||
mov bx, si
|
||
|
||
loc_328:
|
||
cmp bx, di
|
||
jz short loc_343
|
||
cmp byte ptr es:[bx], 0FFh
|
||
jz short loc_33E
|
||
cmp es:[bx+1], ah
|
||
jb short loc_33E
|
||
mov ah, es:[bx+1]
|
||
mov dx, bx
|
||
|
||
loc_33E:
|
||
add bx, 6
|
||
jmp short loc_328
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_343:
|
||
cmp dx, di
|
||
jz short locret_362
|
||
mov bx, dx
|
||
cmp byte ptr es:[bx], 0
|
||
mov byte ptr es:[bx], 0FFh
|
||
push es
|
||
jz short loc_35B
|
||
call dword ptr es:[bx+2]
|
||
pop es
|
||
jmp short sub_322
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_35B:
|
||
call word ptr es:[bx+2]
|
||
pop es
|
||
jmp short sub_322
|
||
; ---------------------------------------------------------------------------
|
||
|
||
locret_362:
|
||
retn
|
||
sub_322 endp
|
||
|
||
; ---------------------------------------------------------------------------
|
||
DGROUP@ dw 0
|
||
__MMODEL db 2 dup(0)
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: bp-based frame
|
||
|
||
sub_367 proc near
|
||
push bp
|
||
mov bp, sp
|
||
mov dx, 0A6h
|
||
mov al, 1
|
||
out dx, al ; Interrupt Controller #2, 8259A
|
||
call sub_928
|
||
mov dx, 0A6h
|
||
mov al, 0
|
||
out dx, al ; Interrupt Controller #2, 8259A
|
||
call sub_928
|
||
mov dx, 0A4h
|
||
mov al, 0
|
||
out dx, al ; Interrupt Controller #2, 8259A
|
||
pop bp
|
||
retn
|
||
sub_367 endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: bp-based frame
|
||
|
||
sub_384 proc near
|
||
push bp
|
||
mov bp, sp
|
||
call sub_1344
|
||
call sub_958
|
||
call sub_AB6
|
||
call sub_8B8
|
||
call sub_8AC
|
||
call sub_155E
|
||
call sub_367
|
||
call sub_87A
|
||
mov byte ptr ds:2870h, 0
|
||
mov byte ptr ds:2871h, 1
|
||
push 60h
|
||
push 64h
|
||
push 21Fh
|
||
push 12Bh
|
||
call sub_139C
|
||
call sub_94C
|
||
push 21CEh
|
||
call sub_D16
|
||
call sub_978
|
||
mov word_2248, 0
|
||
call sub_978
|
||
call sub_952
|
||
pop bp
|
||
retn
|
||
sub_384 endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: bp-based frame
|
||
|
||
sub_3D0 proc near
|
||
push bp
|
||
mov bp, sp
|
||
call sub_F68
|
||
call sub_367
|
||
call sub_136A
|
||
call sub_87A
|
||
call sub_155E
|
||
pop bp
|
||
retn
|
||
sub_3D0 endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: bp-based frame
|
||
|
||
sub_3E4 proc near
|
||
|
||
arg_0 = word ptr 4
|
||
arg_2 = byte ptr 6
|
||
arg_4 = word ptr 8
|
||
arg_6 = word ptr 0Ah
|
||
|
||
push bp
|
||
mov bp, sp
|
||
push si
|
||
push di
|
||
mov si, [bp+arg_6]
|
||
mov di, [bp+arg_4]
|
||
mov ax, [bp+arg_0]
|
||
cwd
|
||
mov bl, [bp+arg_2]
|
||
mov bh, 0
|
||
and bx, 0FFh
|
||
add bx, bx
|
||
push ax
|
||
mov ax, [bx+2368h]
|
||
push dx
|
||
cwd
|
||
pop cx
|
||
pop bx
|
||
call N_LXMUL@
|
||
mov cl, 8
|
||
call near ptr N_LXRSH@
|
||
mov [si], ax
|
||
mov ax, [bp+arg_0]
|
||
cwd
|
||
mov bl, [bp+arg_2]
|
||
mov bh, 0
|
||
and bx, 0FFh
|
||
add bx, bx
|
||
push ax
|
||
mov ax, [bx+22E8h]
|
||
push dx
|
||
cwd
|
||
pop cx
|
||
pop bx
|
||
call N_LXMUL@
|
||
mov cl, 8
|
||
call near ptr N_LXRSH@
|
||
mov [di], ax
|
||
pop di
|
||
pop si
|
||
pop bp
|
||
retn 8
|
||
sub_3E4 endp ; sp-analysis failed
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: bp-based frame
|
||
|
||
sub_439 proc near
|
||
push bp
|
||
mov bp, sp
|
||
push si
|
||
mov word ptr ds:2878h, 80h
|
||
mov word ptr ds:2952h, 0FFF8h
|
||
mov word ptr ds:287Ah, 140h
|
||
mov word ptr ds:295Ah, 8
|
||
mov word ptr ds:287Ch, 100h
|
||
|
||
loc_45B:
|
||
mov word ptr ds:2954h, 0FFF8h
|
||
mov word ptr ds:287Eh, 0F0h
|
||
mov word ptr ds:295Ch, 8
|
||
mov word ptr ds:2880h, 180h
|
||
mov word ptr ds:2956h, 0FFF8h
|
||
mov word ptr ds:2882h, 0A0h
|
||
mov word ptr ds:295Eh, 8
|
||
mov word ptr ds:2884h, 200h
|
||
mov word ptr ds:2958h, 0FFF8h
|
||
mov word ptr ds:2886h, 50h
|
||
mov word ptr ds:2960h, 8
|
||
mov word ptr ds:2950h, 0
|
||
mov byte ptr ds:2872h, 0
|
||
mov byte ptr ds:2873h, 0
|
||
mov byte ptr ds:2874h, 17h
|
||
mov byte ptr ds:2875h, 0
|
||
mov byte ptr ds:2876h, 0
|
||
xor si, si
|
||
jmp short loc_4F5
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_4C0:
|
||
call sub_16B2
|
||
mov bx, 280h
|
||
cwd
|
||
idiv bx
|
||
mov bx, si
|
||
shl bx, 2
|
||
mov [bx+2888h], dx
|
||
call sub_16B2
|
||
mov bx, 190h
|
||
cwd
|
||
idiv bx
|
||
mov bx, si
|
||
shl bx, 2
|
||
mov [bx+288Ah], dx
|
||
call sub_16B2
|
||
mov bx, 20h
|
||
cwd
|
||
idiv bx
|
||
add dl, 6
|
||
mov [si+2963h], dl
|
||
inc si
|
||
|
||
loc_4F5:
|
||
cmp si, 32h
|
||
jl short loc_4C0
|
||
mov byte ptr ds:2962h, 40h
|
||
pop si
|
||
|
||
loc_500:
|
||
pop bp
|
||
retn
|
||
sub_439 endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: bp-based frame
|
||
|
||
sub_502 proc near
|
||
push bp
|
||
mov bp, sp
|
||
push si
|
||
mov si, 3
|
||
jmp loc_5A6
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_50C:
|
||
push 0C0h
|
||
mov al, [si+21D9h]
|
||
cbw
|
||
push ax
|
||
call sub_14B4
|
||
mov bx, si
|
||
shl bx, 2
|
||
push word ptr [bx+2878h]
|
||
mov bx, si
|
||
shl bx, 2
|
||
push word ptr [bx+287Ah]
|
||
push 60h
|
||
call sub_1588
|
||
mov bx, si
|
||
add bx, bx
|
||
mov ax, [bx+2952h]
|
||
mov bx, si
|
||
shl bx, 2
|
||
add [bx+2878h], ax
|
||
mov bx, si
|
||
add bx, bx
|
||
mov ax, [bx+295Ah]
|
||
mov bx, si
|
||
shl bx, 2
|
||
|
||
loc_54D:
|
||
add [bx+287Ah], ax
|
||
mov bx, si
|
||
shl bx, 2
|
||
cmp word ptr [bx+2878h], 20h
|
||
jle short loc_56A
|
||
mov bx, si
|
||
shl bx, 2
|
||
cmp word ptr [bx+2878h], 25Fh
|
||
jle short loc_57B
|
||
|
||
loc_56A:
|
||
mov bx, si
|
||
add bx, bx
|
||
mov dx, 0FFFFh
|
||
mov ax, [bx+2952h]
|
||
imul dx
|
||
mov [bx+2952h], ax
|
||
|
||
loc_57B:
|
||
mov bx, si
|
||
shl bx, 2
|
||
cmp word ptr [bx+287Ah], 20h
|
||
jle short loc_594
|
||
mov bx, si
|
||
shl bx, 2
|
||
cmp word ptr [bx+287Ah], 16Fh
|
||
jle short loc_5A5
|
||
|
||
loc_594:
|
||
mov bx, si
|
||
add bx, bx
|
||
mov dx, 0FFFFh
|
||
mov ax, [bx+295Ah]
|
||
imul dx
|
||
mov [bx+295Ah], ax
|
||
|
||
loc_5A5:
|
||
dec si
|
||
|
||
loc_5A6:
|
||
or si, si
|
||
jl short loc_5AD
|
||
jmp loc_50C
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_5AD:
|
||
mov dx, 7Ch
|
||
mov al, 0
|
||
out dx, al
|
||
pop si
|
||
pop bp
|
||
retn
|
||
sub_502 endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: bp-based frame
|
||
|
||
sub_5B6 proc near
|
||
|
||
var_4 = word ptr -4
|
||
var_2 = word ptr -2
|
||
|
||
enter 4, 0
|
||
push si
|
||
push 0C0h
|
||
push 5
|
||
call sub_14B4
|
||
xor si, si
|
||
jmp loc_66E
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_5C8:
|
||
mov bx, si
|
||
shl bx, 2
|
||
push word ptr [bx+2888h]
|
||
mov bx, si
|
||
shl bx, 2
|
||
push word ptr [bx+288Ah]
|
||
call sub_14E4
|
||
lea ax, [bp+var_2]
|
||
push ax
|
||
lea ax, [bp+var_4]
|
||
push ax
|
||
push word ptr ds:2962h
|
||
mov al, [si+2963h]
|
||
mov ah, 0
|
||
push ax
|
||
call sub_3E4
|
||
mov bx, si
|
||
shl bx, 2
|
||
mov ax, [bp+var_2]
|
||
add [bx+2888h], ax
|
||
mov bx, si
|
||
shl bx, 2
|
||
mov ax, [bp+var_4]
|
||
add [bx+288Ah], ax
|
||
mov bx, si
|
||
shl bx, 2
|
||
cmp word ptr [bx+2888h], 0
|
||
jge short loc_624
|
||
mov bx, si
|
||
shl bx, 2
|
||
add word ptr [bx+2888h], 280h
|
||
jmp short loc_63C
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_624:
|
||
mov bx, si
|
||
shl bx, 2
|
||
cmp word ptr [bx+2888h], 280h
|
||
jl short loc_63C
|
||
mov bx, si
|
||
shl bx, 2
|
||
sub word ptr [bx+2888h], 280h
|
||
|
||
loc_63C:
|
||
mov bx, si
|
||
shl bx, 2
|
||
cmp word ptr [bx+288Ah], 0
|
||
jge short loc_655
|
||
mov bx, si
|
||
shl bx, 2
|
||
add word ptr [bx+288Ah], 190h
|
||
jmp short loc_66D
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_655:
|
||
mov bx, si
|
||
shl bx, 2
|
||
cmp word ptr [bx+288Ah], 190h
|
||
jl short loc_66D
|
||
mov bx, si
|
||
shl bx, 2
|
||
sub word ptr [bx+288Ah], 190h
|
||
|
||
loc_66D:
|
||
inc si
|
||
|
||
loc_66E:
|
||
cmp si, 32h
|
||
jge short loc_676
|
||
jmp loc_5C8
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_676:
|
||
inc byte ptr ds:2962h
|
||
mov dx, 7Ch
|
||
mov al, 0
|
||
out dx, al
|
||
pop si
|
||
leave
|
||
retn
|
||
sub_5B6 endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: bp-based frame
|
||
|
||
sub_683 proc near
|
||
push bp
|
||
mov bp, sp
|
||
|
||
loc_686:
|
||
out 5Fh, al
|
||
in al, 0A0h ; PIC 2 same as 0020 for PIC 1
|
||
test al, 20h
|
||
jnz short loc_686
|
||
|
||
loc_68E:
|
||
out 5Fh, al
|
||
in al, 0A0h ; PIC 2 same as 0020 for PIC 1
|
||
test al, 20h
|
||
jz short loc_68E
|
||
pop bp
|
||
retn
|
||
sub_683 endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: bp-based frame
|
||
|
||
sub_698 proc near
|
||
push bp
|
||
mov bp, sp
|
||
cmp word ptr ds:2950h, 32h
|
||
jge short loc_6A5
|
||
jmp loc_7CB
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_6A5:
|
||
cmp word ptr ds:2950h, 5Ah
|
||
jge short loc_6CD
|
||
cmp word ptr ds:2950h, 37h
|
||
jnz short loc_6B6
|
||
jmp loc_7A6
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_6B6:
|
||
cmp word ptr ds:2950h, 3Ch
|
||
jnz short loc_6C0
|
||
jmp loc_7A6
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_6C0:
|
||
cmp word ptr ds:2950h, 41h
|
||
jz short loc_6CA
|
||
jmp loc_7AE
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_6CA:
|
||
jmp loc_7A6
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_6CD:
|
||
cmp word ptr ds:2950h, 6Eh
|
||
jge short loc_720
|
||
push 100h
|
||
push 0C0h
|
||
mov al, ds:2873h
|
||
cbw
|
||
push ax
|
||
mov al, ds:2874h
|
||
cbw
|
||
push ax
|
||
push word ptr ds:2876h
|
||
mov al, ds:2875h
|
||
cbw
|
||
push ax
|
||
call sub_1008
|
||
push 140h
|
||
push 0C0h
|
||
mov al, ds:2873h
|
||
cbw
|
||
inc ax
|
||
push ax
|
||
mov al, ds:2874h
|
||
cbw
|
||
push ax
|
||
push word ptr ds:2876h
|
||
mov al, ds:2875h
|
||
cbw
|
||
push ax
|
||
call sub_1008
|
||
dec byte ptr ds:2874h
|
||
|
||
loc_711:
|
||
mov al, ds:2875h
|
||
add al, 4
|
||
mov ds:2875h, al
|
||
mov al, ds:2876h
|
||
add al, 4
|
||
jmp short loc_781
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_720:
|
||
cmp word ptr ds:2950h, 82h
|
||
jge short loc_786
|
||
cmp word ptr ds:2950h, 6Eh
|
||
jnz short loc_737
|
||
mov al, ds:2873h
|
||
add al, 2
|
||
mov ds:2873h, al
|
||
|
||
loc_737:
|
||
push 100h
|
||
push 0C0h
|
||
mov al, ds:2873h
|
||
cbw
|
||
push ax
|
||
mov al, ds:2874h
|
||
cbw
|
||
push ax
|
||
push word ptr ds:2876h
|
||
mov al, ds:2875h
|
||
cbw
|
||
push ax
|
||
call sub_1008
|
||
push 140h
|
||
push 0C0h
|
||
mov al, ds:2873h
|
||
cbw
|
||
inc ax
|
||
push ax
|
||
mov al, ds:2874h
|
||
cbw
|
||
push ax
|
||
push word ptr ds:2876h
|
||
mov al, ds:2875h
|
||
cbw
|
||
push ax
|
||
call sub_1008
|
||
inc byte ptr ds:2874h
|
||
mov al, ds:2875h
|
||
add al, 4
|
||
mov ds:2875h, al
|
||
mov al, ds:2876h
|
||
add al, 0FCh
|
||
|
||
loc_781:
|
||
mov ds:2876h, al
|
||
pop bp
|
||
retn
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_786:
|
||
cmp word ptr ds:2950h, 0AAh
|
||
jge short loc_7CB
|
||
cmp word ptr ds:2950h, 9Bh
|
||
jz short loc_7A6
|
||
cmp word ptr ds:2950h, 0A0h
|
||
jz short loc_7A6
|
||
cmp word ptr ds:2950h, 0A5h
|
||
jnz short loc_7AE
|
||
|
||
loc_7A6:
|
||
mov al, ds:2873h
|
||
add al, 2
|
||
mov ds:2873h, al
|
||
|
||
loc_7AE:
|
||
push 100h
|
||
push 0C0h
|
||
mov al, ds:2873h
|
||
cbw
|
||
push ax
|
||
call sub_E9C
|
||
push 140h
|
||
push 0C0h
|
||
mov al, ds:2873h
|
||
cbw
|
||
inc ax
|
||
push ax
|
||
call sub_E9C
|
||
|
||
loc_7CB:
|
||
pop bp
|
||
retn
|
||
sub_698 endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: bp-based frame
|
||
|
||
; int __cdecl main(int argc, const char **argv, const char **envp)
|
||
_main proc near
|
||
|
||
_argc = word ptr 4
|
||
_argv = word ptr 6
|
||
_envp = word ptr 8
|
||
|
||
push bp
|
||
mov bp, sp
|
||
push si
|
||
push di
|
||
xor ax, ax
|
||
mov es, ax
|
||
assume es:seg000
|
||
test byte ptr es:loc_45B+1, 40h
|
||
jz short loc_7F0
|
||
mov al, 7
|
||
out 6Ah, al ; PC-98 GDC (6a):
|
||
;
|
||
mov al, 20h
|
||
out 6Ah, al ; PC-98 GDC (6a):
|
||
;
|
||
mov al, 6
|
||
out 6Ah, al ; PC-98 GDC (6a):
|
||
;
|
||
and byte ptr es:loc_54D, 7Fh
|
||
|
||
loc_7F0:
|
||
call sub_384
|
||
call sub_439
|
||
|
||
loc_7F6:
|
||
cmp word ptr ds:2950h, 0B4h
|
||
jle short loc_80C
|
||
cmp byte ptr ds:2872h, 0
|
||
jle short loc_873
|
||
mov al, ds:2872h
|
||
add al, 0FEh
|
||
jmp short loc_818
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_80C:
|
||
cmp byte ptr ds:2872h, 64h
|
||
jge short loc_822
|
||
mov al, ds:2872h
|
||
add al, 2
|
||
|
||
loc_818:
|
||
mov ds:2872h, al
|
||
cbw
|
||
mov word_2248, ax
|
||
call sub_978
|
||
|
||
loc_822:
|
||
push 0C0h
|
||
push 0
|
||
call sub_14B4
|
||
push 0Ch
|
||
push 64h
|
||
push 43h
|
||
push 12Bh
|
||
call sub_161A
|
||
call sub_5B6
|
||
call sub_502
|
||
call sub_698
|
||
call sub_683
|
||
call sub_683
|
||
mov al, ds:2870h
|
||
mov ds:2871h, al
|
||
out 0A4h, al ; Interrupt Controller #2, 8259A
|
||
xor byte ptr ds:2870h, 1
|
||
mov al, ds:2870h
|
||
out 0A6h, al ; Interrupt Controller #2, 8259A
|
||
xor di, di
|
||
xor si, si
|
||
jmp short loc_864
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_85D:
|
||
push si
|
||
call sub_ACE
|
||
or di, ax
|
||
inc si
|
||
|
||
loc_864:
|
||
cmp si, 8
|
||
jl short loc_85D
|
||
or di, di
|
||
jnz short loc_873
|
||
inc word ptr ds:2950h
|
||
jmp short loc_7F6
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_873:
|
||
call sub_3D0
|
||
pop di
|
||
pop si
|
||
pop bp
|
||
retn
|
||
_main endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
|
||
sub_87A proc near
|
||
mov al, 1Bh
|
||
int 29h ; DOS 2+ internal - FAST PUTCHAR
|
||
; AL = character to display
|
||
mov al, 5Bh
|
||
int 29h ; DOS 2+ internal - FAST PUTCHAR
|
||
; AL = character to display
|
||
mov al, 32h
|
||
int 29h ; DOS 2+ internal - FAST PUTCHAR
|
||
; AL = character to display
|
||
mov al, 4Ah
|
||
int 29h ; DOS 2+ internal - FAST PUTCHAR
|
||
; AL = character to display
|
||
retn
|
||
sub_87A endp
|
||
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
|
||
sub_88C proc near
|
||
xor ax, ax
|
||
mov es, ax
|
||
mov al, byte ptr es:loc_711+1
|
||
inc ax
|
||
retn
|
||
sub_88C endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
|
||
sub_896 proc near
|
||
xor ax, ax
|
||
mov es, ax
|
||
mov al, byte ptr es:loc_711
|
||
retn
|
||
sub_896 endp
|
||
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
mov dx, 336Ch
|
||
jmp short loc_8C4
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
mov dx, 3368h
|
||
jmp short loc_8C4
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
|
||
sub_8AC proc near
|
||
mov dx, 3568h
|
||
jmp short loc_8C4
|
||
sub_8AC endp
|
||
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
mov dx, 356Ch
|
||
jmp short loc_8C4
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
|
||
sub_8B8 proc near
|
||
mov dx, 3168h
|
||
jmp short loc_8C4
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
mov dx, 316Ch
|
||
jmp short loc_8C4
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
|
||
loc_8C4:
|
||
mov al, 1Bh
|
||
int 29h ; DOS 2+ internal - FAST PUTCHAR
|
||
; AL = character to display
|
||
mov al, 5Bh
|
||
int 29h ; DOS 2+ internal - FAST PUTCHAR
|
||
; AL = character to display
|
||
mov al, 3Eh
|
||
int 29h ; DOS 2+ internal - FAST PUTCHAR
|
||
; AL = character to display
|
||
mov al, dh
|
||
int 29h ; DOS 2+ internal - FAST PUTCHAR
|
||
; AL = character to display
|
||
mov al, dl
|
||
int 29h ; DOS 2+ internal - FAST PUTCHAR
|
||
; AL = character to display
|
||
retn
|
||
sub_8B8 endp
|
||
|
||
; ---------------------------------------------------------------------------
|
||
db 0
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
|
||
sub_8DA proc near
|
||
mov ah, 42h
|
||
mov ch, 0C0h
|
||
int 18h ; TRANSFER TO ROM BASIC
|
||
; causes transfer to ROM-based BASIC (IBM-PC)
|
||
; often reboots a compatible; often has no effect at all
|
||
mov ax, 0A800h
|
||
mov word_223C, ax
|
||
mov word_22C2, ax
|
||
mov word_223E, 3E80h
|
||
xor ax, ax
|
||
mov word_22B6, ax
|
||
mov word_22BC, ax
|
||
mov es, ax
|
||
mov ah, byte ptr es:loc_54D
|
||
and ah, 4
|
||
add ah, 3Fh
|
||
and ah, 40h
|
||
mov word_2244, ax
|
||
mov ax, 27Fh
|
||
mov word_22BA, ax
|
||
mov word_22B8, ax
|
||
mov ax, 190h
|
||
mov word_2240, ax
|
||
dec ax
|
||
mov word_22C0, ax
|
||
mov word_22BE, ax
|
||
mov word_22C4, 7CB0h
|
||
retn
|
||
sub_8DA endp
|
||
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
|
||
sub_928 proc near
|
||
mov al, 80h
|
||
pushf
|
||
cli
|
||
out 7Ch, al
|
||
popf
|
||
xor ax, ax
|
||
mov dx, 7Eh
|
||
out dx, al
|
||
out dx, al
|
||
out dx, al
|
||
out dx, al
|
||
mov bx, di
|
||
xor di, di
|
||
mov cx, word_223E
|
||
mov es, word_223C
|
||
assume es:nothing
|
||
rep stosw
|
||
mov di, bx
|
||
out 7Ch, al
|
||
retn
|
||
sub_928 endp
|
||
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
|
||
sub_94C proc near
|
||
mov ah, 41h
|
||
int 18h ; TRANSFER TO ROM BASIC
|
||
; causes transfer to ROM-based BASIC (IBM-PC)
|
||
; often reboots a compatible; often has no effect at all
|
||
retn
|
||
sub_94C endp
|
||
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
|
||
sub_952 proc near
|
||
mov ah, 40h
|
||
int 18h ; TRANSFER TO ROM BASIC
|
||
; causes transfer to ROM-based BASIC (IBM-PC)
|
||
; often reboots a compatible; often has no effect at all
|
||
retn
|
||
sub_952 endp
|
||
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
|
||
sub_958 proc near
|
||
mov al, 41h
|
||
out 6Ah, al ; PC-98 GDC (6a):
|
||
; Set display mode to LCD
|
||
mov word_2248, 0
|
||
call sub_978
|
||
mov al, 0
|
||
out 0A4h, al ; Interrupt Controller #2, 8259A
|
||
out 0A6h, al ; Interrupt Controller #2, 8259A
|
||
call sub_952
|
||
call sub_8DA
|
||
call sub_928
|
||
call sub_A82
|
||
retn
|
||
sub_958 endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
|
||
sub_978 proc near
|
||
cld
|
||
push si
|
||
mov ax, word_2248
|
||
cwd
|
||
not dx
|
||
and ax, dx
|
||
sub ax, 0C8h
|
||
sbb dx, dx
|
||
and ax, dx
|
||
add ax, 0C8h
|
||
mov dh, al
|
||
xor bx, bx
|
||
mov ch, bl
|
||
cmp dh, 64h
|
||
jbe short loc_99E
|
||
mov ch, 0Fh
|
||
sub dh, 0C8h
|
||
neg dh
|
||
|
||
loc_99E:
|
||
mov si, 2996h
|
||
mov dl, 64h
|
||
cmp word_227A, bx
|
||
jnz short loc_9E2
|
||
|
||
loc_9A9:
|
||
mov al, bl
|
||
out 0A8h, al ; Interrupt Controller #2, 8259A
|
||
lodsw
|
||
shr ax, 4
|
||
mov cl, ah
|
||
and al, 0Fh
|
||
xor al, ch
|
||
mul dh
|
||
div dl
|
||
xor al, ch
|
||
out 0ACh, al ; Interrupt Controller #2, 8259A
|
||
mov al, cl
|
||
xor al, ch
|
||
mul dh
|
||
div dl
|
||
xor al, ch
|
||
out 0AAh, al ; Interrupt Controller #2, 8259A
|
||
lodsb
|
||
shr al, 4
|
||
xor al, ch
|
||
mul dh
|
||
div dl
|
||
xor al, ch
|
||
out 0AEh, al ; Interrupt Controller #2, 8259A
|
||
inc bx
|
||
cmp bx, 10h
|
||
jl short loc_9A9
|
||
pop si
|
||
retn
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
|
||
loc_9E2:
|
||
mov bx, dx
|
||
mov dx, 871Eh
|
||
mov al, 0A0h
|
||
out 0F6h, al
|
||
in al, dx
|
||
cmp al, 0FFh
|
||
jnz short loc_9F7
|
||
mov dx, 0AE8Eh
|
||
in al, dx
|
||
shr al, 2
|
||
|
||
loc_9F7:
|
||
shr al, 1
|
||
cmc
|
||
sbb al, al
|
||
mov byte ptr cs:loc_A5E+2, al
|
||
mov dx, bx
|
||
push di
|
||
mov di, 0
|
||
|
||
loc_A06:
|
||
mov ax, di
|
||
out 0A8h, al ; Interrupt Controller #2, 8259A
|
||
lodsw
|
||
mov bx, ax
|
||
shr bx, 4
|
||
and bl, ch
|
||
lodsb
|
||
and al, ch
|
||
xor al, ch
|
||
mul dh
|
||
div dl
|
||
xor al, ch
|
||
xchg al, bh
|
||
xor al, ch
|
||
mul dh
|
||
div dl
|
||
xor al, ch
|
||
xchg al, bl
|
||
xor al, ch
|
||
mul dh
|
||
div dl
|
||
xor al, ch
|
||
xchg al, bl
|
||
mov ah, bh
|
||
cmp bh, al
|
||
ja short loc_A3B
|
||
mov bh, al
|
||
|
||
loc_A3B:
|
||
cmp bh, bl
|
||
ja short loc_A41
|
||
mov bh, bl
|
||
|
||
loc_A41:
|
||
shl al, 1
|
||
add al, bl
|
||
shl al, 1
|
||
add al, ah
|
||
add al, bh
|
||
mov cl, 3
|
||
mul cl
|
||
mov cl, 14h
|
||
div cl
|
||
shr al, 1
|
||
adc al, 0
|
||
sub al, 2
|
||
cmc
|
||
sbb ah, ah
|
||
and ah, al
|
||
|
||
loc_A5E:
|
||
xor ah, 0
|
||
shr ah, 1
|
||
sbb al, al
|
||
and al, 0Fh
|
||
out 0AEh, al ; Interrupt Controller #2, 8259A
|
||
shr ah, 1
|
||
sbb al, al
|
||
and al, 0Fh
|
||
out 0ACh, al ; Interrupt Controller #2, 8259A
|
||
shr ah, 1
|
||
sbb al, al
|
||
and al, 0Fh
|
||
out 0AAh, al ; Interrupt Controller #2, 8259A
|
||
inc di
|
||
cmp di, 10h
|
||
jl short loc_A06
|
||
pop di
|
||
pop si
|
||
retn
|
||
sub_978 endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
|
||
sub_A82 proc near
|
||
push si
|
||
push di
|
||
push ds
|
||
pop es
|
||
assume es:seg000
|
||
mov di, 2996h
|
||
mov si, 224Ah
|
||
mov cx, 18h
|
||
rep movsw
|
||
pop di
|
||
pop si
|
||
mov al, 0
|
||
out 6Ah, al ; PC-98 GDC (6a):
|
||
;
|
||
mov al, 4
|
||
out 0AEh, al ; Interrupt Controller #2, 8259A
|
||
mov al, 26h
|
||
out 0ACh, al ; Interrupt Controller #2, 8259A
|
||
mov al, 15h
|
||
out 0AAh, al ; Interrupt Controller #2, 8259A
|
||
mov al, 37h
|
||
out 0A8h, al ; Interrupt Controller #2, 8259A
|
||
mov al, 1
|
||
out 6Ah, al ; PC-98 GDC (6a):
|
||
;
|
||
mov word_2248, 64h
|
||
call sub_978
|
||
retn
|
||
sub_A82 endp
|
||
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
|
||
sub_AB6 proc near
|
||
xor ax, ax
|
||
mov es, ax
|
||
or byte ptr es:loc_500, 20h
|
||
retn
|
||
sub_AB6 endp
|
||
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
|
||
sub_AC2 proc near
|
||
xor ax, ax
|
||
mov es, ax
|
||
and byte ptr es:loc_500, 0DFh
|
||
retn
|
||
sub_AC2 endp
|
||
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
|
||
sub_ACE proc near
|
||
mov bx, sp
|
||
mov ax, ss:[bx+2]
|
||
mov ah, 4
|
||
int 18h ; TRANSFER TO ROM BASIC
|
||
; causes transfer to ROM-based BASIC (IBM-PC)
|
||
; often reboots a compatible; often has no effect at all
|
||
mov al, ah
|
||
mov ah, 0
|
||
retn 2
|
||
sub_ACE endp
|
||
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: bp-based frame
|
||
|
||
sub_AE0 proc near
|
||
|
||
arg_0 = word ptr 4
|
||
arg_2 = word ptr 6
|
||
|
||
push bp
|
||
mov bp, sp
|
||
mov dx, [bp+arg_0]
|
||
mov bx, [bp+arg_2]
|
||
mov ah, 3Fh
|
||
mov cx, 20h
|
||
int 21h ; DOS - 2+ - READ FROM FILE WITH HANDLE
|
||
; BX = file handle, CX = number of bytes to read
|
||
; DS:DX -> buffer
|
||
push ds
|
||
pop es
|
||
sbb cx, cx
|
||
xor ax, cx
|
||
sub ax, cx
|
||
jb short loc_B15
|
||
push si
|
||
push di
|
||
mov si, 2280h
|
||
mov di, dx
|
||
mov cx, 5
|
||
repe cmpsb
|
||
pop di
|
||
pop si
|
||
jnz short loc_B11
|
||
mov ax, 0
|
||
pop bp
|
||
retn 4
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_B11:
|
||
mov ax, 0FFF3h
|
||
stc
|
||
|
||
loc_B15:
|
||
pop bp
|
||
retn 4
|
||
sub_AE0 endp
|
||
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
; START OF FUNCTION CHUNK FOR sub_B2E
|
||
|
||
loc_B1A:
|
||
push ds
|
||
mov ds, word ptr cs:loc_BFF+1
|
||
call sub_1162
|
||
mov ax, 0FFF3h
|
||
|
||
loc_B26:
|
||
pop si
|
||
pop di
|
||
pop ds
|
||
pop bp
|
||
retn 6
|
||
; END OF FUNCTION CHUNK FOR sub_B2E
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: bp-based frame
|
||
|
||
sub_B2E proc near
|
||
|
||
arg_0 = word ptr 4
|
||
arg_2 = word ptr 6
|
||
arg_4 = word ptr 8
|
||
|
||
; FUNCTION CHUNK AT 0B1A SIZE 00000013 BYTES
|
||
|
||
push bp
|
||
mov bp, sp
|
||
push ds
|
||
push si
|
||
push di
|
||
mov ax, [bp+arg_0]
|
||
mov word ptr cs:loc_C0D+1, ax
|
||
mov word ptr cs:loc_BFF+1, ds
|
||
mov ax, [bp+arg_4]
|
||
mov word ptr cs:loc_B90+1, ax
|
||
mov bx, [bp+arg_2]
|
||
mov ax, [bx+8]
|
||
mov cx, [bx+0Ah]
|
||
mov bp, [bx+0Eh]
|
||
sub bp, [bx+0Ch]
|
||
inc bp
|
||
shr ax, 3
|
||
mov byte ptr cs:loc_BA9+1, al
|
||
mov dh, al
|
||
mov dl, cl
|
||
mov word ptr cs:loc_C04+1, dx
|
||
mov byte ptr cs:loc_BA7+1, cl
|
||
mul cx
|
||
mov word ptr cs:loc_BA2+1, ax
|
||
shl ax, 2
|
||
mov word ptr cs:loc_B8B+1, ax
|
||
xchg ax, bx
|
||
push bx
|
||
call sub_112C
|
||
jb short loc_B26
|
||
xchg ax, cx
|
||
push bx
|
||
call sub_112C
|
||
jb short loc_B26
|
||
mov es, ax
|
||
assume es:nothing
|
||
mov ds, cx
|
||
|
||
loc_B8B:
|
||
mov cx, 1234h
|
||
xor dx, dx
|
||
|
||
loc_B90:
|
||
mov bx, 1234h
|
||
mov ah, 3Fh
|
||
int 21h ; DOS - 2+ - READ FROM FILE WITH HANDLE
|
||
; BX = file handle, CX = number of bytes to read
|
||
; DS:DX -> buffer
|
||
jb short loc_B1A
|
||
cmp ax, cx
|
||
jz short loc_BA0
|
||
jmp loc_B1A
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_BA0:
|
||
xor si, si
|
||
|
||
loc_BA2:
|
||
mov dx, 1234h
|
||
xor bx, bx
|
||
|
||
loc_BA7:
|
||
mov ch, 11h
|
||
|
||
loc_BA9:
|
||
mov cl, 11h
|
||
|
||
loc_BAB:
|
||
push cx
|
||
push dx
|
||
push bx
|
||
lodsw
|
||
mov bx, ax
|
||
lodsw
|
||
mov dx, ax
|
||
mov di, 4
|
||
|
||
loc_BB7:
|
||
rol bl, 1
|
||
rcl ch, 1
|
||
rol bl, 1
|
||
rcl cl, 1
|
||
rol bl, 1
|
||
rcl ah, 1
|
||
rol bl, 1
|
||
rcl al, 1
|
||
rol bl, 1
|
||
rcl ch, 1
|
||
rol bl, 1
|
||
rcl cl, 1
|
||
rol bl, 1
|
||
rcl ah, 1
|
||
rol bl, 1
|
||
rcl al, 1
|
||
mov bl, bh
|
||
mov bh, dl
|
||
mov dl, dh
|
||
dec di
|
||
jnz short loc_BB7
|
||
pop bx
|
||
pop dx
|
||
mov es:[bx+di], al
|
||
add di, dx
|
||
mov es:[bx+di], ah
|
||
add di, dx
|
||
mov es:[bx+di], cl
|
||
add di, dx
|
||
mov es:[bx+di], ch
|
||
pop cx
|
||
inc bx
|
||
dec cl
|
||
jnz short loc_BAB
|
||
dec ch
|
||
jnz short loc_BA9
|
||
push ds
|
||
|
||
loc_BFF:
|
||
mov ax, 1234h
|
||
mov ds, ax
|
||
assume ds:nothing
|
||
|
||
loc_C04:
|
||
mov ax, 1234h
|
||
push es
|
||
push ax
|
||
push es
|
||
xor ax, ax
|
||
push ax
|
||
|
||
loc_C0D:
|
||
mov ax, 1234h
|
||
push ax
|
||
call sub_DF2
|
||
pop es
|
||
pop ds
|
||
assume ds:seg000
|
||
jb short loc_C1E
|
||
dec bp
|
||
jz short loc_C38
|
||
jmp loc_B8B
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_C1E:
|
||
push ds
|
||
mov ds, word ptr cs:loc_BFF+1
|
||
mov cx, ax
|
||
push es
|
||
call sub_1162
|
||
call sub_1162
|
||
mov ax, cx
|
||
stc
|
||
pop si
|
||
pop di
|
||
pop ds
|
||
pop bp
|
||
retn 6
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
|
||
loc_C38:
|
||
push ds
|
||
mov ds, word ptr cs:loc_BFF+1
|
||
push es
|
||
call sub_1162
|
||
call sub_1162
|
||
mov ax, 0
|
||
clc
|
||
pop si
|
||
pop di
|
||
pop ds
|
||
pop bp
|
||
retn 6
|
||
sub_B2E endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: bp-based frame
|
||
|
||
sub_C50 proc near
|
||
|
||
arg_0 = word ptr 4
|
||
arg_2 = word ptr 6
|
||
|
||
push bp
|
||
mov bp, sp
|
||
push si
|
||
cld
|
||
mov bx, [bp+arg_0]
|
||
mov cx, [bx+1Ch]
|
||
mov si, [bx+1Eh]
|
||
mov ax, 0
|
||
jcxz short loc_CA5
|
||
push cx
|
||
call sub_112C
|
||
jb short loc_CA5
|
||
push ds
|
||
mov ds, ax
|
||
xor dx, dx
|
||
mov bx, [bp+arg_2]
|
||
mov ah, 3Fh
|
||
int 21h ; DOS - 2+ - READ FROM FILE WITH HANDLE
|
||
; BX = file handle, CX = number of bytes to read
|
||
; DS:DX -> buffer
|
||
mov ax, 0FFF3h
|
||
jb short loc_C9E
|
||
mov dx, si
|
||
xor si, si
|
||
|
||
loc_C7E:
|
||
lodsb
|
||
cmp al, 10h
|
||
jz short loc_C98
|
||
add si, dx
|
||
sub si, 3
|
||
lodsw
|
||
or ax, ax
|
||
jz short loc_C93
|
||
sub cx, dx
|
||
mov dx, ax
|
||
ja short loc_C7E
|
||
|
||
loc_C93:
|
||
xor ax, ax
|
||
jmp short loc_C9E
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
|
||
loc_C98:
|
||
lodsw
|
||
lodsb
|
||
and ax, 0Fh
|
||
nop
|
||
|
||
loc_C9E:
|
||
mov bx, ds
|
||
pop ds
|
||
push bx
|
||
call sub_1162
|
||
|
||
loc_CA5:
|
||
pop si
|
||
pop bp
|
||
retn 4
|
||
sub_C50 endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: bp-based frame
|
||
|
||
sub_CAA proc near
|
||
|
||
arg_0 = word ptr 4
|
||
arg_2 = word ptr 6
|
||
|
||
push bp
|
||
mov bp, sp
|
||
mov bx, [bp+arg_0]
|
||
test byte ptr [bx+5], 80h
|
||
jz short loc_CE0
|
||
mov ah, 3Fh
|
||
mov bx, [bp+arg_2]
|
||
mov cx, 30h
|
||
mov dx, 2996h
|
||
int 21h ; DOS - 2+ - READ FROM FILE WITH HANDLE
|
||
; BX = file handle, CX = number of bytes to read
|
||
; DS:DX -> buffer
|
||
jb short loc_CE0
|
||
mov bx, dx
|
||
mov cx, 1004h
|
||
|
||
loc_CCA:
|
||
mov dl, [bx]
|
||
mov ax, [bx+1]
|
||
mov [bx], ax
|
||
mov [bx+2], dl
|
||
add bx, 3
|
||
dec ch
|
||
jnz short loc_CCA
|
||
mov ax, 0
|
||
jmp short loc_CE4
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_CE0:
|
||
stc
|
||
mov ax, 0FFF3h
|
||
|
||
loc_CE4:
|
||
pop bp
|
||
retn 4
|
||
sub_CAA endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
|
||
sub_CE8 proc near
|
||
mov bx, sp
|
||
mov ah, 3Eh
|
||
mov bx, ss:[bx+2]
|
||
int 21h ; DOS - 2+ - CLOSE A FILE WITH HANDLE
|
||
; BX = file handle
|
||
mov ax, 0
|
||
jnb short locret_CFA
|
||
mov ax, 0FFF3h
|
||
|
||
locret_CFA:
|
||
retn 2
|
||
sub_CE8 endp
|
||
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
|
||
sub_CFE proc near
|
||
mov bx, sp
|
||
mov ah, 3Dh
|
||
mov al, byte_2286
|
||
mov dx, ss:[bx+2]
|
||
int 21h ; DOS - 2+ - OPEN DISK FILE WITH HANDLE
|
||
; DS:DX -> ASCIZ filename
|
||
; AL = access mode
|
||
; 0 - read
|
||
jb short loc_D10
|
||
retn 2
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_D10:
|
||
mov ax, 0FFFEh
|
||
retn 2
|
||
sub_CFE endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: bp-based frame
|
||
|
||
sub_D16 proc near
|
||
|
||
arg_0 = word ptr 4
|
||
|
||
push bp
|
||
mov bp, sp
|
||
push ds
|
||
push si
|
||
push di
|
||
push [bp+arg_0]
|
||
call sub_CFE
|
||
jb short loc_D8B
|
||
mov bx, ax
|
||
mov cx, 2288h
|
||
push bx
|
||
push cx
|
||
push bx
|
||
push cx
|
||
call sub_AE0
|
||
pop cx
|
||
pop bx
|
||
jb short loc_D84
|
||
mov al, byte_228D
|
||
and al, 7Fh
|
||
cmp al, 3
|
||
mov ax, 0FFF3h
|
||
jnz short loc_D84
|
||
xor si, si
|
||
mov ax, word_22A4
|
||
or ax, ax
|
||
jz short loc_D54
|
||
push bx
|
||
push cx
|
||
push bx
|
||
push cx
|
||
call sub_C50
|
||
pop cx
|
||
pop bx
|
||
mov si, ax
|
||
|
||
loc_D54:
|
||
test byte_228D, 80h
|
||
jz short loc_D66
|
||
push bx
|
||
push cx
|
||
push bx
|
||
push cx
|
||
call sub_CAA
|
||
pop cx
|
||
pop bx
|
||
jb short loc_D84
|
||
|
||
loc_D66:
|
||
push bx
|
||
push bx
|
||
push cx
|
||
push si
|
||
call sub_B2E
|
||
pop bx
|
||
jb short loc_D84
|
||
push bx
|
||
call sub_CE8
|
||
mov ax, word_2296
|
||
sub ax, word_2294
|
||
inc ax
|
||
pop di
|
||
pop si
|
||
pop ds
|
||
pop bp
|
||
retn 2
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
|
||
loc_D84:
|
||
push ax
|
||
push bx
|
||
call sub_CE8
|
||
pop ax
|
||
stc
|
||
|
||
loc_D8B:
|
||
pop di
|
||
pop si
|
||
pop ds
|
||
pop bp
|
||
retn 2
|
||
sub_D16 endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
|
||
sub_D92 proc near
|
||
mov bx, sp
|
||
xor dx, dx
|
||
mov bx, ss:[bx+2]
|
||
cmp bx, word_22AA
|
||
jnb short loc_DD8
|
||
mov cx, bx
|
||
shl bx, 1
|
||
mov ax, [bx+2DC6h]
|
||
or ax, ax
|
||
jz short loc_DD8
|
||
push word ptr [bx+29C6h]
|
||
call sub_1276
|
||
mov [bx+29C6h], dx
|
||
mov [bx+2DC6h], dx
|
||
inc cx
|
||
cmp cx, word_22AA
|
||
jnz short loc_DD0
|
||
|
||
loc_DC2:
|
||
dec word_22AA
|
||
jz short loc_DD0
|
||
dec bx
|
||
dec bx
|
||
mov cx, [bx+29C6h]
|
||
jcxz short loc_DC2
|
||
|
||
loc_DD0:
|
||
mov ax, 0
|
||
clc
|
||
retn 2
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
|
||
loc_DD8:
|
||
stc
|
||
mov ax, 0FFE1h
|
||
retn 2
|
||
sub_D92 endp
|
||
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
; START OF FUNCTION CHUNK FOR sub_DF2
|
||
|
||
loc_DE0:
|
||
push ax
|
||
push es
|
||
call sub_1276
|
||
pop ax
|
||
jmp short loc_DEB
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_DE8:
|
||
mov ax, 0FFF8h
|
||
|
||
loc_DEB:
|
||
stc
|
||
pop di
|
||
pop si
|
||
pop bp
|
||
retn 8
|
||
; END OF FUNCTION CHUNK FOR sub_DF2
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: bp-based frame
|
||
|
||
sub_DF2 proc near
|
||
|
||
arg_0 = word ptr 4
|
||
arg_2 = dword ptr 6
|
||
arg_6 = word ptr 0Ah
|
||
|
||
; FUNCTION CHUNK AT 0DE0 SIZE 00000012 BYTES
|
||
|
||
push bp
|
||
mov bp, sp
|
||
push si
|
||
push di
|
||
mov di, word_22AA
|
||
shl di, 1
|
||
mov ax, [bp+arg_6]
|
||
mov dx, ax
|
||
mul ah
|
||
mov bx, ax
|
||
shl ax, 2
|
||
add ax, bx
|
||
mov word_22B2, 4
|
||
push ax
|
||
call sub_1172
|
||
jb short loc_DE8
|
||
mov es, ax
|
||
push word_22AA
|
||
push dx
|
||
push ax
|
||
call sub_F96
|
||
jb short loc_DE0
|
||
push ds
|
||
lds si, [bp+arg_2]
|
||
mov di, bx
|
||
mov cx, bx
|
||
shl cx, 1
|
||
rep movsw
|
||
push es
|
||
pop ds
|
||
mov si, bx
|
||
mov dx, [bp+arg_0]
|
||
mov dh, dl
|
||
mov cx, bx
|
||
xor di, di
|
||
shr dh, 1
|
||
jb short loc_E46
|
||
rep movsb
|
||
jmp short loc_E4C
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
|
||
loc_E46:
|
||
lodsb
|
||
not al
|
||
stosb
|
||
loop loc_E46
|
||
|
||
loc_E4C:
|
||
mov cx, bx
|
||
xor di, di
|
||
shr dh, 1
|
||
sbb ah, ah
|
||
|
||
loc_E54:
|
||
lodsb
|
||
xor al, ah
|
||
or [di], al
|
||
inc di
|
||
loop loc_E54
|
||
mov cx, bx
|
||
xor di, di
|
||
shr dh, 1
|
||
sbb ah, ah
|
||
|
||
loc_E64:
|
||
lodsb
|
||
xor al, ah
|
||
or [di], al
|
||
inc di
|
||
loop loc_E64
|
||
mov cx, bx
|
||
xor di, di
|
||
shr dh, 1
|
||
sbb ah, ah
|
||
|
||
loc_E74:
|
||
lodsb
|
||
xor al, ah
|
||
or [di], al
|
||
inc di
|
||
loop loc_E74
|
||
test dl, dl
|
||
jz short loc_E90
|
||
mov ah, 4
|
||
|
||
loc_E82:
|
||
xor si, si
|
||
mov cx, bx
|
||
|
||
loc_E86:
|
||
lodsb
|
||
and [di], al
|
||
inc di
|
||
loop loc_E86
|
||
dec ah
|
||
jnz short loc_E82
|
||
|
||
loc_E90:
|
||
pop ds
|
||
mov ax, word_22AA
|
||
dec ax
|
||
pop di
|
||
pop si
|
||
pop bp
|
||
retn 8
|
||
sub_DF2 endp
|
||
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: bp-based frame
|
||
|
||
sub_E9C proc near
|
||
|
||
arg_0 = word ptr 4
|
||
arg_2 = word ptr 6
|
||
arg_4 = word ptr 8
|
||
|
||
push bp
|
||
mov bp, sp
|
||
push ds
|
||
push si
|
||
push di
|
||
mov cx, [bp+arg_4]
|
||
mov ax, [bp+arg_2]
|
||
mov bx, [bp+arg_0]
|
||
mov bp, ax
|
||
shl ax, 2
|
||
add bp, ax
|
||
shl bp, 4
|
||
shr cx, 3
|
||
add bp, cx
|
||
shl bx, 1
|
||
mov ax, [bx+2DC6h]
|
||
xor si, si
|
||
mov ds, word ptr [bx+29C6h]
|
||
mov bl, ah
|
||
xor bh, bh
|
||
mov dx, 50h
|
||
sub dl, ah
|
||
mov ah, al
|
||
mov cx, 0A800h
|
||
mov es, cx
|
||
assume es:nothing
|
||
mov al, 0C0h
|
||
out 7Ch, al
|
||
mov al, 0
|
||
out 7Eh, al
|
||
out 7Eh, al
|
||
out 7Eh, al
|
||
out 7Eh, al
|
||
call sub_F18
|
||
mov al, 0CEh
|
||
out 7Ch, al
|
||
mov al, 0FFh
|
||
out 7Eh, al
|
||
out 7Eh, al
|
||
out 7Eh, al
|
||
out 7Eh, al
|
||
call sub_F18
|
||
mov al, 0CDh
|
||
out 7Ch, al
|
||
call sub_F18
|
||
mov al, 0CBh
|
||
out 7Ch, al
|
||
call sub_F18
|
||
mov al, 0C7h
|
||
out 7Ch, al
|
||
call sub_F18
|
||
xor al, al
|
||
out 7Ch, al
|
||
pop di
|
||
pop si
|
||
pop ds
|
||
pop bp
|
||
retn 6
|
||
sub_E9C endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
|
||
sub_F18 proc near
|
||
mov di, bp
|
||
mov al, ah
|
||
test di, 1
|
||
jnz short loc_F44
|
||
shr bx, 1
|
||
jb short loc_F34
|
||
|
||
loc_F26:
|
||
mov cx, bx
|
||
rep movsw
|
||
add di, dx
|
||
dec al
|
||
jnz short loc_F26
|
||
shl bx, 1
|
||
retn
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
|
||
loc_F34:
|
||
mov cx, bx
|
||
rep movsw
|
||
movsb
|
||
add di, dx
|
||
dec al
|
||
jnz short loc_F34
|
||
stc
|
||
rcl bx, 1
|
||
retn
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
|
||
loc_F44:
|
||
shr bx, 1
|
||
jb short loc_F58
|
||
|
||
loc_F48:
|
||
mov cx, bx
|
||
dec cx
|
||
movsb
|
||
rep movsw
|
||
movsb
|
||
add di, dx
|
||
dec al
|
||
jnz short loc_F48
|
||
shl bx, 1
|
||
retn
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_F58:
|
||
mov cx, bx
|
||
movsb
|
||
rep movsw
|
||
add di, dx
|
||
dec al
|
||
jnz short loc_F58
|
||
stc
|
||
rcl bx, 1
|
||
retn
|
||
sub_F18 endp
|
||
|
||
; ---------------------------------------------------------------------------
|
||
db 0
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
|
||
sub_F68 proc near
|
||
cmp word_22A8, 0
|
||
jz short locret_F95
|
||
push word_22A8
|
||
call sub_1276
|
||
mov word_22A8, 0
|
||
jmp short loc_F83
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_F7E:
|
||
dec ax
|
||
push ax
|
||
call sub_D92
|
||
|
||
loc_F83:
|
||
mov ax, word_22AA
|
||
test ax, ax
|
||
jnz short loc_F7E
|
||
cmp word_22AC, 0
|
||
jz short locret_F95
|
||
call word_22AC
|
||
|
||
locret_F95:
|
||
retn
|
||
sub_F68 endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: bp-based frame
|
||
|
||
sub_F96 proc near
|
||
|
||
arg_0 = word ptr 4
|
||
arg_2 = word ptr 6
|
||
arg_4 = word ptr 8
|
||
|
||
push bp
|
||
mov bp, sp
|
||
push bx
|
||
cld
|
||
mov bx, [bp+arg_4]
|
||
cmp bx, 200h
|
||
cmc
|
||
mov ax, 0FFE1h
|
||
jb short loc_1003
|
||
cmp word_22A8, 0
|
||
jnz short loc_FD5
|
||
mov word_22B2, 4
|
||
push 240h
|
||
call sub_1186
|
||
mov word_22A8, ax
|
||
mov ax, 0FFF8h
|
||
jb short loc_1003
|
||
push es
|
||
push cx
|
||
push di
|
||
push ds
|
||
pop es
|
||
assume es:seg000
|
||
xor ax, ax
|
||
mov di, 2DC6h
|
||
mov cx, 200h
|
||
rep stosw
|
||
pop di
|
||
pop cx
|
||
pop es
|
||
assume es:nothing
|
||
|
||
loc_FD5:
|
||
mov ax, bx
|
||
shl bx, 1
|
||
cmp ax, word_22AA
|
||
jnb short loc_FEF
|
||
cmp word ptr [bx+2DC6h], 0
|
||
jz short loc_FF3
|
||
push word ptr [bx+29C6h]
|
||
call sub_1276
|
||
jmp short loc_FF3
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_FEF:
|
||
inc ax
|
||
mov word_22AA, ax
|
||
|
||
loc_FF3:
|
||
mov ax, [bp+arg_2]
|
||
mov [bx+2DC6h], ax
|
||
mov ax, [bp+arg_0]
|
||
mov [bx+29C6h], ax
|
||
xor ax, ax
|
||
|
||
loc_1003:
|
||
pop bx
|
||
pop bp
|
||
retn 6
|
||
sub_F96 endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: bp-based frame
|
||
|
||
sub_1008 proc near
|
||
|
||
var_2 = byte ptr -2
|
||
arg_0 = word ptr 4
|
||
arg_2 = byte ptr 6
|
||
arg_4 = word ptr 8
|
||
arg_6 = word ptr 0Ah
|
||
arg_8 = word ptr 0Ch
|
||
arg_A = word ptr 0Eh
|
||
|
||
enter 2, 0
|
||
push ds
|
||
push si
|
||
push di
|
||
push bp
|
||
mov bx, [bp+arg_6]
|
||
add bx, bx
|
||
mov cx, [bx+2DC6h]
|
||
inc ch
|
||
mov ds:3346h, ch
|
||
mov byte ptr cs:sub_10E0+5, cl
|
||
push word ptr [bx+29C6h]
|
||
imul di, [bp+arg_8], 50h
|
||
mov ax, 0FFFFh
|
||
and ax, [bp+arg_4]
|
||
mov [bp+var_2], ah
|
||
jns short loc_103A
|
||
neg [bp+arg_4]
|
||
|
||
loc_103A:
|
||
xor ch, ch
|
||
xor si, si
|
||
|
||
loc_103E:
|
||
mov ax, si
|
||
cwd
|
||
shl ax, 7
|
||
div [bp+arg_4]
|
||
add ax, [bp+arg_0]
|
||
mov bx, 2568h
|
||
xlat
|
||
imul [bp+arg_2]
|
||
sar ax, 7
|
||
add ax, [bp+arg_A]
|
||
mov dx, ax
|
||
and al, 0Fh
|
||
xor dl, al
|
||
sar dx, 3
|
||
add dx, di
|
||
mov ah, ds:3346h
|
||
test ah, 1
|
||
jnz short loc_106D
|
||
xor al, 8
|
||
|
||
loc_106D:
|
||
mov [si+31C6h], dx
|
||
mov [si+3246h], ax
|
||
xor bh, bh
|
||
mov bl, al
|
||
add bx, bx
|
||
mov dx, [bx+22C6h]
|
||
mov [si+32C6h], dx
|
||
test [bp+var_2], 0FFh
|
||
jz short loc_108C
|
||
neg [bp+arg_2]
|
||
|
||
loc_108C:
|
||
add di, 50h
|
||
add si, 2
|
||
loop loc_103E
|
||
pop ds
|
||
xor si, si
|
||
mov ax, 0A800h
|
||
mov es, ax
|
||
assume es:nothing
|
||
cld
|
||
mov al, 0C0h
|
||
out 7Ch, al
|
||
xor al, al
|
||
out 7Eh, al
|
||
out 7Eh, al
|
||
out 7Eh, al
|
||
out 7Eh, al
|
||
call sub_10E0
|
||
mov al, 0CEh
|
||
out 7Ch, al
|
||
mov al, 0FFh
|
||
out 7Eh, al
|
||
out 7Eh, al
|
||
out 7Eh, al
|
||
out 7Eh, al
|
||
call sub_10E0
|
||
mov al, 0CDh
|
||
out 7Ch, al
|
||
call sub_10E0
|
||
mov al, 0CBh
|
||
out 7Ch, al
|
||
call sub_10E0
|
||
mov al, 0C7h
|
||
out 7Ch, al
|
||
call sub_10E0
|
||
xor al, al
|
||
out 7Ch, al
|
||
pop bp
|
||
pop di
|
||
pop si
|
||
pop ds
|
||
leave
|
||
retn 0Ch
|
||
sub_1008 endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
|
||
sub_10E0 proc near
|
||
mov byte ptr ss:3346h, 0
|
||
xor bp, bp
|
||
|
||
loc_10E8:
|
||
xor dx, dx
|
||
mov di, [bp+31C6h]
|
||
mov cx, [bp+3246h]
|
||
mov bx, [bp+32C6h]
|
||
shr ch, 1
|
||
jb short loc_1108
|
||
lodsb
|
||
shl ax, 8
|
||
test cl, 8
|
||
jz short loc_1109
|
||
ror ax, cl
|
||
jmp short loc_1112
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
|
||
loc_1108:
|
||
lodsw
|
||
|
||
loc_1109:
|
||
ror ax, cl
|
||
xor dx, ax
|
||
and ax, bx
|
||
xor ax, dx
|
||
stosw
|
||
|
||
loc_1112:
|
||
xor dx, ax
|
||
dec ch
|
||
jnz short loc_1108
|
||
mov es:[di], dx
|
||
add bp, 2
|
||
dec byte ptr ss:3346h
|
||
jnz short loc_10E8
|
||
retn
|
||
sub_10E0 endp
|
||
|
||
; ---------------------------------------------------------------------------
|
||
; START OF FUNCTION CHUNK FOR sub_112C
|
||
|
||
loc_1126:
|
||
call sub_1344
|
||
jb short loc_115B
|
||
nop
|
||
; END OF FUNCTION CHUNK FOR sub_112C
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
|
||
sub_112C proc near
|
||
|
||
; FUNCTION CHUNK AT 1126 SIZE 00000006 BYTES
|
||
|
||
cmp word_22AE, 0
|
||
jz short loc_1126
|
||
push bx
|
||
mov bx, sp
|
||
mov bx, ss:[bx+4]
|
||
add bx, 0Fh
|
||
rcr bx, 1
|
||
shr bx, 1
|
||
shr bx, 1
|
||
shr bx, 1
|
||
mov ax, ds:334Eh
|
||
add bx, ax
|
||
jb short loc_115A
|
||
cmp ds:334Ah, bx
|
||
jb short loc_115A
|
||
mov ds:334Eh, bx
|
||
pop bx
|
||
retn 2
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_115A:
|
||
pop bx
|
||
|
||
loc_115B:
|
||
mov ax, 0FFF8h
|
||
retn 2
|
||
sub_112C endp ; sp-analysis failed
|
||
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
|
||
sub_1162 proc near
|
||
push bx
|
||
mov bx, sp
|
||
mov bx, ss:[bx+4]
|
||
mov ds:334Eh, bx
|
||
pop bx
|
||
retn 2
|
||
sub_1162 endp
|
||
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
|
||
sub_1172 proc near
|
||
push bx
|
||
mov bx, sp
|
||
mov bx, ss:[bx+4]
|
||
add bx, 0Fh
|
||
rcr bx, 1
|
||
shr bx, 1
|
||
shr bx, 1
|
||
shr bx, 1
|
||
jmp short loc_118D
|
||
sub_1172 endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
|
||
sub_1186 proc near
|
||
push bx
|
||
mov bx, sp
|
||
mov bx, ss:[bx+4]
|
||
|
||
loc_118D:
|
||
cmp word_22AE, 0
|
||
jnz short loc_1197
|
||
call sub_1344
|
||
|
||
loc_1197:
|
||
push cx
|
||
push es
|
||
test bx, bx
|
||
jz short loc_11F8
|
||
mov ax, ds:3348h
|
||
sub ax, ds:334Eh
|
||
cmp bx, ax
|
||
jnb short loc_11F8
|
||
inc bx
|
||
mov ax, ds:334Ch
|
||
test ax, ax
|
||
jz short loc_11D4
|
||
mov cx, ds:3348h
|
||
|
||
loc_11B4:
|
||
mov es, ax
|
||
assume es:nothing
|
||
mov ax, es:2
|
||
cmp word ptr es:0, 0
|
||
jnz short loc_11D0
|
||
mov cx, es
|
||
add cx, bx
|
||
jb short loc_11CC
|
||
cmp cx, ax
|
||
jbe short loc_1205
|
||
|
||
loc_11CC:
|
||
mov cx, ds:3348h
|
||
|
||
loc_11D0:
|
||
cmp ax, cx
|
||
jnz short loc_11B4
|
||
|
||
loc_11D4:
|
||
mov ax, ds:334Ah
|
||
mov cx, ax
|
||
sub ax, bx
|
||
jb short loc_11F8
|
||
cmp ax, ds:334Eh
|
||
jb short loc_11F8
|
||
mov ds:334Ah, ax
|
||
mov es, ax
|
||
mov es:2, cx
|
||
mov word ptr es:0, 1
|
||
mov bx, ax
|
||
jmp short loc_125E
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_11F8:
|
||
mov ax, 0
|
||
mov word_22B2, ax
|
||
stc
|
||
pop es
|
||
pop cx
|
||
pop bx
|
||
retn 2
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1205:
|
||
sub ax, cx
|
||
cmp ax, 1
|
||
jbe short loc_1235
|
||
add ax, cx
|
||
mov word ptr es:0, 1
|
||
mov es:2, cx
|
||
mov bx, es
|
||
mov es, cx
|
||
mov es:2, ax
|
||
mov word ptr es:0, 0
|
||
cmp bx, ds:334Ch
|
||
jnz short loc_125E
|
||
mov ds:334Ch, cx
|
||
jmp short loc_125E
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1235:
|
||
mov word ptr es:0, 1
|
||
mov bx, es
|
||
cmp bx, ds:334Ch
|
||
jnz short loc_125E
|
||
mov ax, ds:3348h
|
||
mov cx, bx
|
||
push bx
|
||
|
||
loc_124A:
|
||
les cx, es:0
|
||
jcxz short loc_1259
|
||
mov bx, es
|
||
cmp bx, ax
|
||
jb short loc_124A
|
||
xor bx, bx
|
||
|
||
loc_1259:
|
||
mov ds:334Ch, bx
|
||
pop bx
|
||
|
||
loc_125E:
|
||
mov es, bx
|
||
mov ax, 0
|
||
xchg ax, word_22B2
|
||
mov es:4, ax
|
||
lea ax, [bx+1]
|
||
clc
|
||
|
||
loc_126F:
|
||
pop es
|
||
pop cx
|
||
pop bx
|
||
retn 2
|
||
sub_1186 endp
|
||
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
|
||
sub_1276 proc near
|
||
push bx
|
||
mov bx, sp
|
||
push cx
|
||
push es
|
||
mov bx, ss:[bx+4]
|
||
dec bx
|
||
mov es, bx
|
||
cmp bx, ds:334Ah
|
||
jz short loc_12DA
|
||
jb short loc_126F
|
||
xor bx, bx
|
||
cmp word ptr es:[bx], 1
|
||
jnz short loc_126F
|
||
mov es:[bx], bx
|
||
mov cx, ds:334Ch
|
||
mov ax, es
|
||
mov ds:334Ch, ax
|
||
jcxz short loc_1317
|
||
cmp ax, cx
|
||
jb short loc_12A9
|
||
mov ax, cx
|
||
mov ds:334Ch, ax
|
||
|
||
loc_12A9:
|
||
mov cx, ax
|
||
mov ax, es:[bx+2]
|
||
cmp ax, ds:3348h
|
||
jnz short loc_12B7
|
||
mov ax, es
|
||
|
||
loc_12B7:
|
||
push ds
|
||
|
||
loc_12B8:
|
||
mov ds, cx
|
||
mov cx, [bx+2]
|
||
cmp cx, ax
|
||
ja short loc_12D7
|
||
cmp [bx], bx
|
||
jnz short loc_12B8
|
||
|
||
loc_12C5:
|
||
mov es, cx
|
||
cmp es:[bx], bx
|
||
jnz short loc_12B8
|
||
mov cx, es:[bx+2]
|
||
mov [bx+2], cx
|
||
cmp cx, ax
|
||
jbe short loc_12C5
|
||
|
||
loc_12D7:
|
||
pop ds
|
||
jmp short loc_1317
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_12DA:
|
||
xor bx, bx
|
||
mov ax, es:[bx+2]
|
||
mov ds:334Ah, ax
|
||
cmp ax, ds:3348h
|
||
jz short loc_1317
|
||
mov es, ax
|
||
cmp es:[bx], bx
|
||
jnz short loc_1317
|
||
mov ax, es:[bx+2]
|
||
mov ds:334Ah, ax
|
||
mov cx, ds:3348h
|
||
cmp ax, cx
|
||
jz short loc_1313
|
||
jmp short loc_130A
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
|
||
loc_1302:
|
||
mov ax, es:[bx+2]
|
||
cmp ax, cx
|
||
jz short loc_1313
|
||
|
||
loc_130A:
|
||
mov es, ax
|
||
cmp es:[bx], bx
|
||
jnz short loc_1302
|
||
mov bx, es
|
||
|
||
loc_1313:
|
||
mov ds:334Ch, bx
|
||
|
||
loc_1317:
|
||
clc
|
||
pop es
|
||
pop cx
|
||
pop bx
|
||
retn 2
|
||
sub_1276 endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: bp-based frame
|
||
|
||
sub_131E proc near
|
||
|
||
arg_0 = word ptr 4
|
||
arg_2 = word ptr 6
|
||
|
||
push bp
|
||
mov bp, sp
|
||
mov ax, [bp+arg_2]
|
||
mov word_22AE, ax
|
||
mov ds:334Eh, ax
|
||
add ax, [bp+arg_0]
|
||
mov ds:3348h, ax
|
||
mov ds:334Ah, ax
|
||
mov word ptr ds:334Ch, 0
|
||
mov word_22B0, 0
|
||
clc
|
||
pop bp
|
||
retn 4
|
||
sub_131E endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
|
||
sub_1344 proc near
|
||
push bx
|
||
mov bx, 0FFFFh
|
||
mov ah, 48h
|
||
int 21h ; DOS - 2+ - ALLOCATE MEMORY
|
||
; BX = number of 16-byte paragraphs desired
|
||
mov ax, word_22B4
|
||
cmp bx, ax
|
||
jbe short loc_1355
|
||
sub bx, ax
|
||
|
||
loc_1355:
|
||
mov ah, 48h
|
||
int 21h ; DOS - 2+ - ALLOCATE MEMORY
|
||
; BX = number of 16-byte paragraphs desired
|
||
jb short loc_1368
|
||
push ax
|
||
push ax
|
||
push bx
|
||
call sub_131E
|
||
mov word_22B0, 1
|
||
pop ax
|
||
|
||
loc_1368:
|
||
pop bx
|
||
retn
|
||
sub_1344 endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
|
||
sub_136A proc near
|
||
cmp word_22AE, 0
|
||
jz short loc_1394
|
||
mov ax, ds:3348h
|
||
cmp ds:334Ah, ax
|
||
jnz short loc_1398
|
||
mov ax, word_22AE
|
||
cmp ds:334Eh, ax
|
||
jnz short loc_1398
|
||
mov es, ax
|
||
xor ax, ax
|
||
cmp word_22B0, ax
|
||
mov word_22AE, ax
|
||
jz short loc_1394
|
||
mov ah, 49h
|
||
int 21h ; DOS - 2+ - FREE MEMORY
|
||
; ES = segment address of area to be freed
|
||
|
||
loc_1394:
|
||
mov ax, 1
|
||
retn
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1398:
|
||
xor ax, ax
|
||
stc
|
||
retn
|
||
sub_136A endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: bp-based frame
|
||
|
||
sub_139C proc near
|
||
|
||
arg_0 = word ptr 4
|
||
arg_2 = word ptr 6
|
||
arg_4 = word ptr 8
|
||
arg_6 = word ptr 0Ah
|
||
|
||
push bp
|
||
mov bp, sp
|
||
mov ax, [bp+arg_6]
|
||
mov bx, [bp+arg_2]
|
||
test ax, bx
|
||
js short loc_1428
|
||
cmp ax, bx
|
||
jl short loc_13AE
|
||
xchg ax, bx
|
||
|
||
loc_13AE:
|
||
cmp ax, 8000h
|
||
sbb dx, dx
|
||
and ax, dx
|
||
mov cx, word_2242
|
||
shl cx, 3
|
||
dec cx
|
||
sub bx, cx
|
||
sbb dx, dx
|
||
and bx, dx
|
||
add bx, cx
|
||
sub bx, ax
|
||
jl short loc_1428
|
||
mov word_22B6, ax
|
||
mov word_22B8, bx
|
||
add ax, bx
|
||
mov word_22BA, ax
|
||
mov ax, [bp+arg_4]
|
||
mov bx, [bp+arg_0]
|
||
test ax, bx
|
||
js short loc_1428
|
||
cmp ax, bx
|
||
jl short loc_13E4
|
||
xchg ax, bx
|
||
|
||
loc_13E4:
|
||
cmp ax, 8000h
|
||
sbb dx, dx
|
||
and ax, dx
|
||
mov cx, word_2240
|
||
dec cx
|
||
sub bx, cx
|
||
sbb dx, dx
|
||
and bx, dx
|
||
add bx, cx
|
||
sub bx, ax
|
||
jl short loc_1428
|
||
mov word_22BC, ax
|
||
mov cx, ax
|
||
mov word_22BE, bx
|
||
add ax, bx
|
||
mov word_22C0, ax
|
||
mov ax, word_2242
|
||
xchg ax, bx
|
||
mul bx
|
||
mov word_22C4, ax
|
||
mov ax, bx
|
||
shr ax, 4
|
||
mul cx
|
||
add ax, word_223C
|
||
mov word_22C2, ax
|
||
mov ax, 1
|
||
pop bp
|
||
retn 8
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1428:
|
||
xor ax, ax
|
||
pop bp
|
||
retn 8
|
||
sub_139C endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: bp-based frame
|
||
|
||
sub_142E proc near
|
||
|
||
arg_0 = word ptr 4
|
||
arg_2 = word ptr 6
|
||
arg_4 = word ptr 8
|
||
|
||
push bp
|
||
mov bp, sp
|
||
push di
|
||
mov dx, [bp+arg_0]
|
||
sub dx, word_22BC
|
||
cmp dx, word_22BE
|
||
ja short loc_14AE
|
||
mov cx, [bp+arg_4]
|
||
mov bx, [bp+arg_2]
|
||
mov bp, dx
|
||
shl bp, 2
|
||
add bp, dx
|
||
shl bp, 4
|
||
mov ax, word_22B6
|
||
sub cx, ax
|
||
sub bx, ax
|
||
test cx, bx
|
||
js short loc_14AE
|
||
cmp cx, bx
|
||
jg short loc_1460
|
||
xchg cx, bx
|
||
|
||
loc_1460:
|
||
cmp bx, 8000h
|
||
sbb dx, dx
|
||
and bx, dx
|
||
mov di, word_22B8
|
||
sub cx, di
|
||
sbb dx, dx
|
||
and cx, dx
|
||
add cx, di
|
||
sub cx, bx
|
||
jl short loc_14AE
|
||
mov es, word_22C2
|
||
add bx, ax
|
||
mov di, bx
|
||
shr di, 4
|
||
shl di, 1
|
||
add di, bp
|
||
and bx, 0Fh
|
||
add cx, bx
|
||
sub cx, 10h
|
||
shl bx, 1
|
||
mov ax, [bx+22C6h]
|
||
not ax
|
||
mov bx, cx
|
||
and bx, 0Fh
|
||
shl bx, 1
|
||
sar cx, 4
|
||
js short loc_14A9
|
||
stosw
|
||
mov ax, 0FFFFh
|
||
rep stosw
|
||
|
||
loc_14A9:
|
||
and ax, [bx+22C8h]
|
||
stosw
|
||
|
||
loc_14AE:
|
||
pop di
|
||
pop bp
|
||
retn 6
|
||
sub_142E endp
|
||
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
|
||
sub_14B4 proc near
|
||
mov bx, sp
|
||
mov al, ss:[bx+4]
|
||
mov ah, ss:[bx+2]
|
||
mov dx, 7Eh
|
||
pushf
|
||
cli
|
||
out 7Ch, al
|
||
shr ah, 1
|
||
sbb al, al
|
||
out dx, al
|
||
shr ah, 1
|
||
sbb al, al
|
||
out dx, al
|
||
shr ah, 1
|
||
sbb al, al
|
||
out dx, al
|
||
shr ah, 1
|
||
sbb al, al
|
||
out dx, al
|
||
popf
|
||
retn 4
|
||
sub_14B4 endp
|
||
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
|
||
sub_14DE proc near
|
||
xor al, al
|
||
out 7Ch, al
|
||
retn
|
||
sub_14DE endp
|
||
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: bp-based frame
|
||
|
||
sub_14E4 proc near
|
||
|
||
arg_0 = word ptr 2
|
||
arg_2 = word ptr 4
|
||
|
||
mov bx, bp
|
||
mov bp, sp
|
||
mov cx, [bp+arg_2]
|
||
mov dx, [bp+arg_0]
|
||
mov bp, bx
|
||
cmp cx, word_22B6
|
||
jl short locret_1524
|
||
cmp cx, word_22BA
|
||
jg short locret_1524
|
||
sub dx, word_22BC
|
||
jl short locret_1524
|
||
cmp dx, word_22BE
|
||
jg short locret_1524
|
||
mov ax, dx
|
||
shl ax, 2
|
||
add dx, ax
|
||
add dx, word_22C2
|
||
mov es, dx
|
||
mov bx, cx
|
||
shr bx, 3
|
||
and cl, 7
|
||
mov al, 80h
|
||
shr al, cl
|
||
mov es:[bx], al
|
||
|
||
locret_1524:
|
||
retn 4
|
||
sub_14E4 endp
|
||
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
|
||
sub_1528 proc near
|
||
mov al, 0
|
||
out 7Ch, al
|
||
mov al, 7
|
||
out 6Ah, al ; PC-98 GDC (6a):
|
||
;
|
||
mov al, 5
|
||
out 6Ah, al ; PC-98 GDC (6a):
|
||
;
|
||
mov al, 80h
|
||
out 7Ch, al
|
||
mov al, 6
|
||
out 6Ah, al ; PC-98 GDC (6a):
|
||
;
|
||
retn
|
||
sub_1528 endp
|
||
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
|
||
sub_153E proc near
|
||
mov ax, 0FFF0h
|
||
mov dx, 4A0h
|
||
out dx, ax
|
||
mov ax, 0FFFFh
|
||
mov dx, 4A8h
|
||
out dx, ax
|
||
mov al, 7
|
||
out 6Ah, al ; PC-98 GDC (6a):
|
||
;
|
||
mov al, 4
|
||
out 6Ah, al ; PC-98 GDC (6a):
|
||
;
|
||
mov al, 0
|
||
out 7Ch, al
|
||
mov al, 6
|
||
out 6Ah, al ; PC-98 GDC (6a):
|
||
;
|
||
retn
|
||
sub_153E endp
|
||
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
|
||
sub_155E proc near
|
||
call sub_1528
|
||
mov dx, 4A0h
|
||
mov ax, 0FFF0h
|
||
out dx, ax
|
||
mov dx, 4A2h
|
||
mov ax, 0FFh
|
||
out dx, ax
|
||
mov dx, 4A8h
|
||
mov ax, 0FFFFh
|
||
out dx, ax
|
||
mov dx, 4ACh
|
||
xor ax, ax
|
||
out dx, ax
|
||
mov dx, 4AEh
|
||
mov ax, 0Fh
|
||
out dx, ax
|
||
call sub_153E
|
||
retn
|
||
sub_155E endp
|
||
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: bp-based frame
|
||
|
||
sub_1588 proc near
|
||
|
||
var_2 = word ptr -2
|
||
arg_0 = word ptr 4
|
||
arg_2 = word ptr 6
|
||
arg_4 = word ptr 8
|
||
|
||
enter 2, 0
|
||
push si
|
||
push di
|
||
mov ax, [bp+arg_0]
|
||
test ax, ax
|
||
jz short loc_160A
|
||
mov si, ax
|
||
mov [bp+var_2], ax
|
||
mov di, 0
|
||
|
||
loc_159D:
|
||
mov bx, [bp+arg_4]
|
||
mov ax, bx
|
||
sub ax, si
|
||
push ax
|
||
add bx, si
|
||
push bx
|
||
mov ax, [bp+arg_2]
|
||
sub ax, di
|
||
push ax
|
||
call sub_142E
|
||
mov bx, [bp+arg_4]
|
||
mov ax, bx
|
||
sub ax, si
|
||
push ax
|
||
add bx, si
|
||
push bx
|
||
mov ax, [bp+arg_2]
|
||
add ax, di
|
||
push ax
|
||
call sub_142E
|
||
mov ax, di
|
||
stc
|
||
rcl ax, 1
|
||
sub [bp+var_2], ax
|
||
jns short loc_15FF
|
||
mov bx, [bp+arg_4]
|
||
mov ax, bx
|
||
sub ax, di
|
||
push ax
|
||
add bx, di
|
||
push bx
|
||
mov ax, [bp+arg_2]
|
||
sub ax, si
|
||
push ax
|
||
call sub_142E
|
||
mov bx, [bp+arg_4]
|
||
mov ax, bx
|
||
sub ax, di
|
||
push ax
|
||
add bx, di
|
||
push bx
|
||
mov ax, [bp+arg_2]
|
||
add ax, si
|
||
push ax
|
||
call sub_142E
|
||
dec si
|
||
mov ax, si
|
||
shl ax, 1
|
||
add [bp+var_2], ax
|
||
|
||
loc_15FF:
|
||
inc di
|
||
cmp si, di
|
||
jnb short loc_159D
|
||
pop di
|
||
pop si
|
||
leave
|
||
retn 6
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_160A:
|
||
push [bp+arg_4]
|
||
push [bp+arg_2]
|
||
call sub_14E4
|
||
pop di
|
||
pop si
|
||
leave
|
||
retn 6
|
||
sub_1588 endp
|
||
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
|
||
sub_161A proc near
|
||
push di
|
||
mov di, sp
|
||
mov ax, word_22BC
|
||
mov cx, ax
|
||
mov bx, ss:[di+8]
|
||
sub bx, ax
|
||
jg short loc_162C
|
||
xor bx, bx
|
||
|
||
loc_162C:
|
||
mov ax, bx
|
||
shl ax, 2
|
||
add ax, bx
|
||
add ax, word_22C2
|
||
mov es, ax
|
||
mov ax, word_22BE
|
||
mov dx, ss:[di+4]
|
||
sub dx, cx
|
||
cmp dx, ax
|
||
jl short loc_1648
|
||
mov dx, ax
|
||
|
||
loc_1648:
|
||
sub dx, bx
|
||
jl short loc_167E
|
||
mov ax, ss:[di+0Ah]
|
||
mov bx, ss:[di+6]
|
||
sub bx, ax
|
||
jl short loc_167E
|
||
inc bx
|
||
mov di, dx
|
||
shl di, 2
|
||
add di, dx
|
||
shl di, 4
|
||
add di, ax
|
||
lea dx, [bx+50h]
|
||
mov ax, 0FFFFh
|
||
test di, 1
|
||
jnz short loc_1690
|
||
shr bx, 1
|
||
jb short loc_1682
|
||
nop
|
||
|
||
loc_1676:
|
||
mov cx, bx
|
||
rep stosw
|
||
sub di, dx
|
||
jnb short loc_1676
|
||
|
||
loc_167E:
|
||
pop di
|
||
retn 8
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1682:
|
||
mov cx, bx
|
||
rep stosw
|
||
stosb
|
||
sub di, dx
|
||
jnb short loc_1682
|
||
pop di
|
||
retn 8
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
|
||
loc_1690:
|
||
shr bx, 1
|
||
jb short loc_16A4
|
||
dec bx
|
||
nop
|
||
|
||
loc_1696:
|
||
mov cx, bx
|
||
stosb
|
||
rep stosw
|
||
stosb
|
||
sub di, dx
|
||
jnb short loc_1696
|
||
pop di
|
||
retn 8
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_16A4:
|
||
mov cx, bx
|
||
stosb
|
||
rep stosw
|
||
sub di, dx
|
||
jnb short loc_16A4
|
||
pop di
|
||
retn 8
|
||
sub_161A endp
|
||
|
||
; ---------------------------------------------------------------------------
|
||
nop
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
|
||
sub_16B2 proc near
|
||
mov ax, 4E35h
|
||
mul word_266A
|
||
mov cx, ax
|
||
mov ax, 15Ah
|
||
mul word_2668
|
||
add cx, ax
|
||
mov ax, 4E35h
|
||
mul word_2668
|
||
add ax, 1
|
||
adc dx, cx
|
||
mov word_2668, ax
|
||
mov ax, dx
|
||
mov word_266A, ax
|
||
and ah, 7Fh
|
||
retn
|
||
sub_16B2 endp
|
||
|
||
include libs/BorlandC/__abort.asm
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: library function bp-based frame
|
||
|
||
; int __cdecl atexit(void (*func)(void))
|
||
_atexit proc near
|
||
|
||
func = word ptr 4
|
||
|
||
push bp
|
||
mov bp, sp
|
||
push si
|
||
push di
|
||
cmp word_268C, 20h
|
||
jnz short loc_1702
|
||
mov ax, 1
|
||
jmp short loc_1715
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1702:
|
||
mov bx, word_268C
|
||
add bx, bx
|
||
mov ax, [bp+func]
|
||
mov [bx+3360h], ax
|
||
inc word_268C
|
||
xor ax, ax
|
||
|
||
loc_1715:
|
||
pop di
|
||
pop si
|
||
pop bp
|
||
retn
|
||
_atexit endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: library function bp-based frame
|
||
|
||
; int __cdecl __ErrorMessage(char *buf)
|
||
___ErrorMessage proc near
|
||
|
||
buf = word ptr 4
|
||
|
||
push bp
|
||
mov bp, sp
|
||
push si
|
||
push di
|
||
push [bp+buf] ; s
|
||
call _strlen
|
||
pop cx
|
||
push ax ; len
|
||
push [bp+buf] ; buf
|
||
mov al, byte_26B8
|
||
cbw
|
||
push ax ; handle
|
||
call __rtl_write
|
||
add sp, 6
|
||
pop di
|
||
pop si
|
||
pop bp
|
||
retn
|
||
___ErrorMessage endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: library function
|
||
|
||
sub_1738 proc near
|
||
push si
|
||
push di
|
||
pop di
|
||
pop si
|
||
retn
|
||
sub_1738 endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: library function bp-based frame
|
||
|
||
sub_173D proc near
|
||
|
||
arg_0 = word ptr 4
|
||
arg_2 = word ptr 6
|
||
arg_4 = word ptr 8
|
||
|
||
push bp
|
||
mov bp, sp
|
||
push si
|
||
push di
|
||
cmp [bp+arg_4], 0
|
||
jnz short loc_1766
|
||
jmp short loc_1758
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_174A:
|
||
dec word_268C
|
||
mov bx, word_268C
|
||
add bx, bx
|
||
call word ptr [bx+3360h]
|
||
|
||
loc_1758:
|
||
cmp word_268C, 0
|
||
jnz short loc_174A
|
||
call __cleanup
|
||
call off_268E
|
||
|
||
loc_1766:
|
||
call __restorezero
|
||
call __checknull
|
||
cmp [bp+arg_2], 0
|
||
jnz short loc_1787
|
||
cmp [bp+arg_4], 0
|
||
jnz short loc_1780
|
||
call off_2690
|
||
call off_2692
|
||
|
||
loc_1780:
|
||
push [bp+arg_0]
|
||
call __terminate
|
||
; ---------------------------------------------------------------------------
|
||
pop cx
|
||
|
||
loc_1787:
|
||
pop di
|
||
pop si
|
||
pop bp
|
||
retn 6
|
||
sub_173D endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: library function noreturn bp-based frame
|
||
|
||
; void __cdecl exit(int status)
|
||
_exit proc near
|
||
|
||
status = word ptr 4
|
||
|
||
push bp
|
||
mov bp, sp
|
||
push si
|
||
push di
|
||
xor ax, ax
|
||
push ax
|
||
push ax
|
||
push [bp+status]
|
||
call sub_173D
|
||
pop di
|
||
pop si
|
||
pop bp
|
||
retn
|
||
_exit endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: library function noreturn bp-based frame
|
||
|
||
; void __cdecl _exit(int status)
|
||
__exit proc near
|
||
|
||
status = word ptr 4
|
||
|
||
push bp
|
||
mov bp, sp
|
||
push si
|
||
push di
|
||
mov ax, 1
|
||
push ax
|
||
xor ax, ax
|
||
push ax
|
||
push [bp+status]
|
||
call sub_173D
|
||
pop di
|
||
pop si
|
||
pop bp
|
||
retn
|
||
__exit endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: library function
|
||
|
||
; void _cexit(void)
|
||
__cexit proc near
|
||
push si
|
||
push di
|
||
xor ax, ax
|
||
push ax
|
||
mov ax, 1
|
||
push ax
|
||
xor ax, ax
|
||
push ax
|
||
call sub_173D
|
||
pop di
|
||
pop si
|
||
retn
|
||
__cexit endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: library function
|
||
|
||
; void _c_exit(void)
|
||
__c_exit proc near
|
||
push si
|
||
push di
|
||
mov ax, 1
|
||
push ax
|
||
push ax
|
||
xor ax, ax
|
||
push ax
|
||
call sub_173D
|
||
pop di
|
||
pop si
|
||
retn
|
||
__c_exit endp
|
||
|
||
include libs/BorlandC/H_LRSH.ASM
|
||
include libs/BorlandC/__IOERROR.ASM
|
||
include libs/BorlandC/_isatty.asm
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: library function bp-based frame
|
||
|
||
; __int32 __cdecl lseek(int handle, __int32 offset, int fromwhere)
|
||
_lseek proc near
|
||
|
||
handle = word ptr 4
|
||
_offset = word ptr 6
|
||
arg_4 = word ptr 8
|
||
fromwhere = byte ptr 0Ah
|
||
|
||
push bp
|
||
mov bp, sp
|
||
push si
|
||
push di
|
||
mov bx, [bp+handle]
|
||
add bx, bx
|
||
and word ptr [bx+27D6h], 0FDFFh
|
||
mov ah, 42h
|
||
mov al, [bp+fromwhere]
|
||
mov bx, [bp+handle]
|
||
mov cx, [bp+arg_4]
|
||
mov dx, [bp+_offset]
|
||
int 21h ; DOS - 2+ - MOVE FILE READ/WRITE POINTER (LSEEK)
|
||
; AL = method:
|
||
; 0-from beginnig,1-from current,2-from end
|
||
jb short loc_1883
|
||
jmp short loc_1888
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1883:
|
||
push ax
|
||
call __IOERROR
|
||
cwd
|
||
|
||
loc_1888:
|
||
pop di
|
||
pop si
|
||
pop bp
|
||
retn
|
||
_lseek endp
|
||
|
||
include libs/BorlandC/N_LXMUL.ASM
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: library function
|
||
|
||
__setupio proc near
|
||
push si
|
||
push di
|
||
mov dx, 5
|
||
jmp short loc_18CF
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_18AA:
|
||
mov bx, dx
|
||
add bx, bx
|
||
mov word ptr [bx+27D6h], 0
|
||
mov bx, dx
|
||
mov cl, 4
|
||
shl bx, cl
|
||
mov byte ptr [bx+2698h], 0FFh
|
||
mov ax, dx
|
||
shl ax, cl
|
||
add ax, 2694h
|
||
mov bx, dx
|
||
shl bx, cl
|
||
mov [bx+26A2h], ax
|
||
inc dx
|
||
|
||
loc_18CF:
|
||
cmp dx, word_27D4
|
||
jb short loc_18AA
|
||
mov al, byte_2698
|
||
cbw
|
||
push ax ; handle
|
||
call _isatty
|
||
pop cx
|
||
or ax, ax
|
||
jnz short loc_18E8
|
||
and word_2696, 0FDFFh
|
||
|
||
loc_18E8:
|
||
mov ax, 200h
|
||
push ax ; size
|
||
test byte ptr word_2696+1, 2
|
||
jz short loc_18F8
|
||
mov ax, 1
|
||
jmp short loc_18FA
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_18F8:
|
||
xor ax, ax
|
||
|
||
loc_18FA:
|
||
push ax ; type
|
||
xor ax, ax
|
||
push ax ; buf
|
||
mov ax, 2694h
|
||
push ax ; stream
|
||
call _setvbuf
|
||
add sp, 8
|
||
mov al, byte_26A8
|
||
cbw
|
||
push ax ; handle
|
||
call _isatty
|
||
pop cx
|
||
or ax, ax
|
||
jnz short loc_191B
|
||
and word_26A6, 0FDFFh
|
||
|
||
loc_191B:
|
||
mov ax, 200h
|
||
push ax ; size
|
||
test byte ptr word_26A6+1, 2
|
||
jz short loc_192B
|
||
mov ax, 2
|
||
jmp short loc_192D
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_192B:
|
||
xor ax, ax
|
||
|
||
loc_192D:
|
||
push ax ; type
|
||
xor ax, ax
|
||
push ax ; buf
|
||
mov ax, 26A4h
|
||
push ax ; stream
|
||
call _setvbuf
|
||
add sp, 8
|
||
pop di
|
||
pop si
|
||
retn
|
||
__setupio endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: library function bp-based frame
|
||
|
||
___brk proc near
|
||
|
||
arg_0 = word ptr 4
|
||
|
||
push bp
|
||
mov bp, sp
|
||
push si
|
||
push di
|
||
mov ax, [bp+arg_0]
|
||
mov dx, sp
|
||
sub dx, 200h
|
||
cmp ax, dx
|
||
jnb short loc_1957
|
||
mov word_21C0, ax
|
||
xor ax, ax
|
||
jmp short loc_1960
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1957:
|
||
mov __errno, 8
|
||
mov ax, 0FFFFh
|
||
|
||
loc_1960:
|
||
pop di
|
||
pop si
|
||
pop bp
|
||
retn
|
||
___brk endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: library function bp-based frame
|
||
|
||
___sbrk proc near
|
||
|
||
arg_0 = word ptr 4
|
||
arg_2 = word ptr 6
|
||
|
||
push bp
|
||
mov bp, sp
|
||
push si
|
||
push di
|
||
mov ax, [bp+arg_0]
|
||
mov dx, [bp+arg_2]
|
||
add ax, word_21C0
|
||
adc dx, 0
|
||
mov cx, ax
|
||
or dx, dx
|
||
jnz short loc_198C
|
||
add cx, 200h
|
||
jb short loc_198C
|
||
cmp cx, sp
|
||
jnb short loc_198C
|
||
xchg ax, word_21C0
|
||
jmp short loc_1995
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_198C:
|
||
mov __errno, 8
|
||
mov ax, 0FFFFh
|
||
|
||
loc_1995:
|
||
pop di
|
||
pop si
|
||
pop bp
|
||
retn
|
||
___sbrk endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: library function bp-based frame
|
||
|
||
; int __cdecl brk(void *addr)
|
||
_brk proc near
|
||
|
||
addr = word ptr 4
|
||
|
||
push bp
|
||
mov bp, sp
|
||
push si
|
||
push di
|
||
push [bp+addr]
|
||
call ___brk
|
||
pop cx
|
||
pop di
|
||
pop si
|
||
pop bp
|
||
retn
|
||
_brk endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: library function bp-based frame
|
||
|
||
; void *__cdecl sbrk(int incr)
|
||
_sbrk proc near
|
||
|
||
incr = word ptr 4
|
||
|
||
push bp
|
||
mov bp, sp
|
||
push si
|
||
push di
|
||
mov ax, [bp+incr]
|
||
cwd
|
||
push dx
|
||
push ax
|
||
call ___sbrk
|
||
pop cx
|
||
pop cx
|
||
pop di
|
||
pop si
|
||
pop bp
|
||
retn
|
||
_sbrk endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: library function
|
||
|
||
; void __cdecl free(void *block)
|
||
_free proc near
|
||
|
||
block = word ptr 2
|
||
|
||
push si
|
||
push di
|
||
mov si, sp
|
||
mov bx, [si+6]
|
||
sub bx, 4
|
||
jb short loc_19D7
|
||
cmp bx, word_2860
|
||
jz short loc_19D4
|
||
call sub_1A14
|
||
jmp short loc_19D7
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_19D4:
|
||
call sub_19DA
|
||
|
||
loc_19D7:
|
||
pop di
|
||
pop si
|
||
retn
|
||
_free endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: library function
|
||
|
||
sub_19DA proc near
|
||
cmp word_285E, bx
|
||
jz short loc_1A03
|
||
mov si, [bx+2]
|
||
test byte ptr [si], 1
|
||
jz short loc_19EE
|
||
mov word_2860, si
|
||
jmp short loc_1A0E
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_19EE:
|
||
cmp si, word_285E
|
||
jz short loc_1A01
|
||
mov bx, si
|
||
call sub_1A4D
|
||
mov ax, [bx+2]
|
||
mov word_2860, ax
|
||
jmp short loc_1A0E
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1A01:
|
||
mov bx, si
|
||
|
||
loc_1A03:
|
||
xor ax, ax
|
||
mov word_285E, ax
|
||
mov word_2860, ax
|
||
mov word_2862, ax
|
||
|
||
loc_1A0E:
|
||
push bx
|
||
call ___brk
|
||
pop bx
|
||
retn
|
||
sub_19DA endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: library function
|
||
|
||
sub_1A14 proc near
|
||
dec word ptr [bx]
|
||
cmp bx, word_285E
|
||
jz short loc_1A34
|
||
mov si, [bx+2]
|
||
mov ax, [si]
|
||
test al, 1
|
||
jnz short loc_1A34
|
||
add ax, [bx]
|
||
mov [si], ax
|
||
mov di, [bx]
|
||
add di, bx
|
||
mov [di+2], si
|
||
mov bx, si
|
||
jmp short loc_1A37
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1A34:
|
||
call sub_1A69
|
||
|
||
loc_1A37:
|
||
mov di, [bx]
|
||
add di, bx
|
||
mov ax, [di]
|
||
test al, 1
|
||
jz short loc_1A42
|
||
retn
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1A42:
|
||
add [bx], ax
|
||
mov si, di
|
||
add si, ax
|
||
mov [si+2], bx
|
||
mov bx, di
|
||
sub_1A14 endp ; sp-analysis failed
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: library function
|
||
|
||
sub_1A4D proc near
|
||
mov di, [bx+6]
|
||
cmp bx, di
|
||
jz short loc_1A62
|
||
mov word_2862, di
|
||
mov si, [bx+4]
|
||
mov [di+4], si
|
||
mov [si+6], di
|
||
retn
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1A62:
|
||
mov word_2862, 0
|
||
retn
|
||
sub_1A4D endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: library function
|
||
|
||
sub_1A69 proc near
|
||
mov si, word_2862
|
||
or si, si
|
||
jz short loc_1A81
|
||
mov di, [si+6]
|
||
mov [si+6], bx
|
||
mov [di+4], bx
|
||
mov [bx+6], di
|
||
mov [bx+4], si
|
||
retn
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1A81:
|
||
mov word_2862, bx
|
||
mov [bx+4], bx
|
||
mov [bx+6], bx
|
||
retn
|
||
sub_1A69 endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: library function
|
||
|
||
; void *__cdecl malloc(size_t size)
|
||
_malloc proc near
|
||
|
||
_size = word ptr 2
|
||
|
||
push si
|
||
push di
|
||
mov si, sp
|
||
mov ax, [si+6]
|
||
or ax, ax
|
||
jz short loc_1AE9
|
||
add ax, 5
|
||
jb short loc_1AD2
|
||
and ax, 0FFFEh
|
||
cmp ax, 8
|
||
jnb short loc_1AA7
|
||
mov ax, 8
|
||
|
||
loc_1AA7:
|
||
cmp word_285E, 0
|
||
jz short loc_1ACD
|
||
mov bx, word_2862
|
||
or bx, bx
|
||
jz short loc_1AC3
|
||
mov dx, bx
|
||
|
||
loc_1AB8:
|
||
cmp [bx], ax
|
||
jnb short loc_1AD6
|
||
mov bx, [bx+6]
|
||
cmp bx, dx
|
||
jnz short loc_1AB8
|
||
|
||
loc_1AC3:
|
||
call sub_1B2C
|
||
jmp short loc_1AE9
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1AC8:
|
||
call sub_1B55
|
||
jmp short loc_1AE9
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1ACD:
|
||
call sub_1AEC
|
||
jmp short loc_1AE9
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1AD2:
|
||
xor ax, ax
|
||
jmp short loc_1AE9
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1AD6:
|
||
mov si, ax
|
||
add si, 8
|
||
cmp [bx], si
|
||
jnb short loc_1AC8
|
||
call sub_1A4D
|
||
inc word ptr [bx]
|
||
mov ax, bx
|
||
add ax, 4
|
||
|
||
loc_1AE9:
|
||
pop di
|
||
pop si
|
||
retn
|
||
_malloc endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: library function
|
||
|
||
sub_1AEC proc near
|
||
push ax
|
||
xor ax, ax
|
||
push ax
|
||
push ax
|
||
call ___sbrk
|
||
pop bx
|
||
pop bx
|
||
and ax, 1
|
||
jz short loc_1B04
|
||
xor dx, dx
|
||
push dx
|
||
push ax
|
||
call ___sbrk
|
||
pop bx
|
||
pop bx
|
||
|
||
loc_1B04:
|
||
pop ax
|
||
push ax
|
||
xor bx, bx
|
||
push bx
|
||
push ax
|
||
call ___sbrk
|
||
pop bx
|
||
pop bx
|
||
cmp ax, 0FFFFh
|
||
jz short loc_1B28
|
||
mov bx, ax
|
||
mov word_285E, bx
|
||
mov word_2860, bx
|
||
pop ax
|
||
inc ax
|
||
mov [bx], ax
|
||
add bx, 4
|
||
mov ax, bx
|
||
retn
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1B28:
|
||
pop bx
|
||
xor ax, ax
|
||
retn
|
||
sub_1AEC endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: library function
|
||
|
||
sub_1B2C proc near
|
||
push ax
|
||
xor bx, bx
|
||
push bx
|
||
push ax
|
||
call ___sbrk
|
||
pop bx
|
||
pop bx
|
||
cmp ax, 0FFFFh
|
||
jz short loc_1B51
|
||
mov bx, ax
|
||
mov ax, word_2860
|
||
mov [bx+2], ax
|
||
mov word_2860, bx
|
||
pop ax
|
||
inc ax
|
||
mov [bx], ax
|
||
add bx, 4
|
||
mov ax, bx
|
||
retn
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1B51:
|
||
pop ax
|
||
xor ax, ax
|
||
retn
|
||
sub_1B2C endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: library function
|
||
|
||
sub_1B55 proc near
|
||
sub [bx], ax
|
||
mov si, bx
|
||
add si, [bx]
|
||
mov di, si
|
||
add di, ax
|
||
inc ax
|
||
mov [si], ax
|
||
mov [si+2], bx
|
||
mov [di+2], si
|
||
add si, 4
|
||
mov ax, si
|
||
retn
|
||
sub_1B55 endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: library function bp-based frame
|
||
|
||
; int __fastcall sub_1B6E(size_t size)
|
||
sub_1B6E proc near
|
||
|
||
var_2 = word ptr -2
|
||
|
||
mov bp, sp
|
||
push bx
|
||
push ax
|
||
push cx
|
||
push ax ; size
|
||
call _malloc
|
||
pop bx
|
||
mov bx, ax
|
||
or ax, ax
|
||
jz short loc_1B9D
|
||
push ds
|
||
pop es
|
||
assume es:seg000
|
||
cld
|
||
mov di, ax
|
||
mov si, [bp+var_2]
|
||
mov cx, [si]
|
||
add si, 4
|
||
push si ; block
|
||
sub cx, 5
|
||
shr cx, 1
|
||
rep movsw
|
||
mov [bp+var_2], ax
|
||
call _free
|
||
pop bx
|
||
mov bx, [bp+var_2]
|
||
|
||
loc_1B9D:
|
||
add sp, 6
|
||
retn
|
||
sub_1B6E endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: library function
|
||
|
||
sub_1BA1 proc near
|
||
mov ax, dx
|
||
add dx, 8
|
||
cmp dx, cx
|
||
ja short loc_1BDF
|
||
mov dx, cx
|
||
cmp bx, word_2860
|
||
jnz short loc_1BC1
|
||
mov [bx], ax
|
||
inc word ptr [bx]
|
||
add ax, bx
|
||
push bx
|
||
push ax
|
||
call ___brk
|
||
pop bx
|
||
pop bx
|
||
jmp short loc_1BDF
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1BC1:
|
||
mov di, bx
|
||
add di, ax
|
||
mov [di+2], bx
|
||
sub dx, ax
|
||
sub [bx], dx
|
||
mov si, di
|
||
add si, dx
|
||
mov [si+2], di
|
||
inc dx
|
||
mov [di], dx
|
||
mov cx, bx
|
||
mov bx, di
|
||
call sub_1A14
|
||
mov bx, cx
|
||
|
||
loc_1BDF:
|
||
add bx, 4
|
||
retn
|
||
sub_1BA1 endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: library function bp-based frame
|
||
|
||
; void *__cdecl realloc(void *block, size_t size)
|
||
_realloc proc near
|
||
|
||
block = word ptr 8
|
||
_size = word ptr 0Ah
|
||
|
||
push si
|
||
push di
|
||
push bp
|
||
mov bp, sp
|
||
mov bx, [bp+block]
|
||
mov ax, [bp+_size]
|
||
or ax, ax
|
||
jz short loc_1C29
|
||
or bx, bx
|
||
jz short loc_1C23
|
||
sub bx, 4
|
||
mov cx, [bx]
|
||
dec cx
|
||
mov dx, ax
|
||
add dx, 5
|
||
and dx, 0FFFEh
|
||
cmp dx, 8
|
||
jnb short loc_1C0C
|
||
mov dx, 8
|
||
|
||
loc_1C0C:
|
||
cmp cx, dx
|
||
jb short loc_1C1C
|
||
ja short loc_1C17
|
||
add bx, 4
|
||
jmp short loc_1C1F
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1C17:
|
||
call sub_1BA1
|
||
jmp short loc_1C1F
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1C1C:
|
||
call sub_1B6E
|
||
|
||
loc_1C1F:
|
||
mov ax, bx
|
||
jmp short loc_1C30
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1C23:
|
||
push ax ; size
|
||
call _malloc
|
||
jmp short loc_1C2F
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1C29:
|
||
push bx ; block
|
||
call _free
|
||
xor ax, ax
|
||
|
||
loc_1C2F:
|
||
pop bx
|
||
|
||
loc_1C30:
|
||
pop bp
|
||
pop di
|
||
pop si
|
||
retn
|
||
_realloc endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: library function bp-based frame
|
||
|
||
; int __cdecl fflush(FILE *stream)
|
||
_fflush proc near
|
||
|
||
var_2 = word ptr -2
|
||
stream = word ptr 4
|
||
|
||
push bp
|
||
mov bp, sp
|
||
sub sp, 2
|
||
push si
|
||
push di
|
||
cmp [bp+stream], 0
|
||
jnz short loc_1C47
|
||
call _flushall
|
||
jmp short loc_1CBD
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1C47:
|
||
mov bx, [bp+stream]
|
||
mov ax, [bx+0Eh]
|
||
cmp ax, [bp+stream]
|
||
jnz short loc_1CB8
|
||
mov bx, [bp+stream]
|
||
cmp word ptr [bx], 0
|
||
jl short loc_1C85
|
||
test byte ptr [bx+2], 8
|
||
jnz short loc_1C6B
|
||
mov ax, [bp+stream]
|
||
add ax, 5
|
||
cmp [bx+0Ah], ax
|
||
jnz short loc_1CBD
|
||
|
||
loc_1C6B:
|
||
mov bx, [bp+stream]
|
||
mov word ptr [bx], 0
|
||
mov ax, [bp+stream]
|
||
add ax, 5
|
||
cmp [bx+0Ah], ax
|
||
jnz short loc_1CBD
|
||
mov ax, [bx+8]
|
||
mov [bx+0Ah], ax
|
||
jmp short loc_1CBD
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1C85:
|
||
mov bx, [bp+stream]
|
||
mov ax, [bx+6]
|
||
add ax, [bx]
|
||
inc ax
|
||
mov [bp+var_2], ax
|
||
sub [bx], ax
|
||
push ax ; len
|
||
mov ax, [bx+8]
|
||
mov [bx+0Ah], ax
|
||
push ax ; buf
|
||
mov al, [bx+4]
|
||
cbw
|
||
push ax ; handle
|
||
call ___write
|
||
add sp, 6
|
||
cmp ax, [bp+var_2]
|
||
jz short loc_1CBD
|
||
mov bx, [bp+stream]
|
||
test byte ptr [bx+3], 2
|
||
jnz short loc_1CBD
|
||
or word ptr [bx+2], 10h
|
||
|
||
loc_1CB8:
|
||
mov ax, 0FFFFh
|
||
jmp short loc_1CBF
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1CBD:
|
||
xor ax, ax
|
||
|
||
loc_1CBF:
|
||
pop di
|
||
pop si
|
||
mov sp, bp
|
||
pop bp
|
||
retn
|
||
_fflush endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: library function bp-based frame
|
||
|
||
; int flushall(void)
|
||
_flushall proc near
|
||
|
||
var_6 = word ptr -6
|
||
var_4 = word ptr -4
|
||
stream = word ptr -2
|
||
|
||
push bp
|
||
mov bp, sp
|
||
sub sp, 6
|
||
push si
|
||
push di
|
||
mov [bp+var_6], 0
|
||
mov ax, word_27D4
|
||
mov [bp+var_4], ax
|
||
mov [bp+stream], 2694h
|
||
jmp short loc_1CF4
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1CDF:
|
||
mov bx, [bp+stream]
|
||
test byte ptr [bx+2], 3
|
||
jz short loc_1CF0
|
||
push bx ; stream
|
||
call _fflush
|
||
pop cx
|
||
inc [bp+var_6]
|
||
|
||
loc_1CF0:
|
||
add [bp+stream], 10h
|
||
|
||
loc_1CF4:
|
||
mov ax, [bp+var_4]
|
||
dec [bp+var_4]
|
||
or ax, ax
|
||
jnz short loc_1CDF
|
||
mov ax, [bp+var_6]
|
||
pop di
|
||
pop si
|
||
mov sp, bp
|
||
pop bp
|
||
retn
|
||
_flushall endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: library function bp-based frame
|
||
|
||
sub_1D07 proc near
|
||
|
||
var_2 = word ptr -2
|
||
arg_0 = word ptr 4
|
||
|
||
push bp
|
||
mov bp, sp
|
||
sub sp, 2
|
||
push si
|
||
push di
|
||
mov bx, [bp+arg_0]
|
||
cmp word ptr [bx], 0
|
||
jge short loc_1D21
|
||
mov dx, [bx+6]
|
||
add dx, [bx]
|
||
inc dx
|
||
mov ax, dx
|
||
jmp short loc_1D2D
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1D21:
|
||
mov bx, [bp+arg_0]
|
||
mov ax, [bx]
|
||
cwd
|
||
xor ax, dx
|
||
sub ax, dx
|
||
mov dx, ax
|
||
|
||
loc_1D2D:
|
||
mov [bp+var_2], ax
|
||
mov bx, [bp+arg_0]
|
||
test byte ptr [bx+2], 40h
|
||
jnz short loc_1D6C
|
||
mov bx, [bp+arg_0]
|
||
mov cx, [bx+0Ah]
|
||
cmp word ptr [bx], 0
|
||
jge short loc_1D65
|
||
jmp short loc_1D51
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1D46:
|
||
dec cx
|
||
mov bx, cx
|
||
cmp byte ptr [bx], 0Ah
|
||
jnz short loc_1D51
|
||
inc [bp+var_2]
|
||
|
||
loc_1D51:
|
||
mov ax, dx
|
||
dec dx
|
||
or ax, ax
|
||
jnz short loc_1D46
|
||
jmp short loc_1D6C
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1D5A:
|
||
mov bx, cx
|
||
inc cx
|
||
cmp byte ptr [bx], 0Ah
|
||
jnz short loc_1D65
|
||
inc [bp+var_2]
|
||
|
||
loc_1D65:
|
||
mov ax, dx
|
||
dec dx
|
||
or ax, ax
|
||
jnz short loc_1D5A
|
||
|
||
loc_1D6C:
|
||
mov ax, [bp+var_2]
|
||
pop di
|
||
pop si
|
||
mov sp, bp
|
||
pop bp
|
||
retn 2
|
||
sub_1D07 endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: library function bp-based frame
|
||
|
||
; int __cdecl fseek(FILE *stream, __int32 offset, int whence)
|
||
_fseek proc near
|
||
|
||
stream = word ptr 4
|
||
_offset = dword ptr 6
|
||
whence = word ptr 0Ah
|
||
|
||
push bp
|
||
mov bp, sp
|
||
push si
|
||
push di
|
||
push [bp+stream] ; stream
|
||
call _fflush
|
||
pop cx
|
||
or ax, ax
|
||
jz short loc_1D8C
|
||
mov ax, 0FFFFh
|
||
jmp short loc_1DDC
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1D8C:
|
||
cmp [bp+whence], 1
|
||
jnz short loc_1DA5
|
||
mov bx, [bp+stream]
|
||
cmp word ptr [bx], 0
|
||
jle short loc_1DA5
|
||
push bx
|
||
call sub_1D07
|
||
cwd
|
||
sub word ptr [bp+_offset], ax
|
||
sbb word ptr [bp+_offset+2], dx
|
||
|
||
loc_1DA5:
|
||
mov bx, [bp+stream]
|
||
and word ptr [bx+2], 0FE5Fh
|
||
mov word ptr [bx], 0
|
||
mov ax, [bx+8]
|
||
mov [bx+0Ah], ax
|
||
push [bp+whence] ; fromwhere
|
||
push word ptr [bp+_offset+2]
|
||
push word ptr [bp+_offset] ; offset
|
||
mov al, [bx+4]
|
||
cbw
|
||
push ax ; handle
|
||
call _lseek
|
||
add sp, 8
|
||
cmp dx, 0FFFFh
|
||
jnz short loc_1DDA
|
||
cmp ax, 0FFFFh
|
||
jnz short loc_1DDA
|
||
mov ax, 0FFFFh
|
||
jmp short loc_1DDC
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1DDA:
|
||
xor ax, ax
|
||
|
||
loc_1DDC:
|
||
pop di
|
||
pop si
|
||
pop bp
|
||
retn
|
||
_fseek endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: library function bp-based frame
|
||
|
||
; __int32 __cdecl ftell(FILE *stream)
|
||
_ftell proc near
|
||
|
||
var_8 = word ptr -8
|
||
var_6 = word ptr -6
|
||
_offset = dword ptr -4
|
||
stream = word ptr 4
|
||
|
||
push bp
|
||
mov bp, sp
|
||
sub sp, 8
|
||
push si
|
||
push di
|
||
mov ax, 1
|
||
push ax ; fromwhere
|
||
xor ax, ax
|
||
push ax
|
||
push ax ; offset
|
||
mov bx, [bp+stream]
|
||
mov al, [bx+4]
|
||
cbw
|
||
push ax ; handle
|
||
call _lseek
|
||
add sp, 8
|
||
mov word ptr [bp+_offset+2], dx
|
||
mov word ptr [bp+_offset], ax
|
||
cmp dx, 0FFFFh
|
||
jnz short loc_1E11
|
||
cmp ax, 0FFFFh
|
||
jnz short loc_1E11
|
||
jmp loc_1EA1
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1E11:
|
||
mov bx, [bp+stream]
|
||
cmp word ptr [bx], 0
|
||
jge short loc_1E94
|
||
mov al, [bx+4]
|
||
cbw
|
||
add ax, ax
|
||
mov bx, ax
|
||
test byte ptr [bx+27D7h], 8
|
||
jz short loc_1E85
|
||
mov ax, 2
|
||
push ax ; fromwhere
|
||
xor ax, ax
|
||
push ax
|
||
push ax ; offset
|
||
mov bx, [bp+stream]
|
||
mov al, [bx+4]
|
||
cbw
|
||
push ax ; handle
|
||
call _lseek
|
||
add sp, 8
|
||
mov [bp+var_6], dx
|
||
mov [bp+var_8], ax
|
||
cmp dx, 0FFFFh
|
||
jnz short loc_1E50
|
||
cmp ax, 0FFFFh
|
||
jnz short loc_1E50
|
||
jmp short loc_1EA7
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1E50:
|
||
xor ax, ax
|
||
push ax ; fromwhere
|
||
push word ptr [bp+_offset+2]
|
||
push word ptr [bp+_offset] ; offset
|
||
mov bx, [bp+stream]
|
||
mov al, [bx+4]
|
||
cbw
|
||
push ax ; handle
|
||
call _lseek
|
||
add sp, 8
|
||
cmp dx, 0FFFFh
|
||
jnz short loc_1E79
|
||
cmp ax, 0FFFFh
|
||
jnz short loc_1E79
|
||
mov dx, 0FFFFh
|
||
mov ax, 0FFFFh
|
||
jmp short loc_1EA7
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1E79:
|
||
mov dx, [bp+var_6]
|
||
mov ax, [bp+var_8]
|
||
mov word ptr [bp+_offset+2], dx
|
||
mov word ptr [bp+_offset], ax
|
||
|
||
loc_1E85:
|
||
push [bp+stream]
|
||
call sub_1D07
|
||
cwd
|
||
add word ptr [bp+_offset], ax
|
||
adc word ptr [bp+_offset+2], dx
|
||
jmp short loc_1EA1
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1E94:
|
||
push [bp+stream]
|
||
call sub_1D07
|
||
cwd
|
||
sub word ptr [bp+_offset], ax
|
||
sbb word ptr [bp+_offset+2], dx
|
||
|
||
loc_1EA1:
|
||
mov dx, word ptr [bp+_offset+2]
|
||
mov ax, word ptr [bp+_offset]
|
||
|
||
loc_1EA7:
|
||
pop di
|
||
pop si
|
||
mov sp, bp
|
||
pop bp
|
||
retn
|
||
_ftell endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: library function bp-based frame
|
||
|
||
; int __cdecl setvbuf(FILE *stream, char *buf, int type, size_t size)
|
||
_setvbuf proc near
|
||
|
||
stream = word ptr 4
|
||
buf = word ptr 6
|
||
_type = word ptr 8
|
||
_size = word ptr 0Ah
|
||
|
||
push bp
|
||
mov bp, sp
|
||
push si
|
||
push di
|
||
mov bx, [bp+stream]
|
||
mov ax, [bx+0Eh]
|
||
cmp ax, [bp+stream]
|
||
jz short loc_1EC0
|
||
jmp loc_1F6B
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1EC0:
|
||
cmp [bp+_type], 2
|
||
jle short loc_1EC9
|
||
jmp loc_1F6B
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1EC9:
|
||
cmp [bp+_size], 7FFFh
|
||
jbe short loc_1ED3
|
||
jmp loc_1F6B
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1ED3:
|
||
cmp word_2866, 0
|
||
jnz short loc_1EE9
|
||
cmp [bp+stream], 26A4h
|
||
jnz short loc_1EE9
|
||
mov word_2866, 1
|
||
jmp short loc_1EFD
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1EE9:
|
||
cmp word_2864, 0
|
||
jnz short loc_1EFD
|
||
cmp [bp+stream], 2694h
|
||
jnz short loc_1EFD
|
||
mov word_2864, 1
|
||
|
||
loc_1EFD:
|
||
mov bx, [bp+stream]
|
||
cmp word ptr [bx], 0
|
||
jz short loc_1F14
|
||
mov ax, 1
|
||
push ax ; whence
|
||
xor ax, ax
|
||
push ax
|
||
push ax ; offset
|
||
push bx ; stream
|
||
call _fseek
|
||
add sp, 8
|
||
|
||
loc_1F14:
|
||
mov bx, [bp+stream]
|
||
test byte ptr [bx+2], 4
|
||
jz short loc_1F24
|
||
push word ptr [bx+8] ; block
|
||
call _free
|
||
pop cx
|
||
|
||
loc_1F24:
|
||
mov bx, [bp+stream]
|
||
and word ptr [bx+2], 0FFF3h
|
||
mov word ptr [bx+6], 0
|
||
mov ax, [bp+stream]
|
||
add ax, 5
|
||
mov [bx+8], ax
|
||
mov [bx+0Ah], ax
|
||
cmp [bp+_type], 2
|
||
jz short loc_1F8C
|
||
cmp [bp+_size], 0
|
||
jbe short loc_1F8C
|
||
mov off_268E, 2128h
|
||
cmp [bp+buf], 0
|
||
jnz short loc_1F70
|
||
push [bp+_size] ; size
|
||
call _malloc
|
||
pop cx
|
||
mov [bp+buf], ax
|
||
or ax, ax
|
||
jz short loc_1F6B
|
||
mov bx, [bp+stream]
|
||
or word ptr [bx+2], 4
|
||
jmp short loc_1F70
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1F6B:
|
||
mov ax, 0FFFFh
|
||
jmp short loc_1F8E
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1F70:
|
||
mov bx, [bp+stream]
|
||
mov ax, [bp+buf]
|
||
mov [bx+0Ah], ax
|
||
mov [bx+8], ax
|
||
mov ax, [bp+_size]
|
||
mov [bx+6], ax
|
||
cmp [bp+_type], 1
|
||
jnz short loc_1F8C
|
||
or word ptr [bx+2], 8
|
||
|
||
loc_1F8C:
|
||
xor ax, ax
|
||
|
||
loc_1F8E:
|
||
pop di
|
||
pop si
|
||
pop bp
|
||
retn
|
||
_setvbuf endp
|
||
|
||
include libs/BorlandC/_strlen.asm
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: library function bp-based frame
|
||
|
||
; int __cdecl __write(int handle, void *buf, unsigned int len)
|
||
___write proc near
|
||
|
||
var_8A = byte ptr -8Ah
|
||
var_8 = word ptr -8
|
||
var_5 = byte ptr -5
|
||
var_4 = word ptr -4
|
||
var_2 = word ptr -2
|
||
handle = word ptr 4
|
||
buf = word ptr 6
|
||
len = word ptr 8
|
||
|
||
push bp
|
||
mov bp, sp
|
||
sub sp, 8Ah
|
||
push si
|
||
push di
|
||
mov ax, [bp+handle]
|
||
cmp ax, word_27D4
|
||
jb short loc_1FCA
|
||
mov ax, 6
|
||
push ax
|
||
call __IOERROR
|
||
jmp loc_20CD
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1FCA:
|
||
mov ax, [bp+len]
|
||
inc ax
|
||
cmp ax, 2
|
||
jnb short loc_1FD8
|
||
xor ax, ax
|
||
jmp loc_20CD
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_1FD8:
|
||
mov bx, [bp+handle]
|
||
add bx, bx
|
||
test byte ptr [bx+27D7h], 8
|
||
jz short loc_1FF5
|
||
mov ax, 2
|
||
push ax ; fromwhere
|
||
xor ax, ax
|
||
push ax
|
||
push ax ; offset
|
||
push [bp+handle] ; handle
|
||
call _lseek
|
||
add sp, 8
|
||
|
||
loc_1FF5:
|
||
mov bx, [bp+handle]
|
||
add bx, bx
|
||
test byte ptr [bx+27D7h], 40h
|
||
jnz short loc_2013
|
||
push [bp+len] ; len
|
||
push [bp+buf] ; buf
|
||
push [bp+handle] ; handle
|
||
call __rtl_write
|
||
add sp, 6
|
||
jmp loc_20CD
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_2013:
|
||
mov bx, [bp+handle]
|
||
add bx, bx
|
||
and word ptr [bx+27D6h], 0FDFFh
|
||
mov ax, [bp+buf]
|
||
mov [bp+var_8], ax
|
||
mov ax, [bp+len]
|
||
mov [bp+var_4], ax
|
||
jmp short loc_2085
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_202C:
|
||
dec [bp+var_4]
|
||
mov bx, [bp+var_8]
|
||
inc [bp+var_8]
|
||
mov al, [bx]
|
||
mov [bp+var_5], al
|
||
cmp al, 0Ah
|
||
jnz short loc_2044
|
||
mov bx, cx
|
||
mov byte ptr [bx], 0Dh
|
||
inc cx
|
||
|
||
loc_2044:
|
||
mov bx, cx
|
||
mov al, [bp+var_5]
|
||
mov [bx], al
|
||
inc cx
|
||
lea ax, [bp+var_8A]
|
||
mov dx, cx
|
||
sub dx, ax
|
||
cmp dx, 80h
|
||
jl short loc_2089
|
||
mov dx, cx
|
||
sub dx, ax
|
||
mov [bp+var_2], dx
|
||
push dx ; len
|
||
push ax ; buf
|
||
push [bp+handle] ; handle
|
||
call __rtl_write
|
||
add sp, 6
|
||
mov dx, ax
|
||
cmp ax, [bp+var_2]
|
||
jz short loc_2085
|
||
cmp dx, 0FFFFh
|
||
jnz short loc_207D
|
||
mov ax, 0FFFFh
|
||
jmp short loc_20C8
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_207D:
|
||
mov ax, [bp+len]
|
||
sub ax, [bp+var_4]
|
||
jmp short loc_20C3
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_2085:
|
||
lea cx, [bp+var_8A]
|
||
|
||
loc_2089:
|
||
cmp [bp+var_4], 0
|
||
jnz short loc_202C
|
||
lea ax, [bp+var_8A]
|
||
mov dx, cx
|
||
sub dx, ax
|
||
mov [bp+var_2], dx
|
||
mov ax, dx
|
||
or ax, ax
|
||
jbe short loc_20CA
|
||
push dx ; len
|
||
lea ax, [bp+var_8A]
|
||
push ax ; buf
|
||
push [bp+handle] ; handle
|
||
call __rtl_write
|
||
add sp, 6
|
||
mov dx, ax
|
||
cmp ax, [bp+var_2]
|
||
jz short loc_20CA
|
||
cmp dx, 0FFFFh
|
||
jnz short loc_20C0
|
||
mov ax, 0FFFFh
|
||
jmp short loc_20C8
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_20C0:
|
||
mov ax, [bp+len]
|
||
|
||
loc_20C3:
|
||
add ax, dx
|
||
sub ax, [bp+var_2]
|
||
|
||
loc_20C8:
|
||
jmp short loc_20CD
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_20CA:
|
||
mov ax, [bp+len]
|
||
|
||
loc_20CD:
|
||
pop di
|
||
pop si
|
||
mov sp, bp
|
||
pop bp
|
||
retn
|
||
___write endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: library function bp-based frame
|
||
|
||
; int __cdecl _rtl_write(int handle, const void *buf, unsigned int len)
|
||
__rtl_write proc near
|
||
|
||
handle = word ptr 4
|
||
buf = word ptr 6
|
||
len = word ptr 8
|
||
|
||
push bp
|
||
mov bp, sp
|
||
push si
|
||
push di
|
||
mov bx, [bp+handle]
|
||
add bx, bx
|
||
test byte ptr [bx+27D6h], 1
|
||
jz short loc_20EA
|
||
mov ax, 5
|
||
push ax
|
||
jmp short loc_2109
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_20EA:
|
||
mov ah, 40h
|
||
mov bx, [bp+handle]
|
||
mov cx, [bp+len]
|
||
mov dx, [bp+buf]
|
||
int 21h ; DOS - 2+ - WRITE TO FILE WITH HANDLE
|
||
; BX = file handle, CX = number of bytes to write, DS:DX -> buffer
|
||
jb short loc_2108
|
||
push ax
|
||
mov bx, [bp+handle]
|
||
add bx, bx
|
||
or word ptr [bx+27D6h], 1000h
|
||
pop ax
|
||
jmp short loc_210C
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_2108:
|
||
push ax
|
||
|
||
loc_2109:
|
||
call __IOERROR
|
||
|
||
loc_210C:
|
||
pop di
|
||
pop si
|
||
pop bp
|
||
retn
|
||
__rtl_write endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: library function bp-based frame
|
||
|
||
; int __cdecl _write(int handle, const void *buf, unsigned int len)
|
||
__write proc near
|
||
|
||
handle = word ptr 4
|
||
buf = word ptr 6
|
||
len = word ptr 8
|
||
|
||
push bp
|
||
mov bp, sp
|
||
push si
|
||
push di
|
||
push [bp+len] ; len
|
||
push [bp+buf] ; buf
|
||
push [bp+handle] ; handle
|
||
call __rtl_write
|
||
add sp, 6
|
||
pop di
|
||
pop si
|
||
pop bp
|
||
retn
|
||
__write endp
|
||
|
||
|
||
; =============== S U B R O U T I N E =======================================
|
||
|
||
; Attributes: library function bp-based frame
|
||
|
||
__xfflush proc near
|
||
|
||
var_4 = word ptr -4
|
||
stream = word ptr -2
|
||
|
||
push bp
|
||
mov bp, sp
|
||
sub sp, 4
|
||
push si
|
||
push di
|
||
mov [bp+var_4], 4
|
||
mov [bp+stream], 2694h
|
||
jmp short loc_2151
|
||
; ---------------------------------------------------------------------------
|
||
|
||
loc_213C:
|
||
mov bx, [bp+stream]
|
||
test byte ptr [bx+2], 3
|
||
jz short loc_214A
|
||
push bx ; stream
|
||
call _fflush
|
||
pop cx
|
||
|
||
loc_214A:
|
||
dec [bp+var_4]
|
||
add [bp+stream], 10h
|
||
|
||
loc_2151:
|
||
cmp [bp+var_4], 0
|
||
jnz short loc_213C
|
||
pop di
|
||
pop si
|
||
mov sp, bp
|
||
pop bp
|
||
retn
|
||
__xfflush endp
|
||
|
||
; ---------------------------------------------------------------------------
|
||
db 0
|
||
db 0
|
||
db 0
|
||
aBorlandCCopyri db 'Borland C++ - Copyright 1993 Borland Intl.',0
|
||
aDivideError db 'Divide error',0Dh,0Ah,0
|
||
dword_219A dd 0
|
||
dword_219E dd 0
|
||
dword_21A2 dd 0
|
||
dword_21A6 dd 0
|
||
; int argc
|
||
argc dw 0
|
||
; char **argv
|
||
argv dw 0
|
||
; char **envp
|
||
envp dw 0
|
||
word_21B0 dw 0
|
||
word_21B2 dw 0
|
||
word_21B4 dw 0
|
||
word_21B6 dw 0
|
||
word_21B8 dw 0
|
||
__errno dw 0
|
||
db 2 dup(0FFh), 0A0h, 33h
|
||
word_21C0 dw 33A0h
|
||
dw 0
|
||
word_21C4 dw 0
|
||
dw 0
|
||
word_21C8 dw 0
|
||
dw 0
|
||
word_21CC dw 0
|
||
aTouhou_dat db 'touhou.dat',0
|
||
db 4, 3, 2, 1, 0
|
||
aMasters_libVer db 'MASTERS.LIB Version 0.23 Copyright (c)1995 A.Koizuka,Kazumi,steel'
|
||
db 'man,iR,All rights reserved.',0
|
||
db 0
|
||
word_223C dw 0A800h
|
||
word_223E dw 3E80h
|
||
word_2240 dw 190h
|
||
word_2242 dw 50h
|
||
word_2244 dw 0
|
||
db 55h, 0
|
||
word_2248 dw 64h
|
||
db 5 dup(0), 2 dup(0FFh), 2 dup(0), 0FFh, 0, 0FFh, 0, 0FFh
|
||
db 2 dup(0), 4 dup(0FFh), 0, 3 dup(0FFh), 3 dup(77h), 2 dup(0)
|
||
db 2 dup(0AAh), 2 dup(0), 0AAh, 0, 0AAh, 0, 0AAh, 2 dup(0)
|
||
db 4 dup(0AAh), 0, 3 dup(0AAh)
|
||
word_227A dw 0
|
||
dw 0
|
||
dw 0
|
||
aBfnt db 'BFNT'
|
||
db 1Ah
|
||
db 0
|
||
byte_2286 db 0
|
||
db 6 dup(0)
|
||
byte_228D db 0
|
||
db 6 dup(0)
|
||
word_2294 dw 0
|
||
word_2296 dw 0
|
||
db 0Ch dup(0)
|
||
word_22A4 dw 0
|
||
dw 0
|
||
word_22A8 dw 0
|
||
word_22AA dw 0
|
||
word_22AC dw 0
|
||
word_22AE dw 0
|
||
word_22B0 dw 0
|
||
word_22B2 dw 0
|
||
word_22B4 dw 100h
|
||
word_22B6 dw 0
|
||
word_22B8 dw 27Fh
|
||
word_22BA dw 27Fh
|
||
word_22BC dw 0
|
||
word_22BE dw 18Fh
|
||
word_22C0 dw 18Fh
|
||
word_22C2 dw 0A800h
|
||
word_22C4 dw 7CB0h
|
||
db 0
|
||
db 0
|
||
db 80h ; <20>
|
||
db 0
|
||
db 0C0h ; <20>
|
||
db 0
|
||
db 0E0h ; <20>
|
||
db 0
|
||
db 0F0h ; <20>
|
||
db 0
|
||
db 0F8h ; <20>
|
||
db 0
|
||
db 0FCh ; <20>
|
||
db 0
|
||
db 0FEh ; <20>
|
||
db 0
|
||
db 0FFh
|
||
db 0
|
||
db 0FFh
|
||
db 80h ; <20>
|
||
db 0FFh
|
||
db 0C0h ; <20>
|
||
db 0FFh
|
||
db 0E0h ; <20>
|
||
db 0FFh
|
||
db 0F0h ; <20>
|
||
db 0FFh
|
||
db 0F8h ; <20>
|
||
db 0FFh
|
||
db 0FCh ; <20>
|
||
db 0FFh
|
||
db 0FEh ; <20>
|
||
db 0FFh
|
||
db 0FFh
|
||
db 0
|
||
db 0
|
||
db 6
|
||
db 0
|
||
db 0Dh
|
||
db 0
|
||
db 13h
|
||
db 0
|
||
db 19h
|
||
db 0
|
||
db 1Fh
|
||
db 0
|
||
db 26h ; &
|
||
db 0
|
||
db 2Ch ; ,
|
||
db 0
|
||
db 32h ; 2
|
||
db 0
|
||
db 38h ; 8
|
||
db 0
|
||
db 3Eh ; >
|
||
db 0
|
||
db 44h ; D
|
||
db 0
|
||
db 4Ah ; J
|
||
db 0
|
||
db 50h ; P
|
||
db 0
|
||
db 56h ; V
|
||
db 0
|
||
db 5Ch ; \
|
||
db 0
|
||
db 62h ; b
|
||
db 0
|
||
db 68h ; h
|
||
db 0
|
||
db 6Dh ; m
|
||
db 0
|
||
db 73h ; s
|
||
db 0
|
||
db 79h ; y
|
||
db 0
|
||
db 7Eh ; ~
|
||
db 0
|
||
db 84h ; <20>
|
||
db 0
|
||
db 89h ; <20>
|
||
db 0
|
||
db 8Eh ; <20>
|
||
db 0
|
||
db 93h ; <20>
|
||
db 0
|
||
db 98h ; <20>
|
||
db 0
|
||
db 9Dh ; <20>
|
||
db 0
|
||
db 0A2h ; <20>
|
||
db 0
|
||
db 0A7h ; <20>
|
||
db 0
|
||
db 0ACh ; <20>
|
||
db 0
|
||
db 0B1h ; <20>
|
||
db 0
|
||
db 0B5h ; <20>
|
||
db 0
|
||
db 0B9h ; <20>
|
||
db 0
|
||
db 0BEh ; <20>
|
||
db 0
|
||
db 0C2h ; <20>
|
||
db 0
|
||
db 0C6h ; <20>
|
||
db 0
|
||
db 0CAh ; <20>
|
||
db 0
|
||
db 0CEh ; <20>
|
||
db 0
|
||
db 0D1h ; <20>
|
||
db 0
|
||
db 0D5h ; <20>
|
||
db 0
|
||
db 0D8h ; <20>
|
||
db 0
|
||
db 0DCh ; <20>
|
||
db 0
|
||
db 0DFh ; <20>
|
||
db 0
|
||
db 0E2h ; <20>
|
||
db 0
|
||
db 0E5h ; <20>
|
||
db 0
|
||
db 0E7h ; <20>
|
||
db 0
|
||
db 0EAh ; <20>
|
||
db 0
|
||
db 0EDh ; <20>
|
||
db 0
|
||
db 0EFh ; <20>
|
||
db 0
|
||
db 0F1h ; <20>
|
||
db 0
|
||
db 0F3h ; <20>
|
||
db 0
|
||
db 0F5h ; <20>
|
||
db 0
|
||
db 0F7h ; <20>
|
||
db 0
|
||
db 0F8h ; <20>
|
||
db 0
|
||
db 0FAh ; <20>
|
||
db 0
|
||
db 0FBh ; <20>
|
||
db 0
|
||
db 0FCh ; <20>
|
||
db 0
|
||
db 0FDh ; <20>
|
||
db 0
|
||
db 0FEh ; <20>
|
||
db 0
|
||
db 0FFh
|
||
db 0
|
||
db 0FFh
|
||
db 0
|
||
db 0
|
||
db 1
|
||
db 0
|
||
db 1
|
||
db 0
|
||
db 1
|
||
db 0
|
||
db 1
|
||
db 0
|
||
db 1
|
||
db 0FFh
|
||
db 0
|
||
db 0FFh
|
||
db 0
|
||
db 0FEh ; <20>
|
||
db 0
|
||
db 0FDh ; <20>
|
||
db 0
|
||
db 0FCh ; <20>
|
||
db 0
|
||
db 0FBh ; <20>
|
||
db 0
|
||
db 0FAh ; <20>
|
||
db 0
|
||
db 0F8h ; <20>
|
||
db 0
|
||
db 0F7h ; <20>
|
||
db 0
|
||
db 0F5h ; <20>
|
||
db 0
|
||
db 0F3h ; <20>
|
||
db 0
|
||
db 0F1h ; <20>
|
||
db 0
|
||
db 0EFh ; <20>
|
||
db 0
|
||
db 0EDh ; <20>
|
||
db 0
|
||
db 0EAh ; <20>
|
||
db 0
|
||
db 0E7h ; <20>
|
||
db 0
|
||
db 0E5h ; <20>
|
||
db 0
|
||
db 0E2h ; <20>
|
||
db 0
|
||
db 0DFh ; <20>
|
||
db 0
|
||
db 0DCh ; <20>
|
||
db 0
|
||
db 0D8h ; <20>
|
||
db 0
|
||
db 0D5h ; <20>
|
||
db 0
|
||
db 0D1h ; <20>
|
||
db 0
|
||
db 0CEh ; <20>
|
||
db 0
|
||
db 0CAh ; <20>
|
||
db 0
|
||
db 0C6h ; <20>
|
||
db 0
|
||
db 0C2h ; <20>
|
||
db 0
|
||
db 0BEh ; <20>
|
||
db 0
|
||
db 0B9h ; <20>
|
||
db 0
|
||
db 0B5h ; <20>
|
||
db 0
|
||
db 0B1h ; <20>
|
||
db 0
|
||
db 0ACh ; <20>
|
||
db 0
|
||
db 0A7h ; <20>
|
||
db 0
|
||
db 0A2h ; <20>
|
||
db 0
|
||
db 9Dh ; <20>
|
||
db 0
|
||
db 98h ; <20>
|
||
db 0
|
||
db 93h ; <20>
|
||
db 0
|
||
db 8Eh ; <20>
|
||
db 0
|
||
db 89h ; <20>
|
||
db 0
|
||
db 84h ; <20>
|
||
db 0
|
||
db 7Eh ; ~
|
||
db 0
|
||
db 79h ; y
|
||
db 0
|
||
db 73h ; s
|
||
db 0
|
||
db 6Dh ; m
|
||
db 0
|
||
db 68h ; h
|
||
db 0
|
||
db 62h ; b
|
||
db 0
|
||
db 5Ch ; \
|
||
db 0
|
||
db 56h ; V
|
||
db 0
|
||
db 50h ; P
|
||
db 0
|
||
db 4Ah ; J
|
||
db 0
|
||
db 44h ; D
|
||
db 0
|
||
db 3Eh ; >
|
||
db 0
|
||
db 38h ; 8
|
||
db 0
|
||
db 32h ; 2
|
||
db 0
|
||
db 2Ch ; ,
|
||
db 0
|
||
db 26h ; &
|
||
db 0
|
||
db 1Fh
|
||
db 0
|
||
db 19h
|
||
db 0
|
||
db 13h
|
||
db 0
|
||
db 0Dh
|
||
db 0
|
||
db 6
|
||
db 0
|
||
db 0
|
||
db 0
|
||
db 0FAh ; <20>
|
||
db 0FFh
|
||
db 0F3h ; <20>
|
||
db 0FFh
|
||
db 0EDh ; <20>
|
||
db 0FFh
|
||
db 0E7h ; <20>
|
||
db 0FFh
|
||
db 0E1h ; <20>
|
||
db 0FFh
|
||
db 0DAh ; <20>
|
||
db 0FFh
|
||
db 0D4h ; <20>
|
||
db 0FFh
|
||
db 0CEh ; <20>
|
||
db 0FFh
|
||
db 0C8h ; <20>
|
||
db 0FFh
|
||
db 0C2h ; <20>
|
||
db 0FFh
|
||
db 0BCh ; <20>
|
||
db 0FFh
|
||
db 0B6h ; <20>
|
||
db 0FFh
|
||
db 0B0h ; <20>
|
||
db 0FFh
|
||
db 0AAh ; <20>
|
||
db 0FFh
|
||
db 0A4h ; <20>
|
||
db 0FFh
|
||
db 9Eh ; <20>
|
||
db 0FFh
|
||
db 98h ; <20>
|
||
db 0FFh
|
||
db 93h ; <20>
|
||
db 0FFh
|
||
db 8Dh ; <20>
|
||
db 0FFh
|
||
db 87h ; <20>
|
||
db 0FFh
|
||
db 82h ; <20>
|
||
db 0FFh
|
||
db 7Ch ; |
|
||
db 0FFh
|
||
db 77h ; w
|
||
db 0FFh
|
||
db 72h ; r
|
||
db 0FFh
|
||
db 6Dh ; m
|
||
db 0FFh
|
||
db 68h ; h
|
||
db 0FFh
|
||
db 63h ; c
|
||
db 0FFh
|
||
db 5Eh ; ^
|
||
db 0FFh
|
||
db 59h ; Y
|
||
db 0FFh
|
||
db 54h ; T
|
||
db 0FFh
|
||
db 4Fh ; O
|
||
db 0FFh
|
||
db 4Bh ; K
|
||
db 0FFh
|
||
db 47h ; G
|
||
db 0FFh
|
||
db 42h ; B
|
||
db 0FFh
|
||
db 3Eh ; >
|
||
db 0FFh
|
||
db 3Ah ; :
|
||
db 0FFh
|
||
db 36h ; 6
|
||
db 0FFh
|
||
db 32h ; 2
|
||
db 0FFh
|
||
db 2Fh ; /
|
||
db 0FFh
|
||
db 2Bh ; +
|
||
db 0FFh
|
||
db 28h ; (
|
||
db 0FFh
|
||
db 24h ; $
|
||
db 0FFh
|
||
db 21h ; !
|
||
db 0FFh
|
||
db 1Eh
|
||
db 0FFh
|
||
db 1Bh
|
||
db 0FFh
|
||
db 19h
|
||
db 0FFh
|
||
db 16h
|
||
db 0FFh
|
||
db 13h
|
||
db 0FFh
|
||
db 11h
|
||
db 0FFh
|
||
db 0Fh
|
||
db 0FFh
|
||
db 0Dh
|
||
db 0FFh
|
||
db 0Bh
|
||
db 0FFh
|
||
db 9
|
||
db 0FFh
|
||
db 8
|
||
db 0FFh
|
||
db 6
|
||
db 0FFh
|
||
db 5
|
||
db 0FFh
|
||
db 4
|
||
db 0FFh
|
||
db 3
|
||
db 0FFh
|
||
db 2
|
||
db 0FFh
|
||
db 1
|
||
db 0FFh
|
||
db 1
|
||
db 0FFh
|
||
db 0
|
||
db 0FFh
|
||
db 0
|
||
db 0FFh
|
||
db 0
|
||
db 0FFh
|
||
db 0
|
||
db 0FFh
|
||
db 0
|
||
db 0FFh
|
||
db 1
|
||
db 0FFh
|
||
db 1
|
||
db 0FFh
|
||
db 2
|
||
db 0FFh
|
||
db 3
|
||
db 0FFh
|
||
db 4
|
||
db 0FFh
|
||
db 5
|
||
db 0FFh
|
||
db 6
|
||
db 0FFh
|
||
db 8
|
||
db 0FFh
|
||
db 9
|
||
db 0FFh
|
||
db 0Bh
|
||
db 0FFh
|
||
db 0Dh
|
||
db 0FFh
|
||
db 0Fh
|
||
db 0FFh
|
||
db 11h
|
||
db 0FFh
|
||
db 13h
|
||
db 0FFh
|
||
db 16h
|
||
db 0FFh
|
||
db 19h
|
||
db 0FFh
|
||
db 1Bh
|
||
db 0FFh
|
||
db 1Eh
|
||
db 0FFh
|
||
db 21h ; !
|
||
db 0FFh
|
||
db 24h ; $
|
||
db 0FFh
|
||
db 28h ; (
|
||
db 0FFh
|
||
db 2Bh ; +
|
||
db 0FFh
|
||
db 2Fh ; /
|
||
db 0FFh
|
||
db 32h ; 2
|
||
db 0FFh
|
||
db 36h ; 6
|
||
db 0FFh
|
||
db 3Ah ; :
|
||
db 0FFh
|
||
db 3Eh ; >
|
||
db 0FFh
|
||
db 42h ; B
|
||
db 0FFh
|
||
db 47h ; G
|
||
db 0FFh
|
||
db 4Bh ; K
|
||
db 0FFh
|
||
db 4Fh ; O
|
||
db 0FFh
|
||
db 54h ; T
|
||
db 0FFh
|
||
db 59h ; Y
|
||
db 0FFh
|
||
db 5Eh ; ^
|
||
db 0FFh
|
||
db 63h ; c
|
||
db 0FFh
|
||
db 68h ; h
|
||
db 0FFh
|
||
db 6Dh ; m
|
||
db 0FFh
|
||
db 72h ; r
|
||
db 0FFh
|
||
db 77h ; w
|
||
db 0FFh
|
||
db 7Ch ; |
|
||
db 0FFh
|
||
db 82h ; <20>
|
||
db 0FFh
|
||
db 87h ; <20>
|
||
db 0FFh
|
||
db 8Dh ; <20>
|
||
db 0FFh
|
||
db 93h ; <20>
|
||
db 0FFh
|
||
db 98h ; <20>
|
||
db 0FFh
|
||
db 9Eh ; <20>
|
||
db 0FFh
|
||
db 0A4h ; <20>
|
||
db 0FFh
|
||
db 0AAh ; <20>
|
||
db 0FFh
|
||
db 0B0h ; <20>
|
||
db 0FFh
|
||
db 0B6h ; <20>
|
||
db 0FFh
|
||
db 0BCh ; <20>
|
||
db 0FFh
|
||
db 0C2h ; <20>
|
||
db 0FFh
|
||
db 0C8h ; <20>
|
||
db 0FFh
|
||
db 0CEh ; <20>
|
||
db 0FFh
|
||
db 0D4h ; <20>
|
||
db 0FFh
|
||
db 0DAh ; <20>
|
||
db 0FFh
|
||
db 0E1h ; <20>
|
||
db 0FFh
|
||
db 0E7h ; <20>
|
||
db 0FFh
|
||
db 0EDh ; <20>
|
||
db 0FFh
|
||
db 0F3h ; <20>
|
||
db 0FFh
|
||
db 0FAh ; <20>
|
||
db 0FFh
|
||
db 0
|
||
db 0
|
||
db 6
|
||
db 0
|
||
db 0Dh
|
||
db 0
|
||
db 13h
|
||
db 0
|
||
db 19h
|
||
db 0
|
||
db 1Fh
|
||
db 0
|
||
db 26h ; &
|
||
db 0
|
||
db 2Ch ; ,
|
||
db 0
|
||
db 32h ; 2
|
||
db 0
|
||
db 38h ; 8
|
||
db 0
|
||
db 3Eh ; >
|
||
db 0
|
||
db 44h ; D
|
||
db 0
|
||
db 4Ah ; J
|
||
db 0
|
||
db 50h ; P
|
||
db 0
|
||
db 56h ; V
|
||
db 0
|
||
db 5Ch ; \
|
||
db 0
|
||
db 62h ; b
|
||
db 0
|
||
db 68h ; h
|
||
db 0
|
||
db 6Dh ; m
|
||
db 0
|
||
db 73h ; s
|
||
db 0
|
||
db 79h ; y
|
||
db 0
|
||
db 7Eh ; ~
|
||
db 0
|
||
db 84h ; <20>
|
||
db 0
|
||
db 89h ; <20>
|
||
db 0
|
||
db 8Eh ; <20>
|
||
db 0
|
||
db 93h ; <20>
|
||
db 0
|
||
db 98h ; <20>
|
||
db 0
|
||
db 9Dh ; <20>
|
||
db 0
|
||
db 0A2h ; <20>
|
||
db 0
|
||
db 0A7h ; <20>
|
||
db 0
|
||
db 0ACh ; <20>
|
||
db 0
|
||
db 0B1h ; <20>
|
||
db 0
|
||
db 0B5h ; <20>
|
||
db 0
|
||
db 0B9h ; <20>
|
||
db 0
|
||
db 0BEh ; <20>
|
||
db 0
|
||
db 0C2h ; <20>
|
||
db 0
|
||
db 0C6h ; <20>
|
||
db 0
|
||
db 0CAh ; <20>
|
||
db 0
|
||
db 0CEh ; <20>
|
||
db 0
|
||
db 0D1h ; <20>
|
||
db 0
|
||
db 0D5h ; <20>
|
||
db 0
|
||
db 0D8h ; <20>
|
||
db 0
|
||
db 0DCh ; <20>
|
||
db 0
|
||
db 0DFh ; <20>
|
||
db 0
|
||
db 0E2h ; <20>
|
||
db 0
|
||
db 0E5h ; <20>
|
||
db 0
|
||
db 0E7h ; <20>
|
||
db 0
|
||
db 0EAh ; <20>
|
||
db 0
|
||
db 0EDh ; <20>
|
||
db 0
|
||
db 0EFh ; <20>
|
||
db 0
|
||
db 0F1h ; <20>
|
||
db 0
|
||
db 0F3h ; <20>
|
||
db 0
|
||
db 0F5h ; <20>
|
||
db 0
|
||
db 0F7h ; <20>
|
||
db 0
|
||
db 0F8h ; <20>
|
||
db 0
|
||
db 0FAh ; <20>
|
||
db 0
|
||
db 0FBh ; <20>
|
||
db 0
|
||
db 0FCh ; <20>
|
||
db 0
|
||
db 0FDh ; <20>
|
||
db 0
|
||
db 0FEh ; <20>
|
||
db 0
|
||
db 0FFh
|
||
db 0
|
||
db 0FFh
|
||
db 0
|
||
db 0
|
||
db 1
|
||
db 0
|
||
db 1
|
||
db 0
|
||
db 3
|
||
db 6
|
||
db 9
|
||
db 0Ch
|
||
db 0Fh
|
||
db 12h
|
||
db 15h
|
||
db 18h
|
||
db 1Ch
|
||
db 1Fh
|
||
db 22h ; "
|
||
db 25h ; %
|
||
db 28h ; (
|
||
db 2Bh ; +
|
||
db 2Eh ; .
|
||
db 30h ; 0
|
||
db 33h ; 3
|
||
db 36h ; 6
|
||
db 39h ; 9
|
||
db 3Ch ; <
|
||
db 3Fh ; ?
|
||
db 41h ; A
|
||
db 44h ; D
|
||
db 47h ; G
|
||
db 49h ; I
|
||
db 4Ch ; L
|
||
db 4Eh ; N
|
||
db 51h ; Q
|
||
db 53h ; S
|
||
db 55h ; U
|
||
db 58h ; X
|
||
db 5Ah ; Z
|
||
db 5Ch ; \
|
||
db 5Eh ; ^
|
||
db 60h ; `
|
||
db 62h ; b
|
||
db 64h ; d
|
||
db 66h ; f
|
||
db 68h ; h
|
||
db 6Ah ; j
|
||
db 6Ch ; l
|
||
db 6Dh ; m
|
||
db 6Fh ; o
|
||
db 70h ; p
|
||
db 72h ; r
|
||
db 73h ; s
|
||
db 75h ; u
|
||
db 76h ; v
|
||
db 77h ; w
|
||
db 78h ; x
|
||
db 79h ; y
|
||
db 7Ah ; z
|
||
db 7Bh ; {
|
||
db 7Ch ; |
|
||
db 7Ch ; |
|
||
db 7Dh ; }
|
||
db 7Eh ; ~
|
||
db 7Eh ; ~
|
||
db 7Fh ;
|
||
db 7Fh ;
|
||
db 7Fh ;
|
||
db 7Fh ;
|
||
db 7Fh ;
|
||
db 7Fh ;
|
||
db 7Fh ;
|
||
db 7Fh ;
|
||
db 7Fh ;
|
||
db 7Fh ;
|
||
db 7Fh ;
|
||
db 7Eh ; ~
|
||
db 7Eh ; ~
|
||
db 7Dh ; }
|
||
db 7Ch ; |
|
||
db 7Ch ; |
|
||
db 7Bh ; {
|
||
db 7Ah ; z
|
||
db 79h ; y
|
||
db 78h ; x
|
||
db 77h ; w
|
||
db 76h ; v
|
||
db 75h ; u
|
||
db 73h ; s
|
||
db 72h ; r
|
||
db 70h ; p
|
||
db 6Fh ; o
|
||
db 6Dh ; m
|
||
db 6Ch ; l
|
||
db 6Ah ; j
|
||
db 68h ; h
|
||
db 66h ; f
|
||
db 64h ; d
|
||
db 62h ; b
|
||
db 60h ; `
|
||
db 5Eh ; ^
|
||
db 5Ch ; \
|
||
db 5Ah ; Z
|
||
db 58h ; X
|
||
db 55h ; U
|
||
db 53h ; S
|
||
db 51h ; Q
|
||
db 4Eh ; N
|
||
db 4Ch ; L
|
||
db 49h ; I
|
||
db 47h ; G
|
||
db 44h ; D
|
||
db 41h ; A
|
||
db 3Fh ; ?
|
||
db 3Ch ; <
|
||
db 39h ; 9
|
||
db 36h ; 6
|
||
db 33h ; 3
|
||
db 30h ; 0
|
||
db 2Eh ; .
|
||
db 2Bh ; +
|
||
db 28h ; (
|
||
db 25h ; %
|
||
db 22h ; "
|
||
db 1Fh
|
||
db 1Ch
|
||
db 18h
|
||
db 15h
|
||
db 12h
|
||
db 0Fh
|
||
db 0Ch
|
||
db 9
|
||
db 6
|
||
db 3
|
||
db 0
|
||
db 0FDh ; <20>
|
||
db 0FAh ; <20>
|
||
db 0F7h ; <20>
|
||
db 0F4h ; <20>
|
||
db 0F1h ; <20>
|
||
db 0EEh ; <20>
|
||
db 0EBh ; <20>
|
||
db 0E8h ; <20>
|
||
db 0E4h ; <20>
|
||
db 0E1h ; <20>
|
||
db 0DEh ; <20>
|
||
db 0DBh ; <20>
|
||
db 0D8h ; <20>
|
||
db 0D5h ; <20>
|
||
db 0D2h ; <20>
|
||
db 0D0h ; <20>
|
||
db 0CDh ; <20>
|
||
db 0CAh ; <20>
|
||
db 0C7h ; <20>
|
||
db 0C4h ; <20>
|
||
db 0C1h ; <20>
|
||
db 0BFh ; <20>
|
||
db 0BCh ; <20>
|
||
db 0B9h ; <20>
|
||
db 0B7h ; <20>
|
||
db 0B4h ; <20>
|
||
db 0B2h ; <20>
|
||
db 0AFh ; <20>
|
||
db 0ADh ; <20>
|
||
db 0ABh ; <20>
|
||
db 0A8h ; <20>
|
||
db 0A6h ; <20>
|
||
db 0A4h ; <20>
|
||
db 0A2h ; <20>
|
||
db 0A0h ; <20>
|
||
db 9Eh ; <20>
|
||
db 9Ch ; <20>
|
||
db 9Ah ; <20>
|
||
db 98h ; <20>
|
||
db 96h ; <20>
|
||
db 94h ; <20>
|
||
db 93h ; <20>
|
||
db 91h ; <20>
|
||
db 90h ; <20>
|
||
db 8Eh ; <20>
|
||
db 8Dh ; <20>
|
||
db 8Bh ; <20>
|
||
db 8Ah ; <20>
|
||
db 89h ; <20>
|
||
db 88h ; <20>
|
||
db 87h ; <20>
|
||
db 86h ; <20>
|
||
db 85h ; <20>
|
||
db 84h ; <20>
|
||
db 84h ; <20>
|
||
db 83h ; <20>
|
||
db 82h ; <20>
|
||
db 82h ; <20>
|
||
db 81h ; <20>
|
||
db 81h ; <20>
|
||
db 81h ; <20>
|
||
db 81h ; <20>
|
||
db 81h ; <20>
|
||
db 81h ; <20>
|
||
db 81h ; <20>
|
||
db 81h ; <20>
|
||
db 81h ; <20>
|
||
db 81h ; <20>
|
||
db 81h ; <20>
|
||
db 82h ; <20>
|
||
db 82h ; <20>
|
||
db 83h ; <20>
|
||
db 84h ; <20>
|
||
db 84h ; <20>
|
||
db 85h ; <20>
|
||
db 86h ; <20>
|
||
db 87h ; <20>
|
||
db 88h ; <20>
|
||
db 89h ; <20>
|
||
db 8Ah ; <20>
|
||
db 8Bh ; <20>
|
||
db 8Dh ; <20>
|
||
db 8Eh ; <20>
|
||
db 90h ; <20>
|
||
db 91h ; <20>
|
||
db 93h ; <20>
|
||
db 94h ; <20>
|
||
db 96h ; <20>
|
||
db 98h ; <20>
|
||
db 9Ah ; <20>
|
||
db 9Ch ; <20>
|
||
db 9Eh ; <20>
|
||
db 0A0h ; <20>
|
||
db 0A2h ; <20>
|
||
db 0A4h ; <20>
|
||
db 0A6h ; <20>
|
||
db 0A8h ; <20>
|
||
db 0ABh ; <20>
|
||
db 0ADh ; <20>
|
||
db 0AFh ; <20>
|
||
db 0B2h ; <20>
|
||
db 0B4h ; <20>
|
||
db 0B7h ; <20>
|
||
db 0B9h ; <20>
|
||
db 0BCh ; <20>
|
||
db 0BFh ; <20>
|
||
db 0C1h ; <20>
|
||
db 0C4h ; <20>
|
||
db 0C7h ; <20>
|
||
db 0CAh ; <20>
|
||
db 0CDh ; <20>
|
||
db 0D0h ; <20>
|
||
db 0D2h ; <20>
|
||
db 0D5h ; <20>
|
||
db 0D8h ; <20>
|
||
db 0DBh ; <20>
|
||
db 0DEh ; <20>
|
||
db 0E1h ; <20>
|
||
db 0E4h ; <20>
|
||
db 0E8h ; <20>
|
||
db 0EBh ; <20>
|
||
db 0EEh ; <20>
|
||
db 0F1h ; <20>
|
||
db 0F4h ; <20>
|
||
db 0F7h ; <20>
|
||
db 0FAh ; <20>
|
||
db 0FDh ; <20>
|
||
word_2668 dw 1
|
||
word_266A dw 0
|
||
aAbnormalProgra db 'Abnormal program termination',0Dh,0Ah,0
|
||
db 0
|
||
word_268C dw 0
|
||
off_268E dw offset sub_1738
|
||
off_2690 dw offset sub_1738
|
||
off_2692 dw offset sub_1738
|
||
db 2 dup(0)
|
||
word_2696 dw 209h
|
||
byte_2698 db 0
|
||
db 9 dup(0), 94h, 26h, 2 dup(0)
|
||
word_26A6 dw 20Ah
|
||
byte_26A8 db 1
|
||
db 9 dup(0), 0A4h, 26h, 2 dup(0), 2 dup(2)
|
||
byte_26B8 db 2
|
||
db 9 dup(0), 0B4h, 26h, 2 dup(0), 43h, 2, 3, 9 dup(0)
|
||
db 0C4h, 26h, 2 dup(0), 42h, 2, 4, 9 dup(0), 0D4h, 26h
|
||
db 0F0h dup(0)
|
||
word_27D4 dw 14h
|
||
db 1, 60h, 2, 60h, 2, 60h, 4, 0A0h, 2, 0A0h, 1Eh dup(0)
|
||
word_27FE dw 0
|
||
include libs/BorlandC/__IOERROR[data].asm
|
||
db 0
|
||
word_285C dw 1000h
|
||
word_285E dw 0
|
||
word_2860 dw 0
|
||
word_2862 dw 0
|
||
word_2864 dw 0
|
||
word_2866 dw 0
|
||
include libs/BorlandC/sysnerr[data].asm
|
||
db 0, 2, 0A3h, 18h, 2 dup(0)
|
||
seg000 ends
|
||
|
||
|
||
end start
|