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

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

?? prnusb.asm

?? DOS下的USB驅動源碼,包括UHCI
?? ASM
?? 第 1 頁 / 共 2 頁
字號:
mov cs:urb.nr_of_packets,0
mov cs:urb.int_interval,0
mov cs:urb.error_count,0
mov cs:urb.timeout,0
mov cs:urb.next_urb_off,0
mov cs:urb.next_urb_seg,0

;now call DosUHCI
push cs
pop ds
mov dx,offset cs:urb
int 65h

;read successful?
inc cs:retry_count        ;always inc error counter
cmp cs:retry_count,5      ;already four retries?
jae get_status_err
cmp cs:urb.status,0       ;transaction OK?
je  get_status_ok ;yes
cmp cs:urb.status,88h      ;NAK?
jne get_status_err ;no, different error - exit without retry
jmp repeat_get_status     ;got NAK, retry

get_status_ok:
mov al,byte ptr temp_buffer[0]
mov cs:prtstatus,al

if showflag
mov cl,31 ;"O"
call show
mov cl,al
call show
endif

xor ax,ax ;clear

test cs:prtstatus,00100000b ;paper empty bit
jz test_for_select ;jmp if bit in prtstatus NOT set
mov ax,8009h  ;paper empty
jmp prtstatus_check_done

test_for_select:
test cs:prtstatus,00010000b ;selected bit set = no error
jnz test_for_error ;jmp if bit in prtstatus IS set
mov ax,8002h  ;device not ready
jmp prtstatus_check_done

test_for_error:
test cs:prtstatus,00001000b ;is that bit set = no error! ?
jnz prtstatus_check_done ;jmp if bit in prtstatus IS set
mov ax,800Ah  ;write error

prtstatus_check_done:
clc
mov cs:retry_count,0
pop bx
pop es
ret

get_status_err:
xor ax,ax ;clear
stc
mov cs:retry_count,0
pop bx
pop es
ret

readstatus endp

;**********************************************************
do_check proc near
        ;check if interrupt 65h is set or uninitalized
        ;return dx=1 if installed
        xor dx,dx ;zero = default
        xor ax,ax
        mov es,ax ;set to zero
        mov bx,es:194h ;read offset into bx
        mov ax,es:196h ;read segment
        mov es,ax      ;segment in es
        mov     ax,es  ;test if 0:0 vector -> no driver
        or      ax,bx
        jz      not_loaded
        mov     ax,es:[bx]
        cmp     al,0CFh ;IRET?
        je      not_loaded
        mov dx,1 ;installed
not_loaded:

ret
do_check endp
;***************************************************************************
read_commandline proc near
;determine length of command line first
        ;rh0_bpb_tbo     dw      ?       ;offset address of pointer
        ;rh0_bpb_tbs     dw      ?       ;segment address of pointer 
        cld
        push es
        mov di,es:[bx].rh0_bpb_tbo  ;position of command_string
        mov cx,es:[bx].rh0_bpb_tbs  ;segment
        mov es,cx
        mov al,0Dh  ;CR
        xor cx,cx
        mov cl,80   ;read 80 max
 repne  scasb
        pop es
        mov dx,di
        sub dx,es:[bx].rh0_bpb_tbo
        ;check if valid length read
        cmp dx,0
        ja chl0
        jmp read_commandline_done
chl0:
        cmp dx,80
        jb chl1
        jmp read_commandline_done
chl1:
        cld
        push es
        mov di,es:[bx].rh0_bpb_tbo  ;position of command_string
        mov cx,es:[bx].rh0_bpb_tbs  ;segment
        mov es,cx
        mov al,'/' 
        xor cx,cx
        mov cl,dl ;length in dx
 repne  scasb
        cmp cx,0 ;not found?
        jne nc0f ;jmp if found
        pop es   ;therefore no jcxz
        jmp nextcommand1  ;not found
nc0f:
        mov ax,es:[di] ;now read that byte
        cmp al,45h ;E?
        jne nc0a
        mov ax,es:[di+1] ;read endpoint number
        sub ax,30h ;just one number max 9
        mov cs:endpointnr,al
        jmp nc0b
nc0a:
        cmp al,44h ;D?
        jne nc0b
        mov ax,es:[di+1] ;read device number
        sub ax,30h ;just one number max 9
        mov cs:devicenr,al
nc0b:
        pop es
        ;now test for next command
nextcommand1:
        cld
        push es
        ;leave di and continue there
        ;mov di,es:[bx].rh0_bpb_tbo  ;position of command_string
        mov cx,es:[bx].rh0_bpb_tbs  ;segment
        mov es,cx
        mov al,'/' 
        xor cx,cx
        mov cl,dl ;length 
 repne  scasb
        cmp cx,0 ;not found?
        jne nc1f ;jmp if found
        pop es   ;therefore no jcxz
        jmp nextcommand2  ;not found
nc1f:
        mov ax,es:[di] ;now read that byte
        cmp al,45h ;E?
        jne nc1a
        mov ax,es:[di+1] ;read endpoint number
        sub ax,30h ;just one number max 9
        mov cs:endpointnr,al
        jmp nc1b
nc1a:
        cmp al,44h ;D?
        jne nc1b
        mov ax,es:[di+1] ;read device number
        sub ax,30h ;just one number max 9
        mov cs:devicenr,al
nc1b:
        pop es
        ;now test for next command
nextcommand2:

;check if values read ok
cmp devicenr,0
ja dnext1      ;ok
mov devicenr,1 ;default
dnext1:
cmp devicenr,10
jb dnext2      ;ok
mov devicenr,1 ;default
dnext2:
cmp endpointnr,0
ja enext1        ;ok
mov endpointnr,2 ;default
enext1:
cmp endpointnr,10
jb enext2        ;ok
mov endpointnr,2 ;default
enext2:
read_commandline_done:

ret
read_commandline endp

;******************************************************
show proc near ;show number in cl
	      ;pusha                 ; Register sichern
	      push  di
	      push  ax
	      push  es
	      push  cx
	      push  ax

	      push  0B800h          ; Video-Segment
	      pop   es              ; ES auf Video-RAM
	      mov   di, 450         ; StartOffset
	      xor   ch,ch           ; clear high byte
	      inc showptr
	      inc showptr
	      mov ax,showptr
	      add di,ax

	      cld
	      mov   ax, es:[di]     ; Farbe ermitteln
	      mov   al,cl           ; write number to show
	      add   al,48           ; convert to ascii
	      stosw                 ; write to es:di

	      pop   ax
	      pop   cx
	      pop   es
	      pop   ax
	      pop   di
	      ;popa
ret
show endp

;****************************************************************
;*      DOS COMMAND PROCESSING                                  *
;****************************************************************

;command 0      Initialization  *********************************
Initialization:
        call    read_commandline
        call    initial                 ;display message
        lea     ax,initial              ;set Break Addr. at initial
        mov     es:[bx].rh0_brk_ofs,ax  ;store offset address
        mov     es:[bx].rh0_brk_seg,cs  ;store segment address
        jmp     done                    ;set done status and exit


;command 8      Output  *****************************************
Output:

	mov	cx,es:[bx].rh8_count	;load output count
        jcxz    out_done                ;no bytes to print - leave

        push    cs
        pop     ds   ;set ds to cs

;check if usb driver installed
        push es
        push bx
        call    do_check
        pop bx
        pop es
        cmp dx,1 ;    urb.transaction_token,47h
        je check_ok
        mov     ax,800Ah                ;write error
        mov     cx,0 ;cs:bytes_done
        mov     es:[bx].rh8_count,cx    ;return output count 
	jmp	load_status		;load status & exit

check_ok:

        push es
        push bx
        call readstatus ;find out if printer reports an error first
        pop bx
        pop es
        cmp ax,0
        je out_continue
        ;ax is filled with error return code for DOS

        if showflag
        push es
        push bx
        mov cl,17 ;"A"
        call show
        mov cl,al
        call show
        pop bx
        pop es
        endif

        mov     es:[bx].rh8_count,0     ;return output count 0
        jmp	load_status		;load status & exit

out_continue:
        push    cs
        pop     ds   ;set ds to cs
        push es
        push bx
        call do_out ;now seg/off/bytes read from header in do_out proc
        pop bx
        pop es
        cmp cs:urb.status,0 ;ok?
        je out_done
        ;now return error
        ;ax is filled with error return code for DOS

        if showflag
        push es
        push bx
        mov cl,16 ;"@"
        call show
        mov cl,cs:urb.status
        call show
        pop bx
        pop es
        endif

        mov     cx,cs:bytes_done        ;have to return these
        mov     es:[bx].rh8_count,cx    ;return output count
        jmp	load_status		;load status & exit

out_done:  
        mov     ax,0                    ;no error
	jmp	load_status		;load status & exit

;****************************************************************
;*      ERROR EXIT                                              *
;****************************************************************

isunknown: 
	or	es:[bx].rh_status,8003h	;set error bit and error code
	jmp	done			;set done and exit

;****************************************************************
;*      COMMON EXIT                                             *
;****************************************************************
load_status:
	mov	cx,cs:rh_seg		;restore request header 
	mov	es,cx			; segment to es
	mov	cx,cs:rh_ofs		;restore offset also
	xchg	bx,cx			;switch them
        mov     es:[bx].rh_status,ax    ;return status, ax filled above
        ;mov     es:[bx].rh8_count,cx    ;return output count - leave it
	jmp	done			;set done bit and exit

done:   or      es:[bx].rh_status,0100h ;set done bit

	pop	si			;restore all registers
	pop	di
	pop	dx
	pop	cx
	pop	bx
	pop	ax
	pop	es
	pop	ds
        popf
	ret				;return to DOS

;****************************************************************
;*      END OF PROGRAM                                          *
;****************************************************************

;this procedure is called from the Initialization command and
;is executed only once. We tell DOS that the next available
;memory location (Break Address) is here. This allows DOS to over
;write this code; we save space.

initial	proc	near	;display message on console
	lea	dx,msg1	;message to be displayed
	mov	ah,9	;display
	int	21h	;DOS call

        mov  ah,02          ;
        mov  dl,devicenr    ;
        add  dl,48          ;convert to ascii
        int  21h            ;

        lea     dx,msg2 ;message to be displayed
	mov	ah,9	;display
	int	21h	;DOS call

        mov  ah,02          ;
        mov  dl,endpointnr  ;
        add  dl,48          ;convert to ascii
        int  21h            ;

        lea     dx,crlf ;message to be displayed
	mov	ah,9	;display
	int	21h	;DOS call

	ret		;return to caller
initial	endp

msg1    db      0dh,0ah,"Printer device driver for DosUSB, Version 1.2",0dh,0ah
;        db      "Not supporting GDI or Windows printers!",0dh,0ah
        db      "Device number: $"
msg2    db      " Endpoint number: $"
crlf    db      0dh,0ah,"(can be set with /DX and /EX)",0dh,0ah,0ah,"$"

printer	endp		;end of printer procedure
cseg	ends		;end of cseg segment
	end	begin	;end of program

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产麻豆日韩欧美久久| 麻豆视频观看网址久久| 成人一区二区三区视频在线观看| 欧美色综合天天久久综合精品| 久久美女艺术照精彩视频福利播放 | 国产亚洲欧美在线| 午夜精品福利一区二区蜜股av| 91丝袜呻吟高潮美腿白嫩在线观看| 26uuu久久综合| 国产一区二区三区黄视频| 精品国精品自拍自在线| 老司机午夜精品| 337p粉嫩大胆色噜噜噜噜亚洲| 日韩精品欧美精品| 欧美不卡激情三级在线观看| 激情五月播播久久久精品| 国模少妇一区二区三区| 日韩丝袜情趣美女图片| 在线观看免费一区| 午夜久久久久久电影| 中文字幕一区二区三区在线观看| 欧美精品一级二级三级| 91在线精品一区二区| 国产一区二区在线视频| 五月天婷婷综合| 亚洲激情网站免费观看| 久久久久久黄色| 久久这里只有精品首页| 久久免费精品国产久精品久久久久| 日韩一区二区在线播放| 欧美一区二区视频网站| 日韩欧美成人一区| 26uuu精品一区二区三区四区在线| 日韩精品一区二区三区老鸭窝| 欧美一区二区日韩一区二区| 久久综合成人精品亚洲另类欧美 | 综合在线观看色| 亚洲日本成人在线观看| 亚洲精品高清在线观看| 污片在线观看一区二区| 久久se精品一区精品二区| 国产传媒一区在线| 中文字幕一区不卡| 中文字幕va一区二区三区| 欧美一区二区美女| 91精品国产综合久久精品| 欧美日韩精品一区二区天天拍小说| 成人国产精品免费观看动漫| 国产成人精品一区二区三区网站观看 | 亚洲亚洲人成综合网络| 亚洲免费伊人电影| 亚洲午夜私人影院| 性感美女久久精品| 日韩av一区二区三区四区| 青青草97国产精品免费观看无弹窗版| 日韩1区2区日韩1区2区| 美女在线一区二区| 高清成人免费视频| 一本色道亚洲精品aⅴ| 成人国产视频在线观看| 在线亚洲免费视频| 日韩一级在线观看| 国产三级欧美三级日产三级99| 欧美国产日本韩| 激情欧美日韩一区二区| 欧美日韩国产高清一区| 亚洲欧美国产高清| 午夜精品福利在线| 91久久精品一区二区三区| 国产偷国产偷亚洲高清人白洁| 日韩电影在线一区二区三区| 成人免费视频视频在线观看免费| 日韩视频一区二区三区在线播放| 一区二区高清免费观看影视大全| 福利视频网站一区二区三区| 日韩免费高清av| 欧美日韩国产精品自在自线| 欧美日韩精品二区第二页| 精品久久久久香蕉网| 亚洲欧洲日韩av| 韩国午夜理伦三级不卡影院| 91麻豆精东视频| 国产三级精品在线| 免费在线观看视频一区| 91丨九色丨国产丨porny| 日韩三区在线观看| 亚洲电影激情视频网站| 91视频国产资源| 中文字幕欧美三区| 美女免费视频一区二区| 欧美日韩精品久久久| 中文字幕在线一区| 国产精品99久久久| 久久综合色8888| 老司机午夜精品99久久| 欧美日韩一区二区三区在线| 亚洲欧美韩国综合色| 99久久精品99国产精品| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 91丨porny丨户外露出| 久久久久国产精品人| 日韩高清在线电影| 日韩你懂的在线观看| 蜜臀av性久久久久蜜臀aⅴ四虎| 欧美男人的天堂一二区| 日韩电影网1区2区| 日韩一二三区视频| 久久99精品国产麻豆不卡| 欧美xxxxx牲另类人与| 国产成人精品一区二区三区四区| 国产网站一区二区| 91麻豆国产精品久久| 一区二区三区四区视频精品免费| 欧美性猛交xxxx乱大交退制版| 一二三四社区欧美黄| 3d动漫精品啪啪1区2区免费 | 中文字幕亚洲区| 91久久精品一区二区三| 欧美aa在线视频| 日本一区二区高清| 欧美私人免费视频| 国产精品资源网| 亚洲图片有声小说| 久久综合色天天久久综合图片| 国产成人福利片| 亚洲国产视频一区| 精品久久人人做人人爽| 99久久精品费精品国产一区二区| 亚洲高清免费一级二级三级| 国产欧美日韩一区二区三区在线观看| 成人国产电影网| 日本成人在线不卡视频| 国产精品免费视频一区| 91精品国产色综合久久不卡蜜臀| 国产成人小视频| 九九精品一区二区| 亚洲sss视频在线视频| 一区二区中文字幕在线| 精品免费一区二区三区| 91麻豆精品国产91久久久久| www.日韩大片| 国产成人综合视频| 激情综合网av| 久久精品噜噜噜成人av农村| 亚洲成人一区在线| 伊人色综合久久天天| 1区2区3区国产精品| 国产精品萝li| 亚洲视频在线观看三级| 日韩一区欧美一区| 国产精品久久国产精麻豆99网站| 久久夜色精品国产欧美乱极品| 欧美日韩国产一级片| 欧美精选在线播放| 日韩一级大片在线| 2014亚洲片线观看视频免费| 日韩视频免费观看高清在线视频| 欧美日韩一区二区三区视频| 欧美视频一区在线| 日韩无一区二区| 奇米888四色在线精品| 久久亚洲精精品中文字幕早川悠里 | 欧美日韩五月天| 26uuu成人网一区二区三区| 亚洲福利电影网| 91精品办公室少妇高潮对白| 欧美精品一区二区在线播放 | 欧美精品一区二区在线观看| 亚洲天堂成人在线观看| 国产麻豆视频精品| 欧美一级在线免费| 亚洲不卡在线观看| 欧美色中文字幕| 亚洲欧美日韩中文字幕一区二区三区| 久久66热偷产精品| 欧美精品久久久久久久多人混战| 亚洲日穴在线视频| 91免费国产视频网站| 国产精品女主播在线观看| 成人午夜激情视频| 国产精品久久久久影院| 成人一道本在线| 国产欧美视频在线观看| 久久99精品久久久久婷婷| 在线综合亚洲欧美在线视频| 午夜精品免费在线观看| 欧美精品高清视频| 国产精品电影院| 石原莉奈在线亚洲二区| 91精品一区二区三区久久久久久 | 中文字幕欧美区| 成人短视频下载| 亚洲一级电影视频| 日韩欧美激情在线| 国产精品小仙女| 一区二区三区在线影院| 在线播放国产精品二区一二区四区| 奇米一区二区三区| 欧美激情一区二区在线| 欧美亚洲国产bt|