home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Jason Aller Floppy Collection
/
189.img
/
TCS120S.ZIP
/
CRCCHECK.ASM
< prev
next >
Wrap
Assembly Source File
|
1989-03-23
|
46KB
|
1,901 lines
PAGE 59,132
;██████████████████████████████████████████████████████████████████████████
;██ ██
;██ CRCHECK ██
;██ ██
;██ Created: 11-Jan-89 ██
;██ Passes: 5 Analysis Flags on: H ██
;██ ██
;██████████████████████████████████████████████████████████████████████████
data_1e equ 2Ch ; (0016:002C=0)
data_2e equ 8 ; (00F4:0008=0CBE8h)
data_3e equ 1B6h ; (00F4:01B6=1E75h)
data_4e equ 344h ; (00F4:0344=28Bh)
data_5e equ 346h ; (00F4:0346=7332h)
data_6e equ 348h ; (00F4:0348=2E09h)
data_7e equ 200Ch ; (00F4:200C=0)
data_8e equ 200Eh ; (00F4:200E=5D40h)
data_9e equ 2010h ; (00F4:2010=1402h)
data_10e equ 2012h ; (00F4:2012=0)
data_11e equ 2013h ; (00F4:2013=0)
data_12e equ 201Ch ; (00F4:201C=0)
data_13e equ 7Ch ; (7E60:007C=0)
data_14e equ 1B6h ; (7E60:01B6=0B83Eh)
data_15e equ 1B8h ; (7E60:01B8=0FC01h)
data_16e equ 1BAh ; (7E60:01BA=0BCA1h)
data_17e equ 1BCh ; (7E60:01BC=0AB01h)
data_18e equ 2DEh ; (7E60:02DE=0Ah)
data_19e equ 31Eh ; (7E60:031E=8404h)
data_20e equ 320h ; (7E60:0320=75C0h)
data_21e equ 0F454h ; (7E60:F454=0)
data_22e equ 0FF99h ; (7E60:FF99=0)
data_40e equ 0D171h ; (7FAD:D171=0)
;-------------------------------------------------------------- seg_a ----
seg_a segment para public
assume cs:seg_a , ds:seg_a , ss:stack_seg_c
db 43h, 47h, 0B8h, 0F4h, 0, 8Eh
db 0C0h, 8Dh, 26h, 0, 1, 0FCh
db 8Dh, 36h, 80h, 0, 8Dh, 3Eh
db 0Ah, 1, 0ACh, 98h, 8Bh, 0C8h
db 0F3h, 0A4h, 0B0h, 0, 0AAh, 0B8h
db 0F4h, 0, 8Ch, 0DBh, 2Bh, 0C3h
db 40h, 50h, 26h, 3, 6, 0BEh
db 1, 8Bh, 0D8h, 8Ch, 0D8h, 8Eh
db 0C0h, 0B4h, 4Ah, 0CDh, 21h, 5Ah
db 73h, 8, 3Ch, 8, 75h, 34h
db 0B4h, 4Ah, 0CDh, 21h, 2Bh, 0DAh
db 0B1h, 4, 0D3h, 0E3h, 0B8h, 0F4h
db 0, 8Eh, 0D0h, 8Bh, 0E3h, 8Eh
db 0C0h, 8Eh, 0D8h, 0B8h, 29h, 1
db 2Dh, 0F4h, 0, 0D3h, 0E0h, 0A3h
db 0B6h, 1, 0A3h, 0B8h, 1, 0E8h
db 79h, 1, 8Dh, 6, 0Ah, 0
db 50h, 0FFh, 36h, 8, 0, 0E8h
db 0DBh, 1, 0EBh, 10h, 8Dh, 1Eh
db 9Bh, 1, 0B8h, 2, 0, 0E8h
db 0B9h, 1, 0B4h, 4Ch, 0B0h, 1
db 0CDh
db 21h
;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
; SUBROUTINE
;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
sub_1 proc near
loc_2:
pop di
pop ax
mov ah,4Ch ; 'L'
int 21h ; DOS Services ah=function 4Ch
; terminate with al=return code
loc_3:
lea bx,cs:[18Ah] ; Load effective addr
mov ax,2
call sub_4 ; (0233)
mov ax,0Ah
push ax
call sub_1 ; (0080)
push bp
mov bp,sp
push si
push di
loc_4:
mov bx,[bp+4]
add bx,4
mov dx,bx
add bx,ds:data_15e ; (7E60:01B8=0FC01h)
jc loc_6 ; Jump if carry Set
mov si,400h
add si,bx
jc loc_6 ; Jump if carry Set
cmp si,sp
jae loc_6 ; Jump if above or =
mov di,ds:data_15e ; (7E60:01B8=0FC01h)
cld ; Clear direction
mov ax,ds:data_17e ; (7E60:01BC=0AB01h)
stosw ; Store ax to es:[di]
mov ax,dx
stosw ; Store ax to es:[di]
mov ax,ds:data_15e ; (7E60:01B8=0FC01h)
mov ds:data_17e,ax ; (7E60:01BC=0AB01h)
mov ds:data_15e,bx ; (7E60:01B8=0FC01h)
mov ax,di
loc_5:
pop di
pop si
mov sp,bp
pop bp
retn
loc_6:
lea di,cs:[1BAh] ; Load effective addr
loc_7:
mov si,[di]
test si,si
jz loc_12 ; Jump if zero
mov ax,[si+2]
cmp dx,ax
jb loc_8 ; Jump if below
jz loc_11 ; Jump if zero
mov di,si
jmp short loc_7 ; (00D7)
loc_8:
mov ax,[si+2]
sub ax,dx
cmp ax,0Ah
jb loc_10 ; Jump if below
mov [si+2],ax
add si,[si+2]
loc_9:
mov ax,ds:data_17e ; (7E60:01BC=0AB01h)
mov [si],ax
mov [si+2],dx
mov ds:data_17e,si ; (7E60:01BC=0AB01h)
add si,4
mov ax,si
jmp short loc_5 ; (00CD)
loc_10:
mov dx,[si+2]
loc_11:
mov ax,[si]
mov [di],ax
jmp short loc_9 ; (00FA)
loc_12:
call sub_2 ; (0172)
test ax,ax
jz loc_5 ; Jump if zero
jmp loc_4 ; (009C)
sub_1 endp
db 55h, 8Bh, 0ECh, 8Bh, 46h, 4
db 0F7h, 66h, 6, 50h, 0E8h, 6Ah
db 0FFh, 8Bh, 0E5h, 5Dh, 0C3h, 55h
db 8Bh, 0ECh, 56h, 57h, 8Bh, 46h
db 4, 8Dh, 3Eh, 0BCh, 1, 2Dh
db 4, 0
loc_13:
mov si,[di]
test si,si
jz loc_16 ; Jump if zero
cmp ax,si
je loc_14 ; Jump if equal
mov di,si
jmp short loc_13 ; (0140)
loc_14:
mov ax,[si]
mov [di],ax
mov ax,[si+2]
add ax,si
cmp ax,ds:data_15e ; (7E60:01B8=0FC01h)
jne loc_15 ; Jump if not equal
mov ds:data_15e,si ; (7E60:01B8=0FC01h)
jmp short loc_16 ; (016C)
loc_15:
mov ax,ds:data_16e ; (7E60:01BA=0BCA1h)
mov [si],ax
mov ds:data_16e,si ; (7E60:01BA=0BCA1h)
loc_16:
pop di
pop si
mov sp,bp
pop bp
retn
;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
; SUBROUTINE
;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
sub_2 proc near
xor dl,dl ; Zero register
mov di,ds:data_16e ; (7E60:01BA=0BCA1h)
test di,di
jnz loc_17 ; Jump if not zero
xor ax,ax ; Zero register
retn
loc_17:
mov ax,[di+2]
add ax,di
push di
lea di,cs:[1BAh] ; Load effective addr
loc_18:
mov si,[di]
test si,si
jz loc_20 ; Jump if zero
cmp ax,si
jne loc_19 ; Jump if not equal
mov bx,[si]
mov [di],bx
mov bx,[si+2]
pop di
add [di+2],bx
or dl,1
jmp short loc_17 ; (017F)
loc_19:
mov di,[si]
test di,di
jnz loc_18 ; Jump if not zero
loc_20:
pop di
mov di,[di]
test di,di
jnz loc_17 ; Jump if not zero
loc_21:
lea di,cs:[1BAh] ; Load effective addr
loc_22:
mov si,[di]
test si,si
jz loc_24 ; Jump if zero
mov ax,[si+2]
add ax,si
cmp ax,ds:data_15e ; (7E60:01B8=0FC01h)
jne loc_23 ; Jump if not equal
or dl,2
mov ds:data_15e,si ; (7E60:01B8=0FC01h)
mov ax,[si]
mov [di],ax
jmp short loc_21 ; (01B0)
loc_23:
mov di,si
jmp short loc_22 ; (01B4)
loc_24:
mov al,dl
xor ah,ah ; Zero register
retn
sub_2 endp
;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
; SUBROUTINE
;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
sub_3 proc near
cld ; Clear direction
lea di,cs:[0Ah] ; Load effective addr
mov dx,1
xor ax,ax ; Zero register
stosw ; Store ax to es:[di]
lea si,cs:[10Ah] ; Load effective addr
test byte ptr [si],0FFh
jz loc_30 ; Jump if zero
loc_25:
lodsb ; String [si] to al
test al,al
jz loc_30 ; Jump if zero
cmp al,20h ; ' '
je loc_25 ; Jump if equal
cmp al,9
je loc_25 ; Jump if equal
lea ax,[si-1] ; Load effective addr
stosw ; Store ax to es:[di]
inc dx
cmp byte ptr [si-1],22h ; '"'
jne loc_28 ; Jump if not equal
push si
loc_26:
lodsb ; String [si] to al
cmp al,22h ; '"'
je loc_27 ; Jump if equal
test al,al
jnz loc_26 ; Jump if not zero
pop si
jmp short loc_28 ; (021A)
loc_27:
inc word ptr [di-2]
pop ax
jmp short loc_29 ; (0223)
loc_28:
lodsb ; String [si] to al
cmp al,20h ; ' '
je loc_29 ; Jump if equal
test al,al
jnz loc_28 ; Jump if not zero
loc_29:
mov byte ptr [si-1],0
test al,al
jnz loc_25 ; Jump if not zero
loc_30:
xor ax,ax ; Zero register
stosw ; Store ax to es:[di]
mov ds:data_2e,dx ; (00F4:0008=0CBE8h)
retn
sub_3 endp
;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
; SUBROUTINE
;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
sub_4 proc near
mov cx,0FFFFh
mov di,bx
push ax
cld ; Clear direction
mov al,0
repne scasb ; Rep zf=0+cx >0 Scan es:[di] for al
not cx
dec cx
mov dx,bx
pop bx
mov ah,40h ; '@'
int 21h ; DOS Services ah=function 40h
; write file cx=bytes, to ds:dx
retn
sub_4 endp
;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
; SUBROUTINE
;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
sub_5 proc near
push bp
sub sp,48h
jc loc_31 ; Jump if carry Set
cmp sp,ds:data_3e ; (00F4:01B6=1E75h)
ja loc_32 ; Jump if above
loc_31:
jmp loc_3 ; (0086)
loc_32:
mov bp,sp
mov ax,1C0h
push ax
call sub_13 ; (0C20)
mov sp,bp
mov ax,1
cmp word ptr [bp+4Ch],1
mov [bp+44h],ax
jg loc_33 ; Jump if >
mov ax,1FBh
push ax
mov ax,2
push ax
call sub_14 ; (0C3E)
mov sp,bp
mov ax,1
push ax
call sub_1 ; (0080)
mov sp,bp
loc_33:
mov word ptr [bp+42h],1
loc_34:
mov ax,[bp+42h]
mov bx,[bp+4Ch]
cmp bx,ax
jle loc_38 ; Jump if < or =
shl ax,1 ; Shift w/zeros fill
mov si,[bp+4Eh]
add si,ax
mov ax,[si]
mov [bp+46h],ax
loc_35:
lea ax,[bp+2] ; Load effective addr
push ax
xor ax,ax ; Zero register
push ax
push word ptr [bp+46h]
call sub_8 ; (0613)
mov sp,bp
test ax,ax
jz loc_37 ; Jump if zero
xor ax,ax ; Zero register
mov [bp+46h],ax
cmp word ptr [bp+44h],0
je loc_36 ; Jump if equal
mov bx,27Bh
push bx
mov bx,270h
push bx
mov bx,266h
push bx
mov bx,25Fh
push bx
mov bx,254h
push bx
mov bx,249h
push bx
mov bx,23Fh
push bx
mov bx,238h
push bx
mov bx,215h
push bx
mov [bp+44h],ax
call sub_13 ; (0C20)
mov sp,bp
loc_36:
lea ax,[bp+2] ; Load effective addr
push ax
call sub_6 ; (0310)
mov sp,bp
jmp short loc_35 ; (02A0)
loc_37:
inc word ptr [bp+42h]
jmp short loc_34 ; (028A)
loc_38:
mov ax,286h
push ax
call sub_13 ; (0C20)
mov sp,bp
xor ax,ax ; Zero register
push ax
call sub_1 ; (0080)
mov sp,bp
add sp,48h
pop bp
retn
sub_5 endp
;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
; SUBROUTINE
;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
sub_6 proc near
push bp
sub sp,2018h
jc loc_39 ; Jump if carry Set
cmp sp,ds:data_14e ; (7E60:01B6=0B83Eh)
ja loc_40 ; Jump if above
loc_39:
jmp loc_3 ; (0086)
loc_40:
mov bp,sp
xor ax,ax ; Zero register
push ax
push word ptr ss:data_12e[bp] ; (00F4:201C=0)
call sub_9 ; (075F)
mov sp,bp
test ax,ax
mov [bp+6],ax
jns loc_41 ; Jump if not sign
push word ptr ss:data_12e[bp] ; (00F4:201C=0)
mov ax,288h
push ax
mov ax,2
push ax
call sub_14 ; (0C3E)
mov sp,bp
add sp,2018h
pop bp
retn
loc_41:
mov word ptr ss:data_8e[bp],0 ; (00F4:200E=4E26h)
mov word ptr ss:data_7e[bp],0 ; (00F4:200C=4E23h)
mov word ptr [bp+0Ah],0
loc_42:
mov ax,2000h
push ax
lea ax,[bp+0Ch] ; Load effective addr
push ax
push word ptr [bp+6]
call sub_11 ; (0792)
mov sp,bp
xor bx,bx ; Zero register
test ax,ax
jns loc_43 ; Jump if not sign
dec bx
loc_43:
add ss:data_7e[bp],ax ; (00F4:200C=4E23h)
adc ss:data_8e[bp],bx ; (00F4:200E=4E26h)
mov [bp+8],ax
test ax,ax
jz loc_44 ; Jump if zero
push word ptr [bp+0Ah]
push ax
lea ax,[bp+0Ch] ; Load effective addr
push ax
call sub_7 ; (03E7)
mov sp,bp
mov [bp+0Ah],ax
loc_44:
cmp word ptr [bp+8],2000h
je loc_42 ; Jump if equal
jmp short loc_45 ; (039C)
loc_45:
lea ax,[bp+2010h] ; Load effective addr
push ax
push word ptr ss:data_12e[bp] ; (00F4:201C=0)
call sub_12 ; (0911)
mov sp,bp
mov al,ss:data_10e[bp] ; (00F4:2012=44h)
xor ah,ah ; Zero register
mov bl,ss:data_11e[bp] ; (00F4:2013=0Bh)
xor bh,bh ; Zero register
mov cx,ss:data_9e[bp] ; (00F4:2010=40EAh)
sub cx,76Ch
push cx
push bx
push ax
push word ptr ss:data_8e[bp] ; (00F4:200E=4E26h)
push word ptr ss:data_7e[bp] ; (00F4:200C=4E23h)
push word ptr [bp+0Ah]
push word ptr ss:data_12e[bp] ; (00F4:201C=0)
mov ax,29Ah
push ax
call sub_13 ; (0C20)
mov sp,bp
push word ptr [bp+6]
call sub_10 ; (077C)
mov sp,bp
add sp,2018h
pop bp
retn
sub_6 endp
;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
; SUBROUTINE
;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
sub_7 proc near
push bp
mov bp,sp
mov si,[bp+4]
mov cx,[bp+6]
cld ; Clear direction
mov dx,[bp+8]
locloop_46:
lodsb ; String [si] to al
xor al,dh
mov bl,al
xor bh,bh ; Zero register
lea bx,[bx+413h] ; Load effective addr
mov al,cs:[bx]
xor al,dl
mov dh,al
inc bh
mov dl,cs:[bx]
loop locloop_46 ; Loop if cx > 0
mov ax,dx
mov sp,bp
pop bp
retn
sub_7 endp
db 0, 0A0h, 0E1h, 41h, 63h, 0C3h
db 82h, 22h, 0C7h, 67h, 26h, 86h
db 0A4h, 4, 45h, 0E5h, 2Fh, 8Fh
db 0CEh, 6Eh, 4Ch, 0ECh, 0ADh, 0Dh
db 0E8h, 48h, 9, 0A9h, 8Bh, 2Bh
db 6Ah, 0CAh, 5Eh, 0FEh, 0BFh, 1Fh
db 3Dh
loc_47:
popf ; Pop flags
;* esc 4,ds:data_22e[si] ; (7E60:FF99=0)
db 0DCh, low data_13e ; Fixup for MASM (Z)
cwd ; Word to double word
cmp [bx+si-28h],di
cli ; Disable interrupts
pop dx
sbb di,ss:data_40e[bp+di] ; (7FAD:D171=0)
nop
xor [bp+si],dl
mov dl,0F3h
push bx
mov dh,16h
push di
not bp
;* jnz loc_48 ;*Jump if not zero
db 75h, 34h
xchg ax,sp
mov sp,5D1Ch
std ; Set direction flag
esc 7,[bx+3Eh]
db 3Eh ; ds:
sahf ; Store ah into flags
jnp loc_47 ; Jump if not parity
;* call far ptr sub_18 ;*(F9B8:183A)
db 9Ah, 3Ah, 18h, 0B8h, 0F9h
pop cx
xchg ax,bx
xor si,[bp+si-2Eh]
;*** *** lock ; Lock the bus
push ax
adc ds:data_21e[bx+di],si ; (7E60:F454=0)
mov ch,15h
aaa ; Ascii adjust
xchg ax,di
db 0D6h, 76h, 0E2h, 42h, 3, 0A3h
db 81h, 21h, 60h, 0C0h, 25h, 85h
db 0C4h, 64h, 46h, 0E6h, 0A7h, 7
db 0CDh
db 6Dh, 2Ch
loc_48:
db 8Ch, 0AEh, 0Eh, 4Fh, 0EFh, 0Ah
db 0AAh, 0EBh, 4Bh, 69h, 0C9h, 88h
db 28h, 0D8h, 78h, 39h, 99h, 0BBh
db 1Bh, 5Ah, 0FAh, 1Fh, 0BFh, 0FEh
db 5Eh, 7Ch, 0DCh, 9Dh, 3Dh, 0F7h
db 57h, 16h, 0B6h, 94h, 34h, 75h
db 0D5h, 30h, 90h, 0D1h, 71h, 53h
db 0F3h, 0B2h, 12h, 86h, 26h, 67h
db 0C7h, 0E5h, 45h, 4, 0A4h, 41h
db 0E1h, 0A0h, 0, 22h, 82h, 0C3h
db 63h, 0A9h, 9, 48h, 0E8h, 0CAh
db 6Ah, 2Bh, 8Bh, 6Eh, 0CEh, 8Fh
db 2Fh, 0Dh, 0ADh, 0ECh, 4Ch, 64h
db 0C4h, 85h, 25h, 7, 0A7h, 0E6h
db 46h, 0A3h, 3, 42h, 0E2h, 0C0h
db 60h, 21h, 81h, 4Bh, 0EBh, 0AAh
db 0Ah, 28h, 88h, 0C9h, 69h, 8Ch
db 2Ch, 6Dh, 0CDh, 0EFh, 4Fh, 0Eh
db 0AEh, 3Ah, 9Ah, 0DBh, 7Bh, 59h
db 0F9h, 0B8h, 18h, 0FDh, 5Dh, 1Ch
db 0BCh, 9Eh, 3Eh, 7Fh, 0DFh, 15h
db 0B5h, 0F4h, 54h, 76h, 0D6h, 97h
db 37h, 0D2h, 72h, 33h, 93h, 0B1h
db 11h, 50h, 0F0h, 0, 97h, 0B9h
db 2Eh, 0E5h, 72h, 5Ch, 0CBh, 0CAh
db 5Dh, 73h, 0E4h, 2Fh, 0B8h, 96h
db 1, 3, 94h, 0BAh, 2Dh, 0E6h
db 71h, 5Fh, 0C8h, 0C9h, 5Eh, 70h
db 0E7h, 2Ch, 0BBh, 95h, 2, 6
db 91h, 0BFh, 28h, 0E3h, 74h, 5Ah
db 0CDh, 0CCh, 5Bh, 75h, 0E2h, 29h
db 0BEh, 90h, 7, 5, 92h, 0BCh
db 2Bh, 0E0h, 77h, 59h, 0CEh, 0CFh
db 58h, 76h, 0E1h, 2Ah, 0BDh, 93h
db 4, 0Ch, 9Bh, 0B5h, 22h, 0E9h
db 7Eh, 50h, 0C7h, 0C6h, 51h, 7Fh
db 0E8h, 23h, 0B4h, 9Ah, 0Dh, 0Fh
db 98h, 0B6h, 21h, 0EAh, 7Dh, 53h
db 0C4h, 0C5h, 52h, 7Ch, 0EBh, 20h
db 0B7h, 99h, 0Eh, 0Ah, 9Dh, 0B3h
db 24h, 0EFh, 78h, 56h, 0C1h, 0C0h
db 57h, 79h, 0EEh, 25h, 0B2h, 9Ch
db 0Bh, 9, 9Eh, 0B0h, 27h, 0ECh
db 7Bh, 55h, 0C2h, 0C3h, 54h, 7Ah
db 0EDh, 26h, 0B1h, 9Fh, 8, 8Fh
db 18h, 36h, 0A1h, 6Ah, 0FDh, 0D3h
db 44h, 45h, 0D2h, 0FCh, 6Bh, 0A0h
db 37h, 19h, 8Eh, 8Ch, 1Bh, 35h
db 0A2h, 69h, 0FEh, 0D0h, 47h, 46h
db 0D1h, 0FFh, 68h, 0A3h, 34h, 1Ah
db 8Dh, 89h, 1Eh, 30h, 0A7h, 6Ch
db 0FBh, 0D5h, 42h, 43h, 0D4h, 0FAh
db 6Dh, 0A6h, 31h, 1Fh, 88h, 8Ah
db 1Dh, 33h, 0A4h, 6Fh, 0F8h, 0D6h
db 41h, 40h, 0D7h, 0F9h, 6Eh, 0A5h
db 32h, 1Ch, 8Bh, 83h, 14h, 3Ah
db 0ADh, 66h, 0F1h, 0DFh, 48h, 49h
db 0DEh, 0F0h, 67h, 0ACh, 3Bh, 15h
db 82h, 80h, 17h, 39h, 0AEh, 65h
db 0F2h, 0DCh, 4Bh, 4Ah, 0DDh, 0F3h
db 64h, 0AFh, 38h, 16h, 81h, 85h
db 12h, 3Ch, 0ABh, 60h, 0F7h, 0D9h
db 4Eh, 4Fh, 0D8h, 0F6h, 61h, 0AAh
db 3Dh, 13h, 84h, 86h, 11h, 3Fh
db 0A8h, 63h, 0F4h, 0DAh, 4Dh, 4Ch
db 0DBh, 0F5h, 62h, 0A9h, 3Eh, 10h
db 87h
;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
; SUBROUTINE
;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
sub_8 proc near
push bp
mov bp,sp
push es
mov ah,2Fh ; '/'
int 21h ; DOS Services ah=function 2Fh
; get DTA ptr into es:bx
mov ds:data_19e,bx ; (7E60:031E=8404h)
mov ds:data_20e,es ; (7E60:0320=75C0h)
pop es
lea dx,cs:[2B3h] ; Load effective addr
mov ah,1Ah
int 21h ; DOS Services ah=function 1Ah
; set DTA to ds:dx
mov di,[bp+4]
test di,di
jz loc_49 ; Jump if zero
mov si,di
mov byte ptr ds:data_18e,0 ; (7E60:02DE=0Ah)
mov cx,0FFFFh
xor al,al ; Zero register
cld ; Clear direction
repne scasb ; Rep zf=0+cx >0 Scan es:[di] for al
not cx
dec di
std ; Set direction flag
mov al,5Ch ; '\'
repne scasb ; Rep zf=0+cx >0 Scan es:[di] for al
jnz loc_49 ; Jump if not zero
mov cx,di
sub cx,si
inc cx
inc cx
lea di,cs:[2DEh] ; Load effective addr
cld ; Clear direction
rep movsb ; Rep when cx >0 Mov [si] to es:[di]
xor al,al ; Zero register
stosb ; Store al to es:[di]
loc_49:
mov ah,4Eh ; 'N'
mov cx,[bp+6]
mov dx,[bp+4]
test dx,dx
jnz loc_50 ; Jump if not zero
mov ah,4Fh ; 'O'
loc_50:
int 21h ; DOS Services ah=function 4Fh
; find next filename match
pushf ; Push flags
push ds
lds dx,dword ptr ds:data_19e ; (7E60:031E=8404h) Load 32 bit ptr
mov ah,1Ah
int 21h ; DOS Services ah=function 1Ah
; set DTA to ds:dx
pop ds
lea ax,cs:[2C8h] ; Load effective addr
popf ; Pop flags
jnc loc_52 ; Jump if carry=0
xor ax,ax ; Zero register
loc_51:
mov sp,bp
pop bp
retn
loc_52:
mov di,[bp+8]
lea si,cs:[2DEh] ; Load effective addr
cld ; Clear direction
loc_53:
lodsb ; String [si] to al
test al,al
jz loc_54 ; Jump if zero
stosb ; Store al to es:[di]
jmp short loc_53 ; (068C)
loc_54:
lea si,cs:[2D1h] ; Load effective addr
loc_55:
lodsb ; String [si] to al
stosb ; Store al to es:[di]
test al,al
jnz loc_55 ; Jump if not zero
mov ax,0FFFFh
jmp short loc_51 ; (0680)
sub_8 endp
data_23 db 0, 0
data_24 dw 0
data_25 dw 0
data_26 dw 0
data_27 dw 0
data_28 dw 0
db 55h, 8Bh, 0ECh, 2Eh, 0F7h, 6
db 0ABh, 6, 0FFh, 0FFh, 74h, 0Eh
db 0F7h, 46h, 4, 0FFh, 0FFh
db 74h, 54h
loc_56:
mov ax,0FFFFh
loc_57:
mov sp,bp
pop bp
retn
db 0F7h, 46h, 4, 0FFh, 0FFh, 74h
db 0F2h, 6, 0B8h, 23h, 35h, 0CDh
db 21h, 2Eh, 89h, 1Eh, 0A3h, 6
db 2Eh, 8Ch, 6, 0A5h, 6, 0B8h
db 24h, 35h, 0CDh, 21h, 2Eh, 89h
db 1Eh, 0A7h, 6, 2Eh, 8Ch, 6
db 0A9h, 6, 7, 1Eh, 0Eh, 1Fh
db 8Dh, 16h, 38h, 7, 0B8h, 23h
db 25h, 0CDh, 21h, 8Dh, 16h, 49h
db 7, 0B8h, 24h, 25h, 0CDh, 21h
db 1Fh, 8Bh, 46h, 4, 2Eh, 0A3h
db 0ABh, 6, 2Eh, 8Ch, 1Eh, 0ADh
db 6, 33h, 0C0h, 0EBh, 0AFh, 1Eh
db 2Eh, 0C5h, 1Eh, 0A3h, 6, 0B8h
db 23h, 25h, 0CDh, 21h, 2Eh, 0C5h
db 1Eh, 0A7h, 6, 0B8h, 24h, 25h
db 0CDh, 21h, 1Fh, 33h, 0C0h, 2Eh
db 0A3h, 0ABh, 6, 2Eh, 0A3h, 0ADh
db 6, 0EBh, 8Dh
;██████████████████████████████████████████████████████████████████████████
;
; External Entry Point
;
;██████████████████████████████████████████████████████████████████████████
int_23h_entry proc far
push ds
push bx
lds bx,dword ptr cs:data_27 ; (7E70:06AB=0) Load 32 bit ptr
mov word ptr [bx],0FFFFh
pop bx
pop ds
clc ; Clear carry flag
retf 2 ; Return far
int_23h_entry endp
;██████████████████████████████████████████████████████████████████████████
;
; External Entry Point
;
;██████████████████████████████████████████████████████████████████████████
int_24h_entry proc far
push ds
push bx
lds bx,dword ptr cs:data_27 ; (7E70:06AB=0) Load 32 bit ptr
push ax
push dx
mov dx,di
mov al,dl
mov [bx],ax
pop dx
pop ax
mov al,0
pop bx
pop ds
iret ; Interrupt return
int_24h_entry endp
;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
; SUBROUTINE
;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
sub_9 proc near
push bp
mov bp,sp
mov dx,[bp+4]
mov al,[bp+6]
mov bx,dx
test byte ptr [bx],0FFh
jz loc_58 ; Jump if zero
mov ah,3Dh ; '='
int 21h ; DOS Services ah=function 3Dh
; open file, al=mode,name@ds:dx
jnc loc_58 ; Jump if carry=0
mov ax,0FFFFh
loc_58:
mov sp,bp
pop bp
retn
sub_9 endp
;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
; SUBROUTINE
;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
sub_10 proc near
push bp
mov bp,sp
mov bx,[bp+4]
mov ah,3Eh ; '>'
int 21h ; DOS Services ah=function 3Eh
; close file, bx=file handle
mov ax,0
jnc loc_59 ; Jump if carry=0
mov ax,0FFFFh
loc_59:
mov sp,bp
pop bp
retn
sub_10 endp
;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
; SUBROUTINE
;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
sub_11 proc near
push bp
mov bp,sp
mov bx,[bp+4]
mov dx,[bp+6]
mov cx,[bp+8]
mov ah,3Fh ; '?'
int 21h ; DOS Services ah=function 3Fh
; read file, cx=bytes, to ds:dx
jnc loc_60 ; Jump if carry=0
mov ax,0FFFFh
loc_60:
mov sp,bp
pop bp
retn
sub_11 endp
db 55h, 8Bh, 0ECh, 8Bh, 5Eh, 4
db 8Bh, 56h, 6, 8Bh, 4Eh, 8
db 0B4h, 40h, 0CDh, 21h, 73h, 2
db 0B4h, 0FFh, 8Bh, 0E5h, 5Dh, 0C3h
db 55h, 8Bh, 0ECh, 8Bh, 56h, 4
db 0B4h, 41h, 0CDh, 21h, 0B8h, 0
db 0, 73h, 3, 0B8h, 0FFh, 0FFh
db 8Bh, 0E5h, 5Dh, 0C3h, 55h, 8Bh
db 0ECh, 8Bh, 56h, 4, 8Bh, 7Eh
db 6, 0B4h, 56h, 0CDh, 21h, 0B8h
db 0, 0, 73h, 3, 0B8h, 0FFh
db 0FFh, 8Bh, 0E5h, 5Dh, 0C3h, 55h
db 8Bh, 0ECh, 8Bh, 5Eh, 4, 8Bh
db 56h, 6, 8Bh, 4Eh, 8, 8Ah
db 46h, 0Ah, 0B4h, 42h, 0CDh, 21h
db 72h, 6, 8Bh, 0DAh
loc_61:
mov sp,bp
pop bp
retn
db 0B8h, 0FFh, 0FFh, 8Bh, 0D8h, 0EBh
db 0F5h, 55h, 8Bh, 0ECh, 8Bh, 5Eh
db 4, 0B0h, 1, 0B9h, 0, 0
db 0BAh, 0, 0, 0B4h, 42h, 0CDh
db 21h, 72h, 7, 8Bh, 0DAh, 93h
loc_62:
mov sp,bp
pop bp
retn
db 0B8h, 0FFh, 0FFh, 8Bh, 0D8h, 0EBh
db 0F5h, 55h, 8Bh, 0ECh, 8Bh, 56h
db 4, 55h, 83h, 0ECh, 2Fh, 8Bh
db 0ECh, 52h, 6, 0B4h, 2Fh, 0CDh
db 21h, 8Ch, 46h, 2Bh, 89h, 5Eh
db 2Dh, 7, 8Dh, 56h, 0, 0B4h
db 1Ah, 0CDh, 21h, 5Ah, 0B4h, 4Eh
db 0CDh, 21h, 72h, 8, 8Bh, 46h
db 1Ah, 8Bh, 5Eh, 1Ch, 0EBh, 5
db 0B8h, 0FFh, 0FFh, 8Bh, 0D8h, 50h
db 53h, 1Eh, 8Eh, 5Eh, 2Bh, 8Bh
db 56h, 2Dh, 0B4h, 1Ah, 0CDh, 21h
db 1Fh, 58h, 5Bh, 83h, 0C4h, 2Fh
db 5Dh, 8Bh, 0E5h, 5Dh, 0C3h, 55h
db 8Bh, 0ECh, 8Bh, 56h, 4, 8Bh
db 4Eh, 6, 0B0h, 1, 0B4h, 43h
db 0CDh, 21h, 0B8h, 0, 0, 73h
db 2, 0F7h, 0D0h, 8Bh, 0E5h, 5Dh
db 0C3h, 55h, 8Bh, 0ECh, 8Bh, 56h
db 4, 8Bh, 4Eh, 6, 0B4h, 3Ch
db 0CDh, 21h, 73h, 3, 0B8h, 0FFh
db 0FFh, 8Bh, 0E5h, 5Dh, 0C3h, 55h
db 8Bh, 0ECh, 8Bh, 56h, 4, 0B4h
db 3Bh, 0CDh, 21h, 0B8h, 0, 0
db 73h, 2, 0F7h, 0D0h, 8Bh, 0E5h
db 5Dh, 0C3h, 55h, 8Bh, 0ECh, 8Bh
db 56h, 4, 0B4h, 39h, 0CDh, 21h
db 0B8h, 0, 0, 73h, 2, 0F7h
db 0D0h, 8Bh, 0E5h, 5Dh, 0C3h, 55h
db 8Bh, 0ECh, 8Bh, 76h, 6, 8Ah
db 56h, 4, 0B4h, 47h, 0CDh, 21h
db 0B8h, 0, 0, 73h, 2, 0F7h
db 0D0h, 8Bh, 0E5h, 5Dh, 0C3h, 55h
db 8Bh, 0ECh, 0B4h, 19h, 0CDh, 21h
db 32h, 0E4h, 8Bh, 0E5h, 5Dh, 0C3h
db 55h, 8Bh, 0ECh, 8Ah, 56h, 4
db 0B4h, 0Eh, 0CDh, 21h, 32h, 0E4h
db 8Bh, 0E5h, 5Dh, 0C3h
;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
; SUBROUTINE
;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
sub_12 proc near
push bp
mov bp,sp
mov dx,[bp+4]
mov di,[bp+6]
mov al,0
mov ah,3Dh ; '='
int 21h ; DOS Services ah=function 3Dh
; open file, al=mode,name@ds:dx
jc loc_64 ; Jump if carry Set
mov bx,ax
push ax
mov al,0
mov ah,57h ; 'W'
int 21h ; DOS Services ah=function 57h
; get/set file date & time
pop bx
jc loc_64 ; Jump if carry Set
push dx
push cx
mov ah,3Eh ; '>'
int 21h ; DOS Services ah=function 3Eh
; close file, bx=file handle
pop bx
pop dx
cld ; Clear direction
mov al,dh
shr al,1 ; Shift w/zeros fill
cbw ; Convrt byte to word
add ax,7BCh
stosw ; Store ax to es:[di]
mov ax,dx
mov cl,5
shr ax,cl ; Shift w/zeros fill
and ax,0Fh
stosb ; Store al to es:[di]
mov al,dl
and al,1Fh
stosb ; Store al to es:[di]
mov al,bh
mov cl,3
shr al,cl ; Shift w/zeros fill
stosb ; Store al to es:[di]
mov ax,bx
mov cl,5
shr ax,cl ; Shift w/zeros fill
and al,3Fh ; '?'
stosb ; Store al to es:[di]
mov al,bl
and al,1Fh
add al,al
stosb ; Store al to es:[di]
xor ax,ax ; Zero register
loc_63:
mov sp,bp
pop bp
retn
loc_64:
mov ax,0FFFFh
jmp short loc_63 ; (0968)
sub_12 endp
db 55h, 8Bh, 0ECh, 8Bh, 56h, 4
db 8Bh, 76h, 6, 0FCh, 0ADh, 2Dh
db 0BCh, 7, 0D1h, 0E0h, 0D1h, 0E0h
db 0D1h, 0E0h, 0D1h, 0E0h, 8Bh, 0D8h
db 0ACh, 0Ah, 0D8h, 0B1h, 5, 0D3h
db 0E3h, 0ACh, 0Ah, 0D8h, 0ACh, 0B1h
db 6, 0D3h, 0E0h, 8Bh, 0F8h, 0ACh
db 0Bh, 0C7h, 0FEh, 0C9h, 0D3h, 0E0h
db 8Bh, 0F8h, 0ACh, 32h, 0E4h, 0D1h
db 0E8h, 0Bh, 0F8h, 53h, 57h, 0B0h
db 0, 0B4h, 3Dh, 0CDh, 21h, 59h
db 5Ah, 72h, 16h, 8Bh, 0D8h, 50h
db 0B0h, 1, 0B4h, 57h, 0CDh, 21h
db 5Bh, 72h, 0Ah, 0B4h, 3Eh, 0CDh
db 21h, 33h, 0C0h, 8Bh, 0E5h, 5Dh
db 0C3h, 0B8h, 0FFh, 0FFh, 8Bh, 0E5h
db 5Dh, 0C3h, 55h, 8Bh, 0ECh, 0B4h
db 45h, 8Bh, 5Eh, 4, 0CDh, 21h
db 73h, 3, 0B8h, 0FFh, 0FFh, 8Bh
db 0E5h, 5Dh, 0C3h, 55h, 8Bh, 0ECh
db 0B4h, 46h, 8Bh, 5Eh, 4, 8Bh
db 4Eh, 6, 0CDh, 21h, 8Bh, 46h
db 6, 73h, 3, 0B8h, 0FFh, 0FFh
db 8Bh, 0E5h, 5Dh, 0C3h, 55h, 8Bh
db 0ECh, 8Bh, 7Eh, 4, 0B4h, 2Ah
db 0CDh, 21h, 8Bh, 0C1h, 0FCh, 0ABh
db 8Ah, 0C6h, 0AAh, 8Ah, 0C2h, 0AAh
db 0B4h, 2Ch, 0CDh, 21h, 8Ah, 0C5h
db 0AAh, 8Ah, 0C1h, 0AAh, 8Ah, 0C6h
db 0AAh, 33h, 0C0h, 8Bh, 0E5h, 5Dh
db 0C3h, 5Fh, 5Bh, 57h, 55h, 81h
db 0ECh, 2Ch, 1, 8Bh, 0ECh, 53h
db 0B4h, 37h, 0B0h, 0, 0CDh, 21h
db 8Ah, 0C2h, 0FCh, 8Dh, 7Eh, 14h
db 47h, 0AAh, 0B8h, 43h, 20h, 0ABh
db 5Bh, 8Bh, 0F3h
loc_65:
lodsb ; String [si] to al
stosb ; Store al to es:[di]
test al,al
jnz loc_65 ; Jump if not zero
dec di
mov byte ptr [di],0Dh
lea bx,[bp+14h] ; Load effective addr
sub di,bx
mov ax,di
mov [bx],al
lea di,[bp+0] ; Load effective addr
xor ax,ax ; Zero register
stosw ; Store ax to es:[di]
lea ax,[bp+14h] ; Load effective addr
stosw ; Store ax to es:[di]
mov ax,ds
stosw ; Store ax to es:[di]
lea ax,cs:[32Bh] ; Load effective addr
stosw ; Store ax to es:[di]
mov ax,ds
stosw ; Store ax to es:[di]
lea ax,cs:[32Bh] ; Load effective addr
stosw ; Store ax to es:[di]
mov ax,ds
stosw ; Store ax to es:[di]
mov ah,51h ; 'Q'
int 21h ; DOS Services ah=function 51h
; get active PSP segment in bx
mov es,bx
mov ax,es:data_1e ; (0016:002C=0)
mov es,ax
xor di,di ; Zero register
lea si,cs:[322h] ; Load effective addr
cld ; Clear direction
loc_66:
xor bx,bx ; Zero register
test byte ptr es:[di],0FFh
jnz loc_67 ; Jump if not zero
add sp,12Ch
mov ax,ds
mov es,ax
pop bp
jmp short loc_70 ; (0B00)
db 90h
loc_67:
mov al,es:[di]
inc di
test al,al
jz loc_66 ; Jump if zero
mov ah,al
and ah,40h ; '@'
shr ah,1 ; Shift w/zeros fill
not ah
and al,ah
cmp al,[bx+si]
jne loc_68 ; Jump if not equal
inc bx
test byte ptr [bx+si],0FFh
jnz loc_67 ; Jump if not zero
jmp short loc_69 ; (0AC5)
loc_68:
xor al,al ; Zero register
mov cx,0FFFFh
repne scasb ; Rep zf=0+cx >0 Scan es:[di] for al
jmp short loc_66 ; (0A89)
loc_69:
mov dx,di
lea bx,[bp+0] ; Load effective addr
mov ax,ds
mov cs:data_29,ax ; (7E70:0B04=0)
mov cs:data_30,sp ; (7E70:0B06=0)
mov cx,es
mov es,ax
mov ds,cx
mov ah,4Bh ; 'K'
mov al,0
int 21h ; DOS Services ah=function 4Bh
; run progm @ds:dx, parm @es:bx
mov ax,cs:data_29 ; (7E70:0B04=0)
mov ds,ax
mov es,ax
mov ss,ax
mov sp,cs:data_30 ; (7E70:0B06=0)
rcl al,1 ; Rotate thru carry
add sp,12Ch
pop bp
test al,1
jnz loc_70 ; Jump if not zero
mov ah,4Dh ; 'M'
int 21h ; DOS Services ah=function 4Dh
; get return code info in ax
retn
loc_70:
mov ax,0FFFFh
retn
data_29 dw 0
data_30 dw 0
db 55h, 8Bh, 0ECh, 6, 0B4h, 51h
db 0CDh, 21h, 8Eh, 0C3h, 8Bh, 76h
db 4, 26h, 0A1h, 2Ch, 0, 8Eh
db 0C0h, 33h, 0FFh, 0FCh
loc_71:
xor bx,bx ; Zero register
test byte ptr es:[di],0FFh
jnz loc_72 ; Jump if not zero
pop es
mov ax,0FFFFh
pop bp
retn
loc_72:
mov al,es:[di]
inc di
test al,al
jz loc_71 ; Jump if zero
mov ah,al
and ah,40h ; '@'
shr ah,1 ; Shift w/zeros fill
not ah
and al,ah
cmp al,[bx+si]
jne loc_74 ; Jump if not equal
inc bx
test byte ptr [bx+si],0FFh
jnz loc_72 ; Jump if not zero
push ds
push es
pop ds
pop es
mov si,di
mov di,[bp+6]
mov cx,0FFFFh
locloop_73:
lodsb ; String [si] to al
stosb ; Store al to es:[di]
test al,al
loopnz locloop_73 ; Loop if zf=0, cx>0
not cx
dec cx
mov ax,cx
push es
pop ds
pop es
pop bp
retn
loc_74:
xor al,al ; Zero register
mov cx,0FFFFh
repne scasb ; Rep zf=0+cx >0 Scan es:[di] for al
jmp short loc_71 ; (0B1E)
db 55h, 8Bh, 0ECh, 8Bh, 46h, 4
db 8Bh, 56h, 6, 5, 0Fh, 0
db 83h, 0D2h, 0, 0B1h, 4, 0D3h
db 0E8h, 80h, 0E2h, 0Fh, 0D3h, 0CAh
db 0Ah, 0E6h, 8Bh, 0D8h, 0B4h, 48h
db 0CDh, 21h, 73h, 2, 33h, 0C0h
db 8Bh, 0E5h, 5Dh, 0C3h, 55h, 8Bh
db 0ECh, 8Eh, 46h, 4, 0B4h, 49h
db 0CDh, 21h, 8Ch, 0D8h, 8Eh, 0C0h
db 0B8h, 0, 0, 73h, 2, 0F7h
db 0D0h, 8Bh, 0E5h, 5Dh, 0C3h, 55h
db 8Bh, 0ECh, 0BBh, 0FFh, 0FFh, 0B4h
db 48h, 0CDh, 21h, 8Bh, 0C3h, 0B1h
db 4, 0D3h, 0E0h, 0D3h, 0C3h, 81h
db 0E3h, 0Fh, 0, 93h, 8Bh, 0E5h
db 5Dh, 0C3h, 55h, 8Bh, 0ECh, 6
db 8Bh, 46h, 8, 8Bh, 56h, 0Ah
db 8Bh, 0F8h, 81h, 0E7h, 0Fh, 0
db 0B1h, 4, 0D3h, 0E8h, 0D2h, 0E2h
db 0Ah, 0E2h, 3, 46h, 4, 8Eh
db 0C0h, 8Bh, 4Eh, 0Ch, 8Bh, 76h
db 6, 0FCh, 0F3h, 0A4h, 7, 8Bh
db 0E5h, 5Dh, 0C3h, 55h, 8Bh, 0ECh
db 1Eh, 8Bh, 46h, 8, 8Bh, 56h
db 0Ah, 8Bh, 0F0h, 81h, 0E6h, 0Fh
db 0, 0B1h, 4, 0D3h, 0E8h, 0D2h
db 0E2h, 0Ah, 0E2h, 3, 46h, 4
db 8Eh, 0D8h, 8Bh, 4Eh, 0Ch, 8Bh
db 7Eh, 6, 0FCh, 0F3h, 0A4h, 1Fh
db 8Bh, 0E5h, 5Dh, 0C3h
;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
; SUBROUTINE
;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
sub_13 proc near
mov ax,1
mov ds:data_5e,ax ; (00F4:0346=7332h)
lea ax,cs:[0EAEh] ; Load effective addr
mov ds:data_4e,ax ; (00F4:0344=28Bh)
jmp short loc_75 ; (0C4E)
db 5Fh, 58h, 0A3h, 46h, 3, 8Dh
db 6, 9Dh, 0Eh, 0A3h, 44h, 3
db 57h, 0EBh, 10h
;▀▀▀▀ External Entry into Subroutine ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
sub_14:
pop di
pop ax
mov ds:data_5e,ax ; (00F4:0346=7332h)
lea ax,cs:[0EAEh] ; Load effective addr
mov ds:data_4e,ax ; (00F4:0344=28Bh)
push di
jmp short loc_75 ; (0C4E)
db 90h
loc_75:
push bp
sub sp,20h
mov bp,sp
lea bx,[bp+26h] ; Load effective addr
mov ds:data_6e,bx ; (00F4:0348=2E09h)
loc_76:
mov si,[bp+24h]
cld ; Clear direction
lodsb ; String [si] to al
mov [bp+24h],si
test al,al
jnz loc_78 ; Jump if not zero
loc_77:
xor ax,ax ; Zero register
mov sp,bp
add sp,20h
pop bp
retn
loc_78:
cmp al,25h ; '%'
je loc_79 ; Jump if equal
call word ptr ds:data_4e ; (00F4:0344=28Bh)
jmp short loc_76 ; (0C5B)
loc_79:
xor dx,dx ; Zero register
xor bh,bh ; Zero register
xor ah,ah ; Zero register
mov si,[bp+24h]
cld ; Clear direction
lodsb ; String [si] to al
cmp al,30h ; '0'
jne loc_80 ; Jump if not equal
not bh
loc_80:
test al,al
jz loc_77 ; Jump if zero
cmp al,30h ; '0'
jb loc_81 ; Jump if below
cmp al,39h ; '9'
ja loc_81 ; Jump if above
shl dx,1 ; Shift w/zeros fill
mov cx,dx
shl dx,1 ; Shift w/zeros fill
shl dx,1 ; Shift w/zeros fill
add dx,cx
and al,0Fh
add dx,ax
lodsb ; String [si] to al
jmp short loc_80 ; (0C8B)
loc_81:
test bh,bh
jz loc_82 ; Jump if zero
neg dx
loc_82:
mov [bp+24h],si
cmp al,73h ; 's'
jne loc_86 ; Jump if not equal
mov bx,ds:data_6e ; (00F4:0348=2E09h)
mov si,[bx]
inc bx
inc bx
mov ds:data_6e,bx ; (00F4:0348=2E09h)
loc_83:
cld ; Clear direction
lodsb ; String [si] to al
test al,al
jz loc_84 ; Jump if zero
call word ptr ds:data_4e ; (00F4:0344=28Bh)
test dx,dx
jz loc_83 ; Jump if zero
dec dx
jnz loc_83 ; Jump if not zero
jmp short loc_87 ; (0CFC)
db 90h
loc_84:
test dx,dx
jz loc_87 ; Jump if zero
mov cx,dx
locloop_85:
mov al,20h ; ' '
call word ptr ds:data_4e ; (00F4:0344=28Bh)
loop locloop_85 ; Loop if cx > 0
jmp short loc_87 ; (0CFC)
db 90h
loc_86:
cmp al,63h ; 'c'
jne loc_88 ; Jump if not equal
mov bx,ds:data_6e ; (00F4:0348=2E09h)
mov al,[bx]
push word ptr [bx]
inc bx
inc bx
mov ds:data_6e,bx ; (00F4:0348=2E09h)
call word ptr ds:data_4e ; (00F4:0344=28Bh)
loc_87:
jmp loc_76 ; (0C5B)
loc_88:
cmp al,64h ; 'd'
jne loc_91 ; Jump if not equal
mov bx,ds:data_6e ; (00F4:0348=2E09h)
test word ptr ss:[bx],0FFFFh
jns loc_89 ; Jump if not sign
mov al,2Dh ; '-'
call word ptr ds:data_4e ; (00F4:0344=28Bh)
neg word ptr ss:[bx]
test dx,dx
jz loc_89 ; Jump if zero
dec dx
loc_89:
push dx
mov bx,ds:data_6e ; (00F4:0348=2E09h)
push word ptr [bx]
inc bx
inc bx
mov ds:data_6e,bx ; (00F4:0348=2E09h)
push bp
call sub_16 ; (0DE7)
mov sp,bp
loc_90:
mov si,bp
xor dx,dx ; Zero register
jmp short loc_83 ; (0CC1)
loc_91:
cmp al,75h ; 'u'
je loc_89 ; Jump if equal
cmp al,78h ; 'x'
jne loc_92 ; Jump if not equal
push dx
mov bx,ds:data_6e ; (00F4:0348=2E09h)
push word ptr [bx]
inc bx
inc bx
mov ds:data_6e,bx ; (00F4:0348=2E09h)
push bp
call sub_15 ; (0D7A)
mov sp,bp
jmp short loc_90 ; (0D2F)
loc_92:
cmp al,44h ; 'D'
jne loc_93 ; Jump if not equal
push dx
mov bx,ds:data_6e ; (00F4:0348=2E09h)
push word ptr [bx]
inc bx
inc bx
push word ptr [bx]
inc bx
inc bx
mov ds:data_6e,bx ; (00F4:0348=2E09h)
push bp
call sub_17 ; (0E38)
mov sp,bp
jmp short loc_90 ; (0D2F)
loc_93:
cmp al,25h ; '%'
jne loc_94 ; Jump if not equal
call word ptr ds:data_4e ; (00F4:0344=28Bh)
loc_94:
jmp loc_76 ; (0C5B)
sub_13 endp
;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
; SUBROUTINE
;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
sub_15 proc near
push bp
mov bp,sp
mov dx,[bp+6]
xor cx,cx ; Zero register
lea bx,cs:[0DD7h] ; Load effective addr
mov ax,dx
loc_95:
and al,0Fh
xlat cs:[bx] ; al=[al+[bx]] table
push ax
mov ax,dx
shr ax,1 ; Shift w/zeros fill
shr ax,1 ; Shift w/zeros fill
shr ax,1 ; Shift w/zeros fill
shr ax,1 ; Shift w/zeros fill
mov dx,ax
inc cx
test ax,ax
jnz loc_95 ; Jump if not zero
cld ; Clear direction
mov di,[bp+4]
test word ptr [bp+8],0FFFFh
jnz loc_97 ; Jump if not zero
locloop_96:
pop ax
stosb ; Store al to es:[di]
loop locloop_96 ; Loop if cx > 0
mov byte ptr [di],0
mov ax,[bp+4]
mov sp,bp
pop bp
retn
loc_97:
mov si,[bp+8]
mov bl,20h ; ' '
jns locloop_98 ; Jump if not sign
neg si
mov bl,30h ; '0'
locloop_98:
cmp si,cx
jae loc_99 ; Jump if above or =
pop ax
loop locloop_98 ; Loop if cx > 0
loc_99:
sub si,cx
jz locloop_96 ; Jump if zero
xchg cx,si
mov al,bl
rep stosb ; Rep when cx >0 Store al to es:[di]
mov cx,si
jmp short locloop_96 ; (0DA9)
sub_15 endp
db '0123456789abcdef'
;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
; SUBROUTINE
;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
sub_16 proc near
push bp
mov bp,sp
mov ax,[bp+6]
xor cx,cx ; Zero register
mov bx,0Ah
loc_100:
xor dx,dx ; Zero register
div bx ; ax,dx rem=dx:ax/reg
add dl,30h ; '0'
push dx
inc cx
test ax,ax
jnz loc_100 ; Jump if not zero
cld ; Clear direction
mov di,[bp+4]
test word ptr [bp+8],0FFFFh
jnz loc_102 ; Jump if not zero
locloop_101:
pop ax
stosb ; Store al to es:[di]
loop locloop_101 ; Loop if cx > 0
mov byte ptr [di],0
mov ax,[bp+4]
mov sp,bp
pop bp
retn
loc_102:
mov si,[bp+8]
mov bl,20h ; ' '
jns locloop_103 ; Jump if not sign
neg si
mov bl,30h ; '0'
locloop_103:
cmp si,cx
jae loc_104 ; Jump if above or =
pop ax
loop locloop_103 ; Loop if cx > 0
loc_104:
sub si,cx
jz locloop_101 ; Jump if zero
xchg cx,si
mov al,bl
rep stosb ; Rep when cx >0 Store al to es:[di]
mov cx,si
jmp short locloop_101 ; (0E0A)
sub_16 endp
;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
; SUBROUTINE
;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
sub_17 proc near
push bp
mov bp,sp
test word ptr [bp+6],0FFFFh
jnz loc_105 ; Jump if not zero
push word ptr [bp+0Ah]
push word ptr [bp+8]
push word ptr [bp+4]
call sub_16 ; (0DE7)
mov sp,bp
mov sp,bp
pop bp
retn
loc_105:
mov dx,[bp+6]
mov ax,[bp+8]
mov bx,2710h
div bx ; ax,dx rem=dx:ax/reg
push dx
test word ptr [bp+0Ah],0FFFFh
jz loc_106 ; Jump if zero
js loc_108 ; Jump if sign=1
sub word ptr [bp+0Ah],4
loc_106:
push word ptr [bp+0Ah]
push ax
push word ptr [bp+4]
call sub_16 ; (0DE7)
lea sp,[bp-2] ; Load effective addr
pop dx
mov si,[bp+4]
cld ; Clear direction
loc_107:
lodsb ; String [si] to al
test al,al
jnz loc_107 ; Jump if not zero
dec si
mov ax,0FFFCh
push ax
push dx
push si
call sub_16 ; (0DE7)
mov sp,bp
mov ax,[bp+4]
mov sp,bp
pop bp
retn
loc_108:
add word ptr [bp+0Ah],4
jmp short loc_106 ; (0E6D)
sub_17 endp
db 53h, 8Bh, 1Eh, 46h, 3, 88h
db 7, 43h, 0C6h, 7, 0, 89h
db 1Eh, 46h, 3, 5Bh, 0C3h, 51h
db 52h, 50h, 0B9h, 1, 0, 3Ch
db 0Ah, 75h, 6, 58h, 0B8h, 0Dh
db 0Ah, 50h, 41h, 8Bh, 0D4h, 8Bh
db 1Eh, 46h, 3, 0B4h, 40h, 0CDh
db 21h, 58h, 5Ah, 59h, 0C3h, 5Fh
db 5Ah, 59h, 5Bh, 57h, 52h, 0E3h
db 25h
locloop_109:
push cx
mov cx,1
mov ah,3Fh ; '?'
int 21h ; DOS Services ah=function 3Fh
; read file, cx=bytes, to ds:dx
jnc loc_111 ; Jump if carry=0
loc_110:
pop dx
pop dx
xor ax,ax ; Zero register
retn
loc_111:
test ax,ax
jz loc_110 ; Jump if zero
mov si,dx
mov al,[si]
cmp al,0Ah
je loc_113 ; Jump if equal
inc dx
cmp al,1Ah
je loc_110 ; Jump if equal
cmp al,0Dh
jne loc_113 ; Jump if not equal
pop cx
loc_112:
mov si,dx
mov byte ptr [si-1],0
pop ax
retn
loc_113:
pop cx
loop locloop_109 ; Loop if cx > 0
jmp short loc_112 ; (0EF9)
db 5Fh, 5Ah, 5Bh, 57h, 8Bh, 0FAh
db 0FCh, 32h, 0C0h, 0B9h, 0FFh, 0FFh
db 0F2h, 0AEh, 0F7h, 0D1h, 49h, 0B4h
db 40h, 0CDh, 21h, 0B9h, 2, 0
db 52h, 8Dh, 16h, 42h, 3, 0B9h
db 2, 0, 0B4h, 40h, 0CDh, 21h
db 58h, 73h, 2, 33h, 0C0h
loc_ret_114:
retn
db 5Fh, 5Ah, 0B8h, 0, 0, 50h
db 0B8h, 0FFh, 7Fh, 50h, 52h, 57h
db 0EBh, 8Eh, 5Fh, 5Ah, 0B8h, 1
db 0, 50h, 52h, 57h, 0EBh, 0BEh
db 0, 82h, 1, 0B1h
db 'Stack overflow', 0Dh, 0Ah
db 0
db 'Memory allocation failed', 0Dh, 0Ah
db '+'
db 0, 0B2h, 0, 0Ah, 0, 0B0h
db 10h
db 'CRC Checker, Copyright 1988, Syd'
db 'ex. All rights reserved', 0Ah, 0Ah
db 0
db 'Syntax is CRCK file-list', 0Ah
db 0
db '%34s%10s%10s%10s', 0Ah, '%34s%10'
db 's%10s%10s', 0Ah
db 0, 20h, 20h, 46h, 49h, 4Ch
db 45h, 0
db ' CRC'
db 0
db ' LENGTH'
db 0
db ' DATE'
db 0, 20h, 20h, 3Dh, 3Dh, 3Dh
db 3Dh, 0
db ' ==='
db 0
db ' ======'
db 0
db ' ===='
db 0, 0Ah, 0
db 'Couldn', 27h, 't open %s', 0Ah
db 0
db '%34s%10u%10D%6d/%2d/%2d', 0Ah
db 0F3h, 0, 0B2h, 0, 70h, 0
db 0B0h
db 'COMSPEC='
db 0, 0, 0Ah, 0, 0B2h, 20h
db 0Bh, 0, 0B0h, 0, 0Bh, 0
db 0B0h, 0Dh, 0Ah, 2, 0, 0B2h
db 0, 0Ch, 0, 0B0h, 0FFh, 0FFh
db 8 dup (0FFh)
seg_a ends
;-------------------------------------------------------------- seg_b ----
seg_b segment para public
assume cs:seg_b , ds:seg_b , ss:stack_seg_c
db 2, 0
data_32 dw 0
data_33 dw 0
data_34 dw 13Ch
data_35 dw 100h
data_36 dw 129h
data_37 dw 129h
db 52h, 42h
;██████████████████████████████████████████████████████████████████████████
;
; Program Entry Point
;
;██████████████████████████████████████████████████████████████████████████
crcheck proc far
start:
mov ax,es
add ax,10h
push cs
pop ds
mov data_33,ax ; (7F7A:0004=0)
add ax,data_37 ; (7F7A:000C=129h)
mov es,ax
mov cx,data_34 ; (7F7A:0006=13Ch)
mov di,cx
dec di
mov si,di
std ; Set direction flag
rep movsb ; Rep when cx >0 Mov [si] to es:[di]
push ax
mov ax,32h
push ax
retf ; Return far
db 8Ch, 0C3h, 8Ch, 0D8h, 48h, 8Eh
db 0D8h, 8Eh, 0C0h, 0BFh, 0Fh, 0
db 0B9h, 10h, 0, 0B0h, 0FFh, 0F3h
db 0AEh, 47h, 8Bh, 0F7h, 8Bh, 0C3h
db 48h, 8Eh, 0C0h, 0BFh, 0Fh, 0
loc_115:
mov cl,4
mov ax,si
not ax
shr ax,cl ; Shift w/zeros fill
jz loc_116 ; Jump if zero
mov dx,ds
sub dx,ax
mov ds,dx
or si,0FFF0h
nop ;*Fixup for MASM (M)
loc_116:
mov ax,di
not ax
shr ax,cl ; Shift w/zeros fill
jz loc_117 ; Jump if zero
mov dx,es
sub dx,ax
mov es,dx
or di,0FFF0h
nop ;*Fixup for MASM (M)
loc_117:
lodsb ; String [si] to al
mov dl,al
dec si
lodsw ; String [si] to ax
mov cx,ax
inc si
mov al,dl
and al,0FEh
cmp al,0B0h
jne loc_118 ; Jump if not equal
lodsb ; String [si] to al
rep stosb ; Rep when cx >0 Store al to es:[di]
jmp short loc_119 ; (0092)
db 90h
loc_118:
cmp al,0B2h
jne loc_124 ; Jump if not equal
rep movsb ; Rep when cx >0 Mov [si] to es:[di]
loc_119:
mov al,dl
test al,1
jz loc_115 ; Jump if zero
mov si,112h
push cs
pop ds
mov bx,data_33 ; (7F7A:0004=0)
cld ; Clear direction
xor dx,dx ; Zero register
loc_120:
lodsw ; String [si] to ax
mov cx,ax
jcxz loc_122 ; Jump if cx=0
mov ax,dx
add ax,bx
mov es,ax
locloop_121:
lodsw ; String [si] to ax
mov di,ax
add es:[di],bx
loop locloop_121 ; Loop if cx > 0
loc_122:
cmp dx,0F000h
je loc_123 ; Jump if equal
add dx,1000h
jmp short loc_120 ; (00A4)
loc_123:
mov ax,bx
mov di,data_35 ; (7F7A:0008=100h)
mov si,data_36 ; (7F7A:000A=129h)
add si,ax
add word ptr data_32,ax ; (7F7A:0002=0)
sub ax,10h
mov ds,ax
mov es,ax
mov bx,0
cli ; Disable interrupts
mov ss,si
mov sp,di
sti ; Enable interrupts
jmp dword ptr cs:[bx] ;*1 entry
loc_124:
mov ah,40h ; '@'
mov bx,2
mov cx,16h
mov dx,cs
mov ds,dx
mov dx,0FCh
int 21h ; DOS Services ah=function 40h
; write file cx=bytes, to ds:dx
mov ax,4CFFh
int 21h ; DOS Services ah=function 4Ch
; terminate with al=return code
db 'Packed file is corrupt'
db 5, 0, 3, 0, 1Eh, 0
db 47h, 0, 52h, 0
db 55h
db 531 dup (0)
crcheck endp
seg_b ends
;--------------------------------------------------------- stack_seg_c ---
stack_seg_c segment para stack
db 128 dup (0)
stack_seg_c ends
end start