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

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

?? pathanal.asm

?? 一個朋友寫的操作系統源碼
?? ASM
字號:

;/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; This file will process the whole pathes at one time (batch
; processing) when one transaction has been finished, it will
; ajust the dirp points to the next transaction. the parambuf
; store all the pathes to the Minix files, each path starts
; with '/', end with '$', makes it easy to be recognized by
; eatpath subroutine, the paramnr indicates the number of
; characters remain, the whole subroutine will be terminated
; after it detects paramnr has reached to 0, the eatpath won't
; return until it finished analysising all the path and complete
; all the I/O.
;
; The entry points into this file are
;   nextchar:    get character indicate by dirp pointer
;   eatpath:     scale down verion of UNIX namei(), no paramter
;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++/

include const.inc
include comstruc.inc

sseg segment stack

     db 128 dup (0)

sseg ends

overlap segment para common 'strucinfo'

        ; this is the only way to reference
        ; extern struct

        inodeinfo minixinode <>
        superinfo minixsuper <>
        dent      dirent     <>

overlap ends

dseg segment para public 'global'

     public fulstr

     extrn   prom:byte
     extrn   dbuf:byte
     extrn   zonespace:byte
     extrn   dirp:word            ; path charcter indicator
     extrn   parambuf:byte
     extrn   paramnr:byte
     extrn   fn:word              ; files have been processed
     extrn   newline:byte         ; line return

     fulstr    equ this byte
     fulpath   db   126 dup (0)   ; display buf
               db   '$'           ; protect run out
     swtch     db   0             ; switch off
     startp    dw   0             ; display buf pointer

     illegmes  db   'illegal path component encounted %s','$'
;    sucessmes db   '%s has been converted','$'
     sucessmes db   'converting file %s ... ','$'
     errpath   db   'error path component %s','$'

     ;debug

     entrynr   db   '%d entries left','$'

dseg ends

cseg segment para public 'code'

     assume cs:cseg,ds:dseg,es:dseg,ss:sseg

     public nextchar,eatpath

     extrn  printf:near
     extrn  getinode:near
     extrn  getzone:near
     extrn  bmap:near
     extrn  wrtfile:near
     

;/============================================================================
;
;                             nextchar
;
;============================================================================/

     nextchar proc near

     push si
     push di
     push ds
     push es
     push bp
     mov bp,sp

     mov si,[dirp]           ; dirp was initiated by eatpath
     xor ax,ax
     mov al,[si]             ; fetch character to al
     inc word ptr [dirp]     ; *dirp++

     ; we can't use ax any more because it
     ; already contain the return value   

     dec word ptr [paramnr]  ; first side effect

     ; startp was initiate by eatpath

     cmp word ptr [swtch],0
     je noeffect             ; second side effect was controlled by swtch
     mov di,[dirp]
     dec di                  ; synchronous with nextchar subroutine
     mov si,[di]
     mov di,[startp]
     mov [di],si
     inc word ptr [startp]   ; *startp++ = *[dir-1]++

     ; if path analysis failed in the inner component, it is
     ; the caller's responsibility to move back one char
     ; of startp pointer finally add '$' at tail

noeffect:

     mov sp,bp
     pop bp
     pop es
     pop ds
     pop di
     pop si
     ret

     nextchar endp

;/============================================================================
;
;                             eatpath
;
;============================================================================/

     eatpath proc near

     push ds
     push es
     push bp
     mov bp,sp

     sub sp,8                ; alloc variables

;     mov ax,offset fulpath
;     mov [startp],ax         ; startp initialize

     mov ax,offset parambuf
     mov [dirp],ax           ; dirp will be initialized first

     ; each time we start from root directory

w1loop:

     mov ax,offset fulpath
     mov [startp],ax         ; startp initialize

     mov ax,1                ; get root directory inode
     push ax
     call getinode
     pop ax

     call nextchar
     mov [bp-4],al           ; save char
     cmp al,47               ; '/'
     je w2loop

     ; debug

     cmp al,35               ; '#'
     jne w1loop

;    cmp word ptr [paramnr],0
;    ja w1loop               ; until '/' has been found
     mov ax,[fn]             ; how many files have been processed
     push ax
     mov ax,offset prom      ; printf(%d files have been converted!','$',fn)
     push ax
     call printf
     pop cx
     pop cx
     mov sp,bp
     pop bp
     pop es
     pop ds
     ret                     ; eatpath end here
w2loop:                      ; while((c = nextchar()) != '$')
     call nextchar
     mov [bp-4],al
     cmp al,36               ; '$'

     ; debug

     je w1loop               ; process next path
cloop:

     ; al can't be used again
     ; so fetch the char from stack
     ; guarantee the consistence

     mov ax,[bp-4]
     cmp al,'$'
     jne enext1

     mov ax,offset fulstr
     push ax
     mov ax,offset sucessmes
     push ax
     call printf
     pop cx
     pop cx

     mov ax,offset newline
     push ax
     call printf
     pop cx

     call wrtfile

     ; no parameter, use the side effect of eatpath
     ; it increases fn depending on the success of
     ; DOS file I/O

;    mov ax,offset fulstr
;    push ax
;    mov ax,offset sucessmes
;    push ax
;    call printf
;    pop cx
;    pop cx

;    mov ax,offset newline
;    push ax
;    call printf
;    pop cx

     dec word ptr [dirp]

     jmp w1loop             ; try to find next path

     ; no need to ajust display string
     ; we guarantee it is all right

enext1:

     ; if there's another component, the inodeinfo
     ; structure should contain the information of
     ; a directory inode, we need to change the data
     ; segment to access this information

     push ds                ; save original value
     mov ax,overlap
     mov ds,ax
     assume ds:overlap
     mov ax,[inodeinfo.i_mode]
     pop ds
     assume ds:dseg         ; restore data segment

     and ax,I_TYPE          ; determine inode type
     cmp ax,I_DIRECTORY
     je enext2
     dec word ptr [dirp]
     dec word ptr [dirp]

     dec word ptr [startp]
     dec word ptr [startp]

     mov si,[startp]
     mov byte ptr [si],36            ; '$' indicates the end of fulstr

     mov ax,offset fulstr
     push ax
     mov ax,offset illegmes
     push ax
     call printf            ; illegal path component encounted
     pop cx
     pop cx
     mov ax,offset newline
     push ax
     call printf            ; line return
     pop cx                 

     jmp w2loop             ; without increase fn
enext2:

     ; gather up name into
     ; dir buffer allocate in global data segment

     mov ax,offset dbuf
     mov [bp-6],ax          ; cp = &dbuf

     ; path component > 14 byte will be truncated

w3loop:

     ; nextchar subroutine will generate second
     ; side effect if the swtch is on

     mov byte ptr [swtch],1 ; let startp pointer stepping
     mov ax,[bp-4]
     cmp al,47              ; '/'
     je w4loop
     cmp al,36              ; '$'
     je w4loop
     mov ax,offset dbuf
     add ax,14
     cmp ax,[bp-6]
     jbe enext3
     mov ax,[bp-4]
     mov si,[bp-6]
     mov [si],ax
     inc word ptr [bp-6]    ; *cp++ = c
enext3:
     call nextchar
     mov [bp-4],ax
     jmp w3loop
w4loop:
     mov ax,[bp-6]
     mov bx,offset dbuf
     add bx,14
     cmp ax,bx
     jnb enext4
     mov si,[bp-6]
     mov byte ptr [si],0   ; feed gap
     inc word ptr [bp-6];  ; *cp++ = 0
     jmp w4loop
enext4:

     ; can't call nextchar bindly
     ; only [bp-4] == '/'
     ; this can be called

     mov ax,[bp-4]
     cmp al,47             ; '/'
     jne enext42

     call nextchar
     mov [bp-4],ax         ; skip '/'
enext42:
     mov byte ptr [swtch],0           ; stop startp pointer stepping

     ; we use [bp-2] (16bit) as directory offset
     ; we haven't seen any directory has 4096 entries

     mov word ptr [bp-2],0          ; search from here

     ; we will determine how many entries
     ; a directory holds, then we can know
     ; how to search that, we use a spurious
     ; address symbol i_size to indicate
     ; that we only use lower 16bit, to fetch
     ; this information, we also need to change
     ; data segment

     push ds               ; save original value
     mov ax,overlap
     mov ds,ax
     assume ds:overlap
     mov ax,[inodeinfo.i_size]
     pop ds
     assume ds:dseg        ; restore data segment

     xor dx,dx
     mov bx,16
     div bx
     mov [bp-8],ax         ; assign entry count

eloop:
     mov ax,[bp-8]

     ;debug

     push ax
     mov ax,offset entrynr 
     push ax
     call printf
     pop cx
     pop cx

     mov ax,offset newline
     push ax
     call printf
     pop cx
     mov ax,[bp-8]

     cmp ax,0              ; if the dir has been searched out
     jne enext5

     dec word ptr [dirp]
     dec word ptr [startp]
     mov si,[startp]
     mov byte ptr [si],36  ; '$'

     ; end of fulstr

     mov ax,offset fulstr
     push ax
     mov ax,offset errpath
     push ax
     call printf
     pop cx
     pop cx

     mov ax,offset newline
     push ax
     call printf
     pop cx

     jmp w1loop            ; no entry matchs just to find next path
enext5:

     ; if offset is on a block boundary
     ; read the next directory block

     mov ax,[bp-2]
     and ax,3ffh           ; 1 zone = 1 blk = 1024 byte
     cmp ax,0
     jne enext6            ; within current dir zone
     mov ax,[bp-2]
     xor dx,dx
     mov bx,1024
     div bx                ; calculate logic zone #
     push ax
     call bmap             ; convert logic to physical
     pop cx
     push ax               ; zone # to be read
     call getzone
     pop cx
enext6:

     ; string compare the directory entry
     ; and the current component
     ; if they do not match
     ; go back to eloop

     mov ax,[bp-2]
     and ax,3ffh           ; we want zone offset
     add ax,offset zonespace
     mov si,ax

     ; change es segment to address dent

     push es
     mov ax,overlap
     mov es,ax
     assume es:overlap

     mov di,offset dent
     mov cx,16
     cld
     repnz movsb
     pop es
     assume es:dseg

     mov ax,[bp-2]
     add ax,16             ; stepping
     mov [bp-2],ax         ; write back
     mov ax,[bp-8]
     dec ax
     mov [bp-8],ax

     push ds
     mov ax,overlap
     mov ds,ax
     assume ds:overlap
     mov ax,[dent.nr_inode]
     pop ds
     assume ds:dseg
     cmp ax,0
     jne enext7
     jmp eloop
enext7:
     mov ax,offset dbuf
     mov [bp-6],ax
w5loop:
     push es
     mov ax,overlap
     mov es,ax
     assume es:overlap
     mov si,offset dbuf
     mov di,offset dent.filename
     cld
     mov cx,14
     repz cmpsb
     jz enext8
     pop es
     assume es:dseg
     jmp eloop            ; get next entry to see
enext8:

     ; here's a component matched in a directory
     ; if ther's more pathname, go back to cloop
     ; other wise return

     pop es
     assume es:dseg
     push ds
     mov ax,overlap
     mov ds,ax
     assume ds:overlap

     mov ax,[dent.nr_inode]
     pop ds
     assume ds:dseg
     push ax              ; inode # to fetch
     call getinode
     pop cx
     jmp cloop

eatpath endp

cseg ends

end

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线观看国产一区二区| 国产大陆a不卡| 欧美人牲a欧美精品| 婷婷丁香久久五月婷婷| 5858s免费视频成人| 午夜欧美一区二区三区在线播放| 欧美嫩在线观看| 蜜乳av一区二区三区| 久久精品一区二区三区不卡牛牛| 岛国精品在线播放| 亚洲三级在线播放| 欧美久久久久中文字幕| 全部av―极品视觉盛宴亚洲| 久久综合狠狠综合久久激情| 成人深夜福利app| 一个色综合av| 日韩欧美一级片| 成人免费视频网站在线观看| 亚洲高清免费视频| 欧美哺乳videos| 99精品在线观看视频| 天堂成人免费av电影一区| 精品少妇一区二区三区视频免付费| 国产精品亚洲专一区二区三区 | 日韩午夜小视频| 国产麻豆精品一区二区| 亚洲色图欧洲色图| 日韩欧美视频一区| 成人国产一区二区三区精品| 亚洲国产一二三| 久久久久久久久久久久久久久99 | 538在线一区二区精品国产| 精品一区二区三区视频在线观看| 国产精品久久久久久久第一福利| 欧美日韩不卡在线| 丁香激情综合国产| 日本午夜精品视频在线观看| 日韩久久一区二区| ww亚洲ww在线观看国产| 色狠狠av一区二区三区| 国产精品亚洲成人| 青青草国产成人av片免费| 中文字幕一区二区三区在线不卡 | 日韩亚洲欧美成人一区| 成人久久视频在线观看| 奇米影视一区二区三区| 亚洲人成7777| 久久久亚洲精华液精华液精华液| 欧美色图第一页| 99精品久久久久久| 国产一区三区三区| 日本欧美加勒比视频| 亚洲欧美激情视频在线观看一区二区三区 | 亚洲欧美偷拍卡通变态| 精品国产乱码久久久久久久久| 色88888久久久久久影院按摩| 国产高清久久久久| 久久99精品久久久久久动态图| 亚洲国产一区视频| 亚洲精选视频免费看| 国产精品第13页| 欧美国产一区在线| 久久精品在线观看| 精品成人一区二区三区| 91精品国产高清一区二区三区蜜臀 | 337p亚洲精品色噜噜噜| 欧洲av一区二区嗯嗯嗯啊| 成人激情免费电影网址| 国产在线一区观看| 韩国精品免费视频| 精品中文字幕一区二区| 麻豆91小视频| 日本不卡免费在线视频| 日韩精品乱码av一区二区| 亚洲午夜免费电影| 一区二区三区 在线观看视频| 欧美激情一二三区| 中文字幕第一区| 国产精品日韩精品欧美在线| 欧美国产成人在线| 国产视频911| 国产精品无码永久免费888| 中文字幕第一区二区| 国产日产欧美一区| 中文字幕va一区二区三区| 国产精品网友自拍| 18成人在线观看| 亚洲美女屁股眼交3| 亚洲欧美福利一区二区| 亚洲另类一区二区| 亚洲国产精品久久久男人的天堂| 午夜视频在线观看一区| 人人爽香蕉精品| 国产在线日韩欧美| 粗大黑人巨茎大战欧美成人| av网站一区二区三区| 91丨porny丨蝌蚪视频| 欧美亚洲一区三区| 欧美一区二区精品久久911| 欧美成人国产一区二区| 国产精品久久久久影院亚瑟 | 一区二区三区加勒比av| 亚洲成人综合视频| 美女高潮久久久| 成人视屏免费看| 欧美三级中文字幕| 日韩精品中文字幕在线一区| 欧美激情一区三区| 亚洲一区二区在线视频| 另类调教123区 | 国内一区二区视频| 91在线观看污| 在线91免费看| 中文幕一区二区三区久久蜜桃| 一区二区成人在线观看| 免费人成在线不卡| 波多野结衣中文字幕一区二区三区| 在线一区二区观看| 欧美成人a视频| 亚洲免费在线观看视频| 久久69国产一区二区蜜臀| 成人美女在线视频| 91精品一区二区三区久久久久久| 国产日韩精品视频一区| 亚洲国产日产av| 国产91综合一区在线观看| 欧美日韩一区二区欧美激情| 国产婷婷一区二区| 婷婷久久综合九色综合绿巨人| 国产成人免费视频精品含羞草妖精| 欧美女孩性生活视频| 国产欧美日韩在线| 青青草精品视频| 欧美中文字幕一二三区视频| 国产亚洲精久久久久久| 三级精品在线观看| 色屁屁一区二区| 国产欧美一区二区在线观看| 日本成人在线不卡视频| 91在线精品一区二区| 久久久www成人免费无遮挡大片| 亚洲国产精品久久久男人的天堂| 成人免费福利片| 久久蜜臀中文字幕| 日韩影院免费视频| 欧洲av一区二区嗯嗯嗯啊| 中文字幕第一区| 国产最新精品精品你懂的| 欧美日韩一级黄| 一区二区理论电影在线观看| 成人免费福利片| 国产日韩精品一区二区三区| 另类中文字幕网| 欧美老女人在线| 亚洲国产精品一区二区久久恐怖片 | 欧美国产日韩a欧美在线观看| 免费在线看成人av| 7777精品伊人久久久大香线蕉超级流畅 | 美女免费视频一区| 欧美丰满嫩嫩电影| 亚洲国产精品久久人人爱| 色综合久久中文字幕| 亚洲视频每日更新| 不卡电影一区二区三区| 国产精品污污网站在线观看| 国v精品久久久网| 国产欧美一区二区精品久导航| 精品影院一区二区久久久| 欧美成人乱码一区二区三区| 久99久精品视频免费观看| 日韩一区二区精品在线观看| 日韩国产欧美在线观看| 欧美久久久久久久久| 视频在线在亚洲| 3751色影院一区二区三区| 蜜臀va亚洲va欧美va天堂| 欧美一区二区视频免费观看| 久久精品国产精品青草| 日韩欧美国产一区二区在线播放| 蜜桃精品视频在线观看| 精品国产乱码久久久久久久久| 精品亚洲成a人| 国产日韩亚洲欧美综合| 91免费在线视频观看| 亚洲综合男人的天堂| 欧美绝品在线观看成人午夜影视| 视频一区视频二区中文| 日韩一区二区三区在线| 国产精品99久久久久久宅男| 国产精品美女久久久久高潮| 色呦呦网站一区| 视频在线观看一区| 欧美xxx久久| 成人av中文字幕| 亚洲一区二区偷拍精品| 欧美成人一区二区三区在线观看| 国产成人精品午夜视频免费| 夜夜爽夜夜爽精品视频| 欧美一区三区四区| 国产成人在线电影|