

;
; �������������������������������������������������������������������������ͻ
; �	This file is generated by The Interactive Disassembler (IDA)	    �
; �	Copyright (c) 2010 by Hex-Rays SA, <support@hex-rays.com>	    �
; �			 Licensed to: Freeware version			    �
; �������������������������������������������������������������������������ͼ
;
; Input	MD5   :	49B45183BFA7EBFAF8C3F19F3E37A6CD

; File Name   :	C:\Users\noalm\source\repos\OpenRakis\bin\floppy\LOGO.EXE
; Format      :	MS-DOS executable (EXE)
; Base Address:	1EDh Range: 1ED0h-132E1h Loaded	length:	130Eh
; Entry	Point :	1ED:0


asciiz macro page,string,zero
irpc c,<string>
db '&c', page
endm
ifnb <zero>
dw zero
endif
endm

.8086
.model large


; Segment type:	Pure code
seg000 segment byte public 'CODE'
assume cs:seg000
assume es:nothing, ss:seg003, ds:nothing



public start
start proc near
mov	ax, seg	dseg
mov	ds, ax
assume ds:dseg
mov	ax, es:2
mov	word_30E0, ax
mov	bx, 8
call	sub_2FC4
mov	ax, 0Ch
mov	si, 8Eh	; '�'
cmp	byte ptr [si], 0
jz	short loc_1EF3
call	sub_2FFD
mov	ax, word_311E

loc_1EF3:
mov	word_30E2, ax
mov	dx, 5Ah	; 'Z'
call	sub_2F2F
cmp	byte ptr [di], 2Eh ; '.'
jz	short loc_1F0E
mov	word ptr [di], 482Eh
mov	word ptr [di+2], 4D4Eh
mov	byte ptr [di+4], 0

loc_1F0E:
mov	ax, 3D00h
int	21h		; DOS -	2+ - OPEN DISK FILE WITH HANDLE
			; DS:DX	-> ASCIZ filename
			; AL = access mode
			; 0 - read
mov	dx, 2Eh	; '.'
jb	short loc_1F31
push	ax
call	sub_2840
call	sub_2EE9
pop	bx
mov	ax, word_30E2
call	sub_2CAE
call	sub_2921
xor	dx, dx
xor	al, al
mov	ah, 4Ch
int	21h		; DOS -	2+ - QUIT WITH EXIT CODE (EXIT)
			; AL = exit code

loc_1F31:
mov	ah, 9
int	21h		; DOS -	PRINT STRING
			; DS:DX	-> string terminated by	"$"
xor	al, al
mov	ah, 4Ch
int	21h		; DOS -	2+ - QUIT WITH EXIT CODE (EXIT)
start endp		; AL = exit code

byte_1F3B db 0
word_1F3C dw 3CAh
byte_1F3E db 0
byte_1F3F db 0
db 900h	dup(0)



sub_2840 proc near
mov	ax, 13h
int	10h		; - VIDEO - SET	VIDEO MODE
			; AL = mode
pushf
sti
mov	ax, 40h	; '@'
mov	es, ax
assume es:nothing
mov	dx, es:63h
add	dl, 6
mov	cs:word_1F3C, dx
mov	bp, 6Ch	; 'l'
in	al, dx
and	al, 8
call	sub_2885
jnb	short loc_2883
call	sub_2885
jnb	short loc_2883
mov	di, si
mov	cs:byte_1F3F, ah
call	sub_2885
jnb	short loc_2883
cmp	si, di
not	cs:byte_1F3E
jnb	short loc_2883
mov	cs:byte_1F3F, ah

loc_2883:
popf
retn
sub_2840 endp




sub_2885 proc near
mov	ah, al
xor	si, si
mov	bx, es:[bp+0]

loc_288D:
inc	si
jnz	short loc_2891
dec	si

loc_2891:
in	al, dx
and	al, 8
cmp	al, ah
jnz	short loc_28A6
push	ax
mov	ax, es:[bp+0]
sub	ax, bx
cmp	ax, 64h	; 'd'
pop	ax
jb	short loc_288D
retn

loc_28A6:
stc
retn
sub_2885 endp


loc_28A8:
push	si
push	ds
push	es
pop	ds
assume ds:nothing
mov	si, dx
pushf
cmp	cs:byte_1F3E, 0
jz	short loc_28C6
mov	dx, cs:word_1F3C

loc_28BC:
in	al, dx
and	al, 8
cmp	al, cs:byte_1F3F
jnz	short loc_28BC

loc_28C6:
cli
mov	dx, 3C8h
mov	al, bl
out	dx, al
jmp	short $+2
jmp	short $+2
jmp	short $+2
jmp	short $+2
inc	dx
mov	ax, cx
add	cx, cx
add	cx, ax
cmp	cs:byte_1F3B, 0
jz	short loc_28EA
db 0F3h, 6Eh, 9Dh, 1Fh,	5Eh, 0C3h

loc_28EA:
lodsb
out	dx, al
loop	loc_28EA
popf
pop	ds
assume ds:dseg
pop	si
retn



sub_28F2 proc near
cmp	bx, 0C8h ; '�'
jb	short loc_28FB
mov	bx, 0C7h ; '�'

loc_28FB:
xchg	bh, bl
mov	di, bx
shr	di, 1
shr	di, 1
add	di, bx
xchg	bh, bl
add	di, dx
retn
sub_28F2 endp




sub_290A proc near
push	ax
push	cx
push	di
push	es
mov	ax, 0A000h
mov	es, ax
assume es:nothing
xor	di, di
mov	cx, 7D00h
xor	ax, ax
rep stosw
pop	es
assume es:nothing
pop	di
pop	cx
pop	ax
retn
sub_290A endp




sub_2921 proc near
push	ds
mov	ax, 0A000h
mov	ds, ax
assume ds:nothing
mov	es, ax
assume es:nothing
xor	si, si
xor	di, di
mov	cx, 0FA00h

loc_2930:
lodsb
cmp	al, 0A0h ; '�'
jnb	short loc_2937
xor	al, al

loc_2937:
stosb
loop	loc_2930
pop	ds
assume ds:dseg
retn
sub_2921 endp

; START	OF FUNCTION CHUNK FOR sub_2A6A

loc_293C:
mov	bp, dx
sub	di, bp
; END OF FUNCTION CHUNK	FOR sub_2A6A
db 81h
byte_2941 db 0C7h
db 40h,	1
; START	OF FUNCTION CHUNK FOR sub_2A6A

loc_2944:
lodsb
or	al, al
js	short loc_2979
mov	cx, ax
xor	ch, ch
inc	cx
sub	bp, cx

loc_2950:
lodsb
or	al, al
jz	short loc_296D
stosb
loop	loc_2950
or	bp, bp
ja	short loc_2944
dec	bx
jnz	short loc_293C

loc_295F:
cld
mov	cs:byte_2941, 0C7h ; '�'
mov	cs:byte_29FF, 0C7h ; '�'
retf

loc_296D:
inc	di
loop	loc_2950
or	bp, bp
ja	short loc_2944
dec	bx
jnz	short loc_293C
jmp	short loc_295F

loc_2979:
mov	cx, 101h
xor	ah, ah
sub	cx, ax
sub	bp, cx
lodsb
or	al, al
jz	short loc_2992
rep stosb
or	bp, bp
ja	short loc_2944
dec	bx
jnz	short loc_293C
jmp	short loc_295F

loc_2992:
add	di, cx
or	bp, bp
ja	short loc_2944
dec	bx
jnz	short loc_293C
jmp	short loc_295F

loc_299D:
mov	bp, dx
add	di, bp
; END OF FUNCTION CHUNK	FOR sub_2A6A
db 81h
byte_29A2 db 0C7h
db 40h,	1
; START	OF FUNCTION CHUNK FOR sub_2A6A

loc_29A5:
mov	al, [si]
inc	si
or	al, al
jz	short loc_29D2
mov	cx, ax
xor	ch, ch
inc	cx
sub	bp, cx

loc_29B3:
mov	al, [si]
inc	si
or	al, al
jz	short loc_29C6
stosb
loop	loc_29B3
or	bp, bp
ja	short loc_29A5
dec	bx
jnz	short loc_299D
jmp	short loc_295F

loc_29C6:
dec	di
loop	loc_29B3
or	bp, bp
ja	short loc_29A5
dec	bx
jnz	short loc_299D
jmp	short loc_295F

loc_29D2:
mov	cx, 101h
xor	ah, ah
sub	cx, ax
sub	bp, cx
mov	al, [si]
inc	si
or	al, al
jz	short loc_29EE
rep stosb
or	bp, bp
ja	short loc_29A5
dec	bx
jnz	short loc_299D
jmp	loc_295F

loc_29EE:
sub	di, cx
or	bp, bp
ja	short loc_29A5
dec	bx
jnz	short loc_299D
jmp	loc_295F

loc_29FA:
mov	bp, dx
sub	di, bp
; END OF FUNCTION CHUNK	FOR sub_2A6A
db 81h
byte_29FF db 0C7h
db 40h,	1
; START	OF FUNCTION CHUNK FOR sub_2A6A

loc_2A02:
lodsb
or	al, al
js	short loc_2A18
mov	cx, ax
xor	ch, ch
inc	cx
sub	bp, cx
rep movsb
ja	short loc_2A02
dec	bx
jnz	short loc_29FA
jmp	loc_295F

loc_2A18:
mov	cx, 101h
xor	ah, ah
sub	cx, ax
sub	bp, cx
lodsb
rep stosb
ja	short loc_2A02
dec	bx
jnz	short loc_29FA
jmp	loc_295F

loc_2A2C:
mov	bp, dx
add	di, bp
; END OF FUNCTION CHUNK	FOR sub_2A6A
db 81h
byte_2A31 db 0C7h
db 40h,	1
; START	OF FUNCTION CHUNK FOR sub_2A6A

loc_2A34:
mov	al, [si]
inc	si
or	al, al
jz	short loc_2A52
mov	cx, ax
xor	ch, ch
inc	cx
sub	bp, cx

loc_2A42:
mov	al, [si]
inc	si
stosb
loop	loc_2A42
or	bp, bp
ja	short loc_2A34
dec	bx
jnz	short loc_2A2C
jmp	loc_295F

loc_2A52:
mov	cx, 101h
xor	ah, ah
sub	cx, ax
sub	bp, cx
mov	al, [si]
inc	si
rep stosb
or	bp, bp
ja	short loc_2A34
dec	bx
jnz	short loc_2A2C
jmp	loc_295F
; END OF FUNCTION CHUNK	FOR sub_2A6A



sub_2A6A proc far

; FUNCTION CHUNK AT 0A6C SIZE 00000004 BYTES
; FUNCTION CHUNK AT 0A74 SIZE 0000005D BYTES
; FUNCTION CHUNK AT 0AD5 SIZE 00000059 BYTES
; FUNCTION CHUNK AT 0B32 SIZE 0000002E BYTES
; FUNCTION CHUNK AT 0B64 SIZE 00000036 BYTES

cmp	ch, 0FEh ; '�'
jnb	short loc_2A70
retf

loc_2A70:
or	di, di
js	short loc_2ACA
mov	bp, di
and	bp, 1FFh
mov	ax, di
call	sub_28F2
mov	bx, cx
xor	bh, bh
cmp	ch, 0FFh
jz	short loc_2AA9
shr	bp, 1
mov	ax, di
jb	short loc_2A9B

loc_2A8E:
mov	cx, bp
mov	di, ax
rep movsw
add	ax, 140h
dec	bx
jnz	short loc_2A8E
retf

loc_2A9B:
mov	cx, bp
mov	di, ax
rep movsw
movsb
add	ax, 140h
dec	bx
jnz	short loc_2A9B
retf

loc_2AA9:
mov	dx, di

loc_2AAB:
mov	cx, bp
mov	di, dx

loc_2AAF:
lodsb
or	al, al
jz	short loc_2ABF
stosb
loop	loc_2AAF
add	dx, 140h
dec	bx
jnz	short loc_2AAB
retf

loc_2ABF:
inc	di
loop	loc_2AAF
add	dx, 140h
dec	bx
jnz	short loc_2AAB
retf

loc_2ACA:
mov	bp, di
and	bp, 1FFh
mov	ax, di
call	sub_28F2
mov	bx, cx
xor	bh, bh
test	ax, 4000h
jnz	short loc_2B0E
test	ax, 2000h
jz	short loc_2B01
mov	cs:byte_2941, 0EFh ; '�'
mov	cs:byte_29FF, 0EFh ; '�'
mov	ah, bl
dec	ah
mov	dh, ah
xor	dl, dl
mov	al, dl
shr	dx, 1
shr	dx, 1
add	di, ax
add	di, dx

loc_2B01:
mov	dx, bp
cmp	ch, 0FFh
jz	short loc_2B0B
jmp	loc_2A02

loc_2B0B:
jmp	loc_2944

loc_2B0E:
test	ax, 2000h
jz	short loc_2B31
mov	cs:byte_29A2, 0EFh ; '�'
mov	cs:byte_2A31, 0EFh ; '�'
mov	ah, bl
dec	ah
mov	dh, ah
xor	dl, dl
mov	al, dl
shr	dx, 1
shr	dx, 1
add	di, ax
add	di, dx

loc_2B31:
add	di, bp
dec	di
std
mov	dx, bp
cmp	ch, 0FFh
jz	short loc_2B3F
jmp	loc_2A34

loc_2B3F:
jmp	loc_29A5
sub_2A6A endp




sub_2B42 proc near
push	ds
mov	ax, 0A000h
mov	es, ax
mov	ds, ax
assume ds:nothing
xor	si, si
mov	di, 140h
mov	dx, 64h	; 'd'

loc_2B52:
mov	cx, 50h	; 'P'

loc_2B55:
lodsw
xchg	al, ah
sub	di, 2
mov	[di], ax
loop	loc_2B55
add	si, 0A0h ; '�'
add	di, 1E0h
dec	dx
jnz	short loc_2B52
xor	si, si
mov	di, 0F8C0h
mov	dx, 64h	; 'd'

loc_2B72:
mov	cx, 0A0h ; '�'
rep movsw
sub	di, 280h
dec	dx
jnz	short loc_2B72
pop	ds
assume ds:dseg
retn
sub_2B42 endp

word_2B80 dw 0
word_2B82 dw 0
word_2B84 dw 0
word_2B86 dw 0
word_2B88 dw 1
word_2B8A dw 0
db 28h,	2 dup(0), 1, 34h, 0, 89h, 0, 1Fh
db 2 dup(0), 0FFh, 80h,	0, 91h,	0, 2Dh,	2 dup(0)
db 1, 0C5h, 0, 22h, 0, 39h, 0, 0C0h, 0FFh
db 0, 0FFh, 2 dup(0), 2Ch, 0, 24h, 0FFh
db 3 dup(0), 0FFh, 50h,	7 dup(0), 2 dup(0FFh)
db 6 dup(0)



sub_2BC4 proc near
call	sub_2B42
mov	si, 0CBCh
mov	ax, cs:[si]
mov	cs:word_2B86, ax
mov	cs:word_2B8A, si
xor	ax, ax
mov	cs:word_2B80, ax
mov	cs:word_2B82, ax
mov	cs:word_2B84, ax
mov	cx, 0FBh ; '�'

loc_2BE7:
push	cx
call	sub_2BF2
pop	cx
call	sub_2F55
loope	loc_2BE7
retn
sub_2BC4 endp




sub_2BF2 proc near
push	ds
push	es
push	cs
push	cs
pop	ds
assume ds:seg000
pop	es
assume es:nothing
cmp	cs:word_2B86, 0
js	short loc_2C2C
mov	di, 160h
mov	si, di
mov	cx, 0F0h ; '�'
mov	dx, cs:word_2B88
mov	ax, dx
shl	ax, 1
add	ax, dx
add	si, ax
sub	cx, ax
rep movsb
mov	cx, dx

loc_2C1B:
call	sub_2C2F
loop	loc_2C1B
mov	dx, 160h
mov	bx, 50h	; 'P'
mov	cx, 50h	; 'P'
call	loc_28A8

loc_2C2C:
pop	es
pop	ds
assume ds:dseg
retn
sub_2BF2 endp




sub_2C2F proc near
mov	si, cs:word_2B8A
dec	cs:word_2B86
jnz	short loc_2C49
add	si, 8
mov	cs:word_2B8A, si
mov	ax, [si]
mov	cs:word_2B86, ax

loc_2C49:
mov	ax, [si+2]
add	ax, cs:word_2B80
mov	cs:word_2B80, ax
shl	al, 1
adc	ah, 0
mov	al, ah
and	al, 3Fh
stosb
mov	ax, [si+4]
add	ax, cs:word_2B82
mov	cs:word_2B82, ax
shl	al, 1
adc	ah, 0
mov	al, ah
and	al, 3Fh
stosb
mov	ax, [si+6]
add	ax, cs:word_2B84
mov	cs:word_2B84, ax
shl	al, 1
adc	ah, 0
mov	al, ah
and	al, 3Fh
stosb
retn
sub_2C2F endp




sub_2C8C proc near
les	di, off_30DC
mov	word ptr dword_30E6, di
mov	word ptr dword_30E6+2, es
mov	cx, es
mov	ax, word_30E0
sub	ax, cx
cmp	ax, 3A02h
jb	short locret_2CAD
call	sub_2F6A
add	di, cx
xor	ax, ax
stosw
clc

locret_2CAD:
retn
sub_2C8C endp




sub_2CAE proc near
mov	word_30E4, ax
call	sub_2C8C
jb	short locret_2D15

loc_2CB6:
call	sub_290A
mov	ax, word_30E4
mov	word_30E2, ax
les	di, off_30DC
mov	word ptr dword_30E6, di
mov	word ptr dword_30E6+2, es
call	sub_2D7D
jz	short locret_2D15
call	sub_2E74
call	sub_2D1C
stc
jz	short locret_2D15
call	sub_2D19
call	sub_2BC4
stc
jnz	short locret_2D15

loc_2CE2:
mov	ax, word_30E2
mov	bp, 0E46h
call	sub_2EBA
stc
jnz	short locret_2D15
cmp	word_30E2, 0
jnz	short loc_2CE2
mov	si, 0EEh ; '�'
lodsw
call	sub_308D
xchg	al, ah
call	sub_308D
cmp	ax, 4C4Fh
jnz	short loc_2D14
lodsw
call	sub_308D
xchg	al, ah
call	sub_308D
cmp	ax, 4F50h
jz	short loc_2CB6

loc_2D14:
clc

locret_2D15:
retn
sub_2CAE endp

call	sub_2BF2



sub_2D19 proc near
call	sub_2D29
sub_2D19 endp




sub_2D1C proc near
call	sub_2D56
jz	short loc_2D22
retn

loc_2D22:
mov	word_30E2, 0
retn
sub_2D1C endp




sub_2D29 proc near
push	ds
lds	si, dword_30E6
add	si, 2
lodsw
mov	di, ax
lodsw
mov	cx, ax
or	cl, cl
jz	short loc_2D54
test	di, 200h
jz	short loc_2D44
call	sub_2D8D

loc_2D44:
lodsw
mov	dx, ax
lodsw
mov	bx, ax
mov	ax, 0A000h
mov	es, ax
assume es:nothing
call	sub_2A6A

loc_2D54:
pop	ds
retn
sub_2D29 endp


sub_2D56 proc near

loc_2D82:
lods	word ptr es:[si]
mov	cx, ax
sub	cx, 2
pop	si
or	ax, ax
retn

push	si
les	si, dword_30E6
assume es:nothing
mov	ax, es:[si]
add	si, ax
mov	ax, si
shr	ax, 1
shr	ax, 1
shr	ax, 1
shr	ax, 1
mov	cx, es
add	ax, cx
mov	es, ax
and	si, 0Fh
mov	word ptr dword_30E6, si
mov	word ptr dword_30E6+2, es
jmp	short loc_2D82
sub_2D56 endp




sub_2D7D proc near
push	si
les	si, dword_30E6
loc_2DB2:
lods    word ptr es:[si]
mov     cx, ax
sub     cx, 2
pop     si
or      ax,ax
retn
sub_2D7D endp




sub_2D8D proc near
and	di, 0FDFFh
push	cx
push	di
mov	ax, seg	seg002
mov	es, ax
assume es:seg002
mov	di, 0
push	di
push	es
call	sub_2DCE
pop	ds
pop	si
pop	di
pop	cx
retn
sub_2D8D endp

push	cx
push	di
push	ds
push	es
pop	ds
assume ds:seg002
mov	dx, di
add	dx, cx
mov	cx, 6
mov	si, di
xor	ax, ax


loc_2DF2:
dec	si
dec	di
rep movsw
cld
mov	si, di
add	si, 2
mov	di, bp
xor	bp, bp

loc_2DD8:
lodsw
mov	cx, ax
sub	si, 5
mov	bp, si
add	di, si
add	di, 20h	; ' '
add	si, cx
dec	si
dec	di
sub	cx, 6
std
shr	cx, 1
jnb	short loc_2DF2
movsb

loc_2DB5:
lodsb
add	ah, al
loop	loc_2DB5
cmp	ah, 0ABh ; '�'
jnz	short loc_2DC9
mov	si, di
lodsw
mov	di, ax
lodsb
or	al, al
jz	short loc_2DD8

loc_2DC9:
stc
pop	ds
assume ds:dseg
pop	di
pop	cx
retn



sub_2DCE proc near
push	cx
push	di
push	ds
add	si, 6
xor	bp, bp
jmp	short loc_2E00


loc_2E00:
shr	bp, 1
jz	short loc_2E09
jnb	short loc_2E11

loc_2E06:
movsb
jmp	short loc_2E00

loc_2E09:
lodsw
mov	bp, ax
stc
rcr	bp, 1
jb	short loc_2E06

loc_2E11:
xor	cx, cx
shr	bp, 1
jnz	short loc_2E1D
lodsw
mov	bp, ax
stc
rcr	bp, 1

loc_2E1D:
jb	short loc_2E4D
shr	bp, 1
jnz	short loc_2E29
lodsw
mov	bp, ax
stc
rcr	bp, 1

loc_2E29:
rcl	cx, 1
shr	bp, 1
jnz	short loc_2E35
lodsw
mov	bp, ax
stc
rcr	bp, 1

loc_2E35:
rcl	cx, 1
lodsb
mov	ah, 0FFh

loc_2E3A:
add	ax, di
xchg	ax, si
mov	bx, ds
mov	dx, es
mov	ds, dx
assume ds:seg002
inc	cx
inc	cx
rep movsb
mov	ds, bx
assume ds:dseg
mov	si, ax
jmp	short loc_2E00

loc_2E4D:
lodsw
mov	cl, al
shr	ax, 1
shr	ax, 1
shr	ax, 1
or	ah, 0E0h
and	cl, 7
jnz	short loc_2E3A
mov	bx, ax
lodsb
mov	cl, al
mov	ax, bx
or	cl, cl
jnz	short loc_2E3A
stc
mov	cx, di
pop	ds
pop	di
add	sp, 2
sub	cx, di
retn
sub_2DCE endp




sub_2E74 proc near
les	si, dword_30E6
assume es:nothing
add	si, 2

loc_2E7B:
lods	word ptr es:[si]
cmp	al, 0FFh
jz	short locret_2E9B
xor	cx, cx
xor	bx, bx
mov	bl, al
mov	cl, ah
mov	dx, si
add	si, cx
add	si, cx
add	si, cx
mov	ax, 1012h
int	10h		; - VIDEO - SET	BLOCK OF DAC REGISTERS (EGA, VGA/MCGA)
			; BX = starting	color register,	CX = number of registers to set
			; ES:DX	-> table of 3*CX bytes where each 3 byte group represents one
			; byte each of red, green and blue (0-63)
call	sub_2E9C
jmp	short loc_2E7B

locret_2E9B:
retn
sub_2E74 endp




sub_2E9C proc near
push	si
push	di
mov	si, dx
mov	di, 70h	; 'p'
add	di, bx
add	di, bx
add	di, bx
mov	ax, cx
shl	cx, 1
add	cx, ax

loc_2EAF:
lods	byte ptr es:[si]
mov	cs:[di], al
inc	di
loop	loc_2EAF
pop	di
pop	si
retn
sub_2E9C endp




sub_2EBA proc near
sti
push	ax
xor	ax, ax
mov	es, ax
assume es:nothing
push	word ptr es:46Ch
call	bp
pop	bx
pop	bp
shr	bp, 1
shr	bp, 1
shr	bp, 1
mov	ax, bp
shr	ax, 1
shr	ax, 1
sub	bp, ax

loc_2ED7:
xor	ax, ax
mov	es, ax
mov	ax, es:46Ch
sub	ax, bx
cmp	ax, bp
jb	short loc_2ED7
call	sub_2F55
retn
sub_2EBA endp




sub_2EE9 proc near
pushf
pushf
xor	ax, ax
push	ax
popf
pushf
pop	ax
popf
and	ax, 0F000h
cmp	ax, 0F000h
jz	short loc_2F09
mov	ax, 7000h
push	ax
popf
pushf
pop	ax
and	ax, 7000h
mov	cs:byte_1F3B, ah

loc_2F09:
popf
retn
sub_2EE9 endp

db 2 dup(0), 52h, 2Eh, 0A1h, 3Bh, 10h, 0Bh
db 0C0h, 75h, 7, 1Eh, 8Eh, 0D8h, 0B8h, 6Ch
db 4, 1Fh, 0BAh, 6Dh, 0E5h, 0F7h, 0E2h,	40h
db 2Eh,	0A3h, 3Bh, 10h,	8Ah, 0C4h, 8Ah,	0E2h
db 23h,	0C3h, 5Ah, 0C3h



sub_2F2F proc near
mov	di, dx

loc_2F31:
mov	al, [di]
cmp	al, 2Eh	; '.'
jz	short locret_2F3E
or	al, al
jz	short locret_2F3E
inc	di
jmp	short loc_2F31

locret_2F3E:
retn
sub_2F2F endp

db 52h,	8Ah, 0D0h, 0B4h, 6, 0CDh, 21h, 5Ah
db 0C3h, 50h, 0B0h, 0Dh, 0E8h, 0F1h, 0FFh
db 0B0h, 0Ah, 0E8h, 0ECh, 0FFh,	58h, 0C3h



sub_2F55 proc near
mov	ah, 1
int	16h		; KEYBOARD - CHECK BUFFER, DO NOT CLEAR
			; Return: ZF clear if character	in buffer
			; AH = scan code, AL = character
			; ZF set if no character in buffer
jz	short locret_2F61
xor	ah, ah
int	16h		; KEYBOARD - READ CHAR FROM BUFFER, WAIT IF EMPTY
			; Return: AH = scan code, AL = character
or	ax, ax

locret_2F61:
retn
sub_2F55 endp

db 50h,	0B8h, 8, 0Ch, 0CDh, 21h, 58h, 0C3h



sub_2F6A proc near
push	ds
mov	ax, es
mov	ds, ax
assume ds:nothing
mov	cx, 8000h
mov	dx, di
mov	ah, 3Fh
int	21h		; DOS -	2+ - READ FROM FILE WITH HANDLE
			; BX = file handle, CX = number	of bytes to read
			; DS:DX	-> buffer
pop	ds
assume ds:dseg
jb	short loc_2F8B
cmp	cx, ax
ja	short loc_2F88
mov	ax, es
add	ax, 800h
mov	es, ax
assume es:nothing
jmp	short sub_2F6A

loc_2F88:
mov	cx, ax
clc

loc_2F8B:
pushf
mov	ah, 3Eh
int	21h		; DOS -	2+ - CLOSE A FILE WITH HANDLE
			; BX = file handle
popf
retn
sub_2F6A endp

db 0B8h, 2, 3Dh, 0CDh, 21h, 72h, 0Ah, 8Bh
db 0D8h, 0B4h, 3Eh, 0CDh, 21h, 0B4h, 41h
db 0CDh, 21h, 51h, 33h,	0C9h, 0B4h, 3Ch
db 0CDh, 21h, 59h, 72h,	0E4h, 8Bh, 0D8h
db 1Eh,	8Ch, 0C0h, 8Eh,	0D8h, 8Bh, 0D6h
db 0B4h, 40h, 0CDh, 21h, 1Fh, 2Bh, 0C1h
db 9Ch,	0B4h, 3Eh, 0CDh, 21h, 9Dh, 0C3h



sub_2FC4 proc near
push	ds
push	es
pop	ds
assume ds:nothing
pop	es
assume es:nothing
cld
mov	si, 80h	; '�'
lodsb
xor	cx, cx
mov	cl, al
jcxz	short loc_2FF7

loc_2FD3:
mov	di, es:[bx]
inc	bx
inc	bx
or	di, di
jz	short loc_2FF7

loc_2FDC:
cmp	byte ptr [si], 20h ; ' '
jnz	short loc_2FE4
inc	si
loop	loc_2FDC

loc_2FE4:
lodsb
cmp	al, 20h	; ' '
jz	short loc_2FF0
cmp	al, 0Dh
jz	short loc_2FF0
stosb
loop	loc_2FE4

loc_2FF0:
xor	al, al
stosb
jcxz	short loc_2FF7
loop	loc_2FD3

loc_2FF7:
mov	ax, seg	dseg
mov	ds, ax
assume ds:dseg
retn
sub_2FC4 endp




sub_2FFD proc near
push	si
push	ds
pop	es
assume es:dseg
mov	di, si

loc_3002:
mov	al, es:[di]
inc	di
cmp	al, 20h	; ' '
jbe	short loc_3014
cmp	al, 61h	; 'a'
jb	short loc_3002
and	al, 0DFh
dec	di
stosb
jmp	short loc_3002

loc_3014:
mov	di, si
mov	cx, 0Ah
mov	al, 48h	; 'H'
repne scasb
jz	short loc_3057
xor	bx, bx
xor	dx, dx
mov	cx, 8

loc_3026:
lodsb
cmp	al, 41h	; 'A'
jb	short loc_3031
cmp	al, 46h	; 'F'
ja	short loc_3031
sub	al, 7

loc_3031:
sub	al, 30h	; '0'
jb	short loc_3085
cmp	al, 10h
jnb	short loc_3085
shl	bx, 1
rcl	dx, 1
mov	bp, bx
mov	di, dx
shl	bx, 1
rcl	dx, 1
shl	bx, 1
rcl	dx, 1
add	bx, bp
adc	dx, di
cbw
add	bx, ax
adc	dx, 0
loop	loc_3026
jmp	short loc_3085

loc_3057:
xor	bx, bx
xor	dx, dx
mov	cx, 8

loc_305E:
lodsb
cmp	al, 41h	; 'A'
jb	short loc_3069
cmp	al, 46h	; 'F'
ja	short loc_3069
sub	al, 7

loc_3069:
sub	al, 30h	; '0'
jb	short loc_3085
cmp	al, 10h
jnb	short loc_3085
shl	bx, 1
rcl	dx, 1
shl	bx, 1
rcl	dx, 1
shl	bx, 1
rcl	dx, 1
shl	bx, 1
rcl	dx, 1
or	bl, al
loop	loc_305E

loc_3085:
mov	ax, bx
pop	di
stosw
mov	ax, dx
stosw
retn
sub_2FFD endp




sub_308D proc near
cmp	al, 61h	; 'a'
jb	short locret_3097
cmp	al, 7Ah	; 'z'
ja	short locret_3097
and	al, 0DFh

locret_3097:
retn
sub_308D endp

seg000 ends


; Segment type:	Pure data
dseg segment para public 'DATA'
assume cs:dseg
;org 8
aZou:
asciiz	0, <Z��>,0
aReadErrorOnSou	db 0Dh,0Ah
db 'Read error on source file',0Dh,0Ah
db '$Error: HNM file not found$',0
align 2
dw seg seg002
off_30DC dd unk_132E0
word_30E0 dw 0
word_30E2 dw 0
word_30E4 dw 0
dword_30E6 dd 0
aLogo db 'LOGO',0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
word_311E dw 0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
db    0
align 4
dseg ends


; Segment type:	Regular
seg002 segment byte public 'UNK'
assume cs:seg002
assume es:nothing, ss:nothing, ds:dseg
db    ?	;
seg002 ends


; Segment type:	Uninitialized
seg003 segment byte stack 'STACK'
assume cs:seg003
assume es:nothing, ss:nothing, ds:dseg
db 100h	dup(?)
seg003 ends


; Segment type:	Zero-length
seg004 segment byte public ''
unk_132E0 label	byte
seg004 ends


end start
