亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? lzd.asm

?? 匯編源代碼大全
?? ASM
字號:
title	Lempel-Ziv Decompressor
; $Source: /usr/home/dhesi/zoo/RCS/lzd.asm,v $
; $Id: lzd.asm,v 1.3 91/07/07 09:36:23 dhesi Exp $

;Derived from Tom Pfau's public domain assembly code.
;The contents of this file are hereby released to the public domain.
;                                   -- Rahul Dhesi 1988/08/24

UNBUF_IO	equ	1		;use unbuffered I/O

public	_lzd,memflag,docrc

	include	asmconst.ai
	include macros.ai

;Hash table entry
hash_rec	struc
next	dw	?			; prefix code
char	db	?			; suffix char
hash_rec	ends

extrn	_addbfcrc:near			;External C function for CRC

ifdef	UNBUF_IO
extrn	_read:near
extrn	_blockwrite:near
else
extrn	_zooread:near
extrn	_zoowrite:near
endif

;Declare segments
_text	segment byte public 'code'
_text	ends

dgroup	group	_data
	assume ds:dgroup,es:dgroup
_data	segment word public 'data'
extrn	_out_buf_adr:word		;address of C output buffer
extrn	_in_buf_adr:word		;address of C input buffer

memflag		db	0		;Memory allocated?  flag
save_bp		dw	?
save_sp		dw	?

input_handle	dw	?
output_handle	dw	?
hash_seg	dw	?
cur_code	dw	?
old_code	dw	?
in_code		dw	?
free_code	dw	first_free

;Note:  for re-entrancy, following 3 must be re-initialized each time
stack_count	dw	0
nbits		dw	9
max_code	dw	512

fin_char	db	?
k		db	?
masks		dw	1ffh,3ffh,7ffh,0fffh,1fffh

;Note:  for re-entrancy, following 2 must be re-initialized each time
bit_offset	dw	0
output_offset	dw	0
_data	ends

memory	segment para public 'memory'
hash	label	hash_rec
memory	ends

call_index macro
	mov	bp,bx			;bx = bx * 3 (3 byte entries)
	shl	bx,1			;bp = bx
	add	bx,bp			;bx = bx * 2 + bp
	endm

call_write_char macro
	local	wc$1
	mov	di,output_offset	;Get offset in buffer
	cmp	di,outbufsiz		;Full?
	jb	wc$1			;no
	call	write_char_partial
	sub	di,di			;so we add zero in next statement
wc$1:	add	di,[_out_buf_adr]	;di <- buffer address + di
	stosb				;Store char
	inc	output_offset		;Increment number of chars in buffer
	endm

add_code macro
	mov	bx,free_code		;Get new code
	;call	index			;convert to address
	call_index
	push	es			;point to hash table
	mov	es,hash_seg
	mov	al,k			;get suffix char
	mov	es:[bx].char,al		;save it
	mov	ax,old_code		;get prefix code
	mov	es:[bx].next,ax		;save it
	pop	es
	inc	free_code		;set next code
	endm

;Start coding
_text	segment
	assume	cs:_text,ds:dgroup,es:dgroup,ss:nothing

write_char_partial proc	near
	push	cx
	mov	cx,di			;byte count
	call	write_block
	pop	cx
	mov	output_offset,0		;Restore buffer pointer
	ret
write_char_partial endp

_lzd	proc	near

	push	bp			;Standard C entry code
	mov	bp,sp
	push	di
	push	si
	
	push	ds			;Save ds to be sure
	mov	[save_bp],bp		;And bp too!
	mov	bx,ds
	mov	es,bx

;Get two parameters, both integers, that are input file handle and
;output file handle
	mov	ax,[bp+4]
	mov	[input_handle],ax
	mov	ax,[bp+6]
	mov	[output_handle],ax

	call	decompress		;Compress file & get status in AX

	mov	bp,[save_bp]		;Restore bp
	pop	ds
	pop	si			;Standard C return code
	pop	di
	mov	sp,bp
	pop	bp
	ret
_lzd	endp

;Note:  Procedure decompress returns AX=0 for successful decompression and
;	AX=1 for I/O error and AX=2 for malloc failure.  
decompress	proc	near
	mov	[save_sp],sp		;Save SP in case of error return

;Initialize variables -- required for serial re-entrancy
	mov	[nbits],9
	mov	[max_code],512
	mov	[free_code],first_free
	mov	[stack_count],0
	mov	[bit_offset],0
	mov	[output_offset],0

	test	memflag,0ffH		;Memory allocated?
	jnz	gotmem			;If allocated, continue
	malloc	<((maxmax * 3) / 16 + 20)>	;allocate it
	jnc	here1
	jmp	MALLOC_err
here1:
	mov	hash_seg,ax		;Save segment address of mem block
	mov	memflag,0ffh		;Set flag to remind us later
gotmem:

	mov	ax,inbufsiz
	push	ax			;byte count
	push	_in_buf_adr		;buffer address
	push	input_handle		;zoofile
ifdef	UNBUF_IO
	call	_read
else
	call	_zooread
endif
	add	sp,6

	cmp	ax,-1
	jz	IO_err			;I/O error
here2:

l1:	call	read_code		;Get a code
	cmp	ax,eof			;End of file?
	jne	l2			;no
	cmp	output_offset,0		;Data in output buffer?
	je	OK_ret			;no
	mov	cx,[output_offset]	;byte count
	call	write_block		;write block of cx bytes
OK_ret:	
	xor	ax,ax			;Normal return -- decompressed
	ret				;done
IO_err:
	mov	ax,2			;I/O error return 
	mov	sp,[save_sp]		;Restore stack pointer
	ret	

MALLOC_err:
	mov	ax,1			;Malloc error return
	mov	sp,[save_sp]		;Restore stack pointer
	ret

l2:	cmp	ax,clear		;Clear code?
	jne	l7			;no
	call	init_tab		;Initialize table
	call	read_code		;Read next code
	mov	cur_code,ax		;Initialize variables
	mov	old_code,ax
	mov	k,al
	mov	fin_char,al
	mov	al,k
	;call	write_char		;Write character
	call_write_char
	jmp	l1			;Get next code
l7:	mov	cur_code,ax		;Save new code
	mov	in_code,ax
	mov	es,hash_seg		;Point to hash table
	cmp	ax,free_code		;Code in table? (k<w>k<w>k)
	jb	l11			;yes
	mov	ax,old_code		;get previous code
	mov	cur_code,ax		;make current
	mov	al,fin_char		;get old last char
	push	ax			;push it
	inc	stack_count

;old code -- two memory references
;l11:	
;	cmp	cur_code,255		;Code or character?
;	jbe	l15			;Char
;	mov	bx,cur_code		;Convert code to address
;new code -- 0 or 1 memory references
	mov	ax,cur_code
l11:
	;All paths in must have ax containing cur_code
	cmp	ax,255
	jbe	l15
	mov	bx,ax
;end code
	;call	index
	call_index
	mov	al,es:2[bx]		;Get suffix char
	push	ax			;push it
	inc	stack_count
	mov	ax,es:[bx]		;Get prefix code
	mov	cur_code,ax		;Save it
	jmp	l11			;Translate again
l15:	
;old code
;	push	ds			;Restore seg reg
;	pop	es
;new code
	mov	ax,ds			;faster than push/pop
	mov	es,ax
;end code
	mov	ax,cur_code		;Get code
	mov	fin_char,al		;Save as final, k
	mov	k,al
	push	ax			;Push it

;old code
;	inc	stack_count
;	mov	cx,stack_count		;Pop stack
;new code -- slightly faster because INC of memory is slow
	mov	cx,stack_count
	inc	cx
	mov	stack_count,cx
;end code
	jcxz	l18			;If anything there
l17:	pop	ax
	;call	write_char
	call_write_char
	loop	l17

;old code
;l18:	
;	mov	stack_count,cx		;Clear count on stack
;new code -- because stack_count is already zero on earlier "jcxz l18"
	mov	stack_count,cx
l18:
;end code

	;call	add_code		;Add new code to table
	add_code
	mov	ax,in_code		;Save input code
	mov	old_code,ax
	mov	bx,free_code		;Hit table limit?
	cmp	bx,max_code
	jb	l23			;Less means no
	cmp	nbits,maxbits		;Still within maxbits?
	je	l23			;no (next code should be clear)
	inc	nbits			;Increase code size
	shl	max_code,1		;Double max code
l23:	jmp	l1			;Get next code
decompress	endp	

read_code	proc	near

;old code
;	mov	ax,bit_offset		;Get bit offset
;	add	ax,nbits		;Adjust by code size
;	xchg	bit_offset,ax		;Swap
;	mov	dx,ax			;dx <- ax
;new code
	mov	ax,bit_offset
	mov	dx,ax			;dx <- bit_offset
	add	ax,nbits
	mov	bit_offset,ax
	mov	ax,dx
;end code

	shr	ax,1
	shr	ax,1
	shr	ax,1			;ax <- ax div 8
	and	dx,07			;dx <- ax mod 8
	cmp	ax,inbufsiz-3		;Approaching end of buffer?
	jb	rd0			;no
	push	dx			;Save offset in byte
	add	dx,nbits		;Calculate new bit offset
	mov	bit_offset,dx
	mov	cx,inbufsiz
	mov	bp,ax			;save byte offset
	sub	cx,ax			;Calculate bytes left
	add	ax,_in_buf_adr
	mov	si,ax
	mov	di,_in_buf_adr
rep	movsb				;Move last chars down

	push	bp			;byte count
	push	di			;buffer address
	push	input_handle		;zoofile
ifdef	UNBUF_IO
	call _read
else
	call	_zooread
endif
	add	sp,6

	cmp	ax,-1
	jnz	here4
	jmp	IO_err			;I/O error

here4:
	xor	ax,ax			;Clear ax
	pop	dx			;Restore offset in byte
rd0:	
	add	ax,_in_buf_adr
	mov	si,ax
	lodsw				;Get word
	mov	bx,ax			;Save in AX
	lodsb				;Next byte
	mov	cx,dx			;Offset in byte
	jcxz	rd2			;If zero, skip shifts
rd1:	shr	al,1			;Put code in low (code size) bits of BX
	rcr	bx,1
	loop	rd1
rd2:	mov	ax,bx			;put code in ax
	mov	bx,nbits		;mask off unwanted bits
	sub	bx,9
	shl	bx,1
	and	ax,masks[bx]
	ret
read_code	endp

init_tab	proc	near
	mov	nbits,9			;Initialize variables
	mov	max_code,512
	mov	free_code,first_free
	ret
init_tab	endp

comment #
index		proc	near
	mov	bp,bx			;bx = bx * 3 (3 byte entries)
	shl	bx,1			;bp = bx
	add	bx,bp			;bx = bx * 2 + bp
	ret
index		endp
#end comment

docrc	proc	near
;On entry, ax=char count, dx=buffer address.
;Do crc on character count, in buffer.
;****** Update CRC value -- call external C program
	;External program is:	addbfcrc(buffer, count)
	;			char *buffer;
	;			int count;

	push	ax		;SAVE AX
	push	bx		;SAVE BX
	push	cx
	push	dx

	push	ax		;param 2: char count
	push	dx		;param 1: buffer address
	call	_addbfcrc
	add	sp,4		;Restore 2 params from stack

	pop	dx
	pop	cx
	pop	bx		;RESTORE BX
	pop	ax		;RESTORE AX
	ret
docrc	endp

write_block proc near
;Input:  CX=byte count to write
	push	ax
	push	bx
	push	cx
	push	dx
	push	si			;may not be necessary to save si & di
	push	di

	push	cx			;save count

	push	cx			;count
	push	_out_buf_adr		;buffer
	push	output_handle		;zoofile
ifdef	UNBUF_IO
	call	_blockwrite
else
	call	_zoowrite
endif
	add	sp,6

	pop	cx			;restore count

	;ax = actual number of bytes written
	cmp	ax,cx			;all bytes written?
	je	written			;if yes, OK
	jmp	IO_err
written:
	mov	dx,_out_buf_adr
	call	docrc			;do crc on ax bytes in buffer dx
	mov	output_offset,0		;restore buffer ptr to zero

	pop	di
	pop	si
	pop	dx
	pop	cx
	pop	bx
	pop	ax
	ret
write_block endp

_text	ends

	end

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品国产一区二区三区四区在线| 日本精品免费观看高清观看| 这里只有精品电影| 日韩中文字幕区一区有砖一区| 欧美性猛交一区二区三区精品| 一区二区三区精密机械公司| 欧美揉bbbbb揉bbbbb| 男女男精品视频网| 精品电影一区二区| 成人福利视频网站| 亚洲精品菠萝久久久久久久| 欧美久久久久久久久| 久久精品国产一区二区三 | 麻豆久久久久久久| 337p粉嫩大胆色噜噜噜噜亚洲| 国产综合久久久久久鬼色| 日本一区二区综合亚洲| 99国产精品久| 日本系列欧美系列| 欧美激情一区二区三区不卡| 在线影院国内精品| 麻豆精品一区二区三区| 中文字幕免费不卡| 欧美精品久久久久久久多人混战| 韩国女主播一区| 一区二区三区中文在线观看| 欧美成人猛片aaaaaaa| 99久久伊人网影院| 蜜臀av国产精品久久久久| 国产欧美一区二区精品婷婷| 欧美三级视频在线观看| 国产精品一品二品| 五月天久久比比资源色| 日本一区二区高清| 在线综合+亚洲+欧美中文字幕| 国产成人精品一区二| 亚洲高清视频在线| 国产精品美女久久久久久久| 69久久99精品久久久久婷婷| 99视频一区二区| 精品亚洲免费视频| 亚洲第一成年网| 国产精品国产三级国产a| 日韩午夜中文字幕| 在线精品视频一区二区| 国产成人av影院| 日本美女一区二区三区| 亚洲欧美电影一区二区| 国产视频视频一区| 欧美一区二区三区喷汁尤物| 色妞www精品视频| 国产69精品一区二区亚洲孕妇| 喷白浆一区二区| 亚洲18女电影在线观看| 亚洲精品综合在线| 国产精品日日摸夜夜摸av| 精品国免费一区二区三区| 欧美在线一二三| 97精品视频在线观看自产线路二| 国产一区二区看久久| 美女视频一区在线观看| 天天av天天翘天天综合网色鬼国产 | 国产成人综合在线播放| 美女在线一区二区| 亚洲 欧美综合在线网络| 一级女性全黄久久生活片免费| 亚洲国产精品精华液ab| 久久亚洲一区二区三区四区| 欧美成人a视频| 777奇米四色成人影色区| 欧美色爱综合网| 色呦呦一区二区三区| av不卡免费电影| 99在线精品观看| 99久免费精品视频在线观看| www.视频一区| 成人av片在线观看| 成人美女视频在线观看18| 国产精品香蕉一区二区三区| 国产精品中文字幕日韩精品| 美女视频网站久久| 麻豆国产精品视频| 激情都市一区二区| 国产米奇在线777精品观看| 精品一区二区三区蜜桃| 国产精品一品二品| 成人av网站在线| 一本色道久久综合亚洲91| 91丝袜美腿高跟国产极品老师| 91麻豆成人久久精品二区三区| 99久久婷婷国产综合精品电影| 99久久伊人网影院| 欧美私人免费视频| 日韩一区二区电影在线| 精品少妇一区二区三区视频免付费 | 亚洲色图视频网站| 一区二区三区高清在线| 亚洲成年人影院| 激情五月激情综合网| 国产91精品久久久久久久网曝门| www.av精品| 欧美高清激情brazzers| 精品日韩欧美在线| 亚洲欧洲无码一区二区三区| 亚洲高清视频在线| 国产在线视视频有精品| 99在线视频精品| 欧美肥胖老妇做爰| 欧美国产精品一区| 亚洲国产三级在线| 激情都市一区二区| 色综合一区二区| 日韩免费一区二区| 国产精品二区一区二区aⅴ污介绍| 亚洲精品视频一区| 九一久久久久久| av网站一区二区三区| 欧美日韩国产精品成人| 久久精品视频免费| 午夜天堂影视香蕉久久| 国产一区二区在线看| 亚洲国产高清在线| 亚洲成人福利片| 国产精品一二三四区| 欧美亚男人的天堂| 欧美激情在线看| 午夜电影网一区| av亚洲精华国产精华精| 日韩一区二区三区免费看 | 国产一区二区免费看| 欧美性色黄大片| 中文字幕国产精品一区二区| 午夜视频在线观看一区二区| 丰满放荡岳乱妇91ww| 91麻豆精品国产91久久久久久| 国产精品乱人伦| 久久国产成人午夜av影院| 在线观看av一区| 国产精品色眯眯| 国产自产视频一区二区三区| 欧美日韩美少妇| 亚洲激情网站免费观看| 粉嫩高潮美女一区二区三区| 日韩视频永久免费| 五月天中文字幕一区二区| 波多野结衣中文一区| 精品国产一区二区三区四区四 | 久久免费视频色| 日韩福利视频导航| 91免费看`日韩一区二区| 久久久综合网站| 精品无人区卡一卡二卡三乱码免费卡| 欧美性受极品xxxx喷水| 亚洲免费在线播放| 不卡欧美aaaaa| 国产精品高潮久久久久无| 国产在线精品免费av| 精品免费99久久| 美美哒免费高清在线观看视频一区二区 | 日韩午夜精品电影| 亚洲aⅴ怡春院| 欧美久久久久久久久久 | 一区二区三区蜜桃网| 99久久免费视频.com| 国产精品美女久久久久aⅴ | 日韩在线一区二区三区| 欧美人妇做爰xxxⅹ性高电影| 一区二区三区欧美亚洲| 色婷婷综合久久久久中文一区二区 | 亚洲一区二区三区中文字幕在线| 91网址在线看| 亚洲人123区| 91福利视频久久久久| 亚洲最色的网站| 欧美日韩亚洲另类| 免费视频最近日韩| 精品日产卡一卡二卡麻豆| 国产在线播放一区| 中文字幕欧美三区| 色综合一区二区| 亚洲成人精品影院| 日韩精品中文字幕一区二区三区| 奇米精品一区二区三区在线观看| 欧美大片在线观看一区二区| 久久91精品国产91久久小草| 久久久一区二区| av电影天堂一区二区在线观看| 成人免费在线观看入口| 日本道色综合久久| 日韩国产精品久久久久久亚洲| 日韩欧美中文一区| 成人精品高清在线| 亚洲最大成人网4388xx| 日韩一区二区三区在线视频| 国产乱对白刺激视频不卡| 国产精品嫩草99a| 欧美日韩国产综合久久| 精品一区二区三区久久| 亚洲欧美日韩久久精品| 欧美一区二区三区在线观看视频|