亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
亚洲成av人片一区二区梦乃| 成人激情小说网站| 欧美一区二区在线免费观看| 亚洲制服丝袜在线| 91麻豆精品久久久久蜜臀| 日本成人超碰在线观看| 久久午夜国产精品| 成人app网站| 亚洲亚洲精品在线观看| 7777精品伊人久久久大香线蕉超级流畅 | 中文字幕一区视频| 成人精品鲁一区一区二区| 亚洲黄色片在线观看| 欧美喷潮久久久xxxxx| 日韩av电影免费观看高清完整版 | 色视频成人在线观看免| 亚洲成人7777| 欧美精品一区二区久久婷婷 | 99re这里都是精品| 亚洲国产精品人人做人人爽| 日韩欧美国产精品| 成人影视亚洲图片在线| 亚洲午夜精品网| 精品电影一区二区三区| 91社区在线播放| 日本不卡的三区四区五区| 日本一区二区免费在线观看视频| 日本精品裸体写真集在线观看 | 韩日欧美一区二区三区| 国产精品久久久久久久久免费桃花| 欧美性大战久久久久久久| 国产一区二区中文字幕| 亚洲在线成人精品| 久久久五月婷婷| 欧美美女一区二区在线观看| 成人免费福利片| 日本欧美一区二区在线观看| 最新日韩av在线| 日韩欧美在线1卡| 日本道色综合久久| 国产成人精品免费视频网站| 日韩高清在线不卡| 亚洲色图视频网站| 久久久久久亚洲综合影院红桃| 欧美日韩在线播放| 国产成人av一区| 久久精品久久精品| 亚洲国产中文字幕在线视频综合| 国产精品日韩精品欧美在线| 91精品免费在线| 在线看不卡av| 成人黄色在线视频| 国产精品自在欧美一区| 理论电影国产精品| 亚洲国产日韩a在线播放| 国产精品黄色在线观看| 精品久久久久久久人人人人传媒 | 性欧美疯狂xxxxbbbb| 国产精品美女久久久久久久久| 日韩免费高清av| 欧美日韩不卡一区| 欧美少妇性性性| 色综合久久六月婷婷中文字幕| 日一区二区三区| 国产精品成人一区二区艾草| 欧美变态tickling挠脚心| 欧美日韩二区三区| 欧美主播一区二区三区美女| 91在线视频在线| 丰满放荡岳乱妇91ww| 青青草97国产精品免费观看| 亚洲福利视频一区| 伊人一区二区三区| 亚洲欧美激情插| 久久影院视频免费| 日韩一区二区三区三四区视频在线观看| 99久久伊人精品| 99久久精品国产导航| 91免费国产在线| 一本大道av伊人久久综合| 不卡一区二区三区四区| 国产美女一区二区| 免费成人av在线| 韩国一区二区三区| 国产在线播放一区二区三区| 久久99久久99| 国产suv精品一区二区6| 成人在线一区二区三区| 97se亚洲国产综合自在线不卡| 国产成人在线看| 成人免费高清视频在线观看| 99久久精品国产网站| 91免费在线视频观看| 欧美日韩另类国产亚洲欧美一级| 欧美理论片在线| 欧美变态tickling挠脚心| 欧美精品一区二区三区高清aⅴ| 制服丝袜国产精品| 欧美一区二区在线视频| 精品剧情在线观看| 精品播放一区二区| 国产欧美一区二区三区在线老狼| 国产精品久久夜| 亚洲欧洲一区二区三区| 亚洲一区二区美女| 国内一区二区在线| 成人免费的视频| 欧美日韩第一区日日骚| 国产亚洲欧美一级| 亚洲欧美日韩成人高清在线一区| 日日摸夜夜添夜夜添亚洲女人| 精品一区二区免费视频| 91麻豆国产精品久久| 日韩一区二区在线观看视频 | 欧美日本在线观看| 精品国产精品一区二区夜夜嗨| 中文字幕第一区二区| 亚洲国产视频直播| 亚洲成人av电影在线| 国产盗摄一区二区三区| 欧美性受xxxx黑人xyx| 精品av综合导航| 国产精品毛片久久久久久久| 亚洲一二三四久久| 国产传媒欧美日韩成人| 欧美日韩一区国产| 国产精品欧美一区二区三区| 日日欢夜夜爽一区| av欧美精品.com| 91精品中文字幕一区二区三区| 国产精品久久久久婷婷| 一个色综合网站| 国产成人在线观看| 欧美女孩性生活视频| 中文字幕一区二区三| 久久 天天综合| 欧美日韩激情一区二区| 国产精品国模大尺度视频| 免费视频最近日韩| 欧美日韩在线观看一区二区| 中文av一区二区| 久久99国产精品久久| 欧美日本乱大交xxxxx| 中文字幕一区二区三区精华液| 久久99久久99精品免视看婷婷| 欧洲一区在线电影| 精品国产91乱码一区二区三区| 欧美一区二区精美| 亚洲国产精品久久不卡毛片| 国产揄拍国内精品对白| 在线综合+亚洲+欧美中文字幕| 欧美韩日一区二区三区四区| 久久丁香综合五月国产三级网站| 欧美日韩精品专区| 亚洲少妇最新在线视频| 成人免费观看av| 国产精品免费人成网站| 粉嫩久久99精品久久久久久夜| 26uuu成人网一区二区三区| 奇米亚洲午夜久久精品| 日韩一区二区不卡| 蜜桃精品视频在线观看| 欧美一级片在线看| 五月婷婷色综合| 91.com视频| 日韩高清欧美激情| 欧美电影免费观看高清完整版| 日韩国产欧美在线观看| 884aa四虎影成人精品一区| 香蕉加勒比综合久久| 色狠狠av一区二区三区| 亚洲精品菠萝久久久久久久| 国产精品99久久久| 欧美韩国日本不卡| 国产91精品入口| 亚洲欧美综合在线精品| 99久久久无码国产精品| 亚洲欧美日本韩国| 欧美偷拍一区二区| 手机精品视频在线观看| 91精品婷婷国产综合久久性色| 男人的天堂久久精品| 26uuu精品一区二区三区四区在线| 国产精品一二三区在线| 成人欧美一区二区三区| 欧美最猛性xxxxx直播| 视频一区视频二区在线观看| 日韩欧美区一区二| 国产成人亚洲综合a∨婷婷| 亚洲欧洲精品一区二区精品久久久| 色婷婷激情综合| 奇米综合一区二区三区精品视频 | thepron国产精品| 一区二区三区中文字幕精品精品 | 日本韩国精品在线| 午夜av电影一区| 国产日产欧美一区| 日本福利一区二区| 美女爽到高潮91| 日韩一区中文字幕|