亚洲欧美第一页_禁久久精品乱码_粉嫩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   'loading %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 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

     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| 欧美日韩在线不卡| 亚洲男人的天堂一区二区| 欧美成人精品高清在线播放| 欧美韩国日本不卡| 日韩国产成人精品| 欧美日韩精品系列| zzijzzij亚洲日本少妇熟睡| 亚洲成人动漫在线观看| 欧美高清在线视频| 日韩写真欧美这视频| 欧美影院精品一区| 99免费精品视频| 激情文学综合网| 亚洲3atv精品一区二区三区| 中文字幕一区二区三区视频| www久久精品| 精品国产第一区二区三区观看体验| 中文字幕人成不卡一区| 国产欧美一区二区精品忘忧草| 69堂成人精品免费视频| 欧美裸体一区二区三区| 欧美主播一区二区三区| 在线视频一区二区三区| 色综合久久天天| 色综合一个色综合亚洲| 色欧美片视频在线观看在线视频| 国产不卡视频在线观看| 成人免费不卡视频| 不卡一区二区中文字幕| 99久久久久久99| 欧美在线小视频| 欧美一区二区黄| 久久蜜桃av一区二区天堂| 6080午夜不卡| 久久综合给合久久狠狠狠97色69| 久久久久久一二三区| 国产婷婷一区二区| 亚洲欧美日韩国产另类专区| 伊人性伊人情综合网| 天天综合日日夜夜精品| 国产麻豆精品theporn| 成人午夜精品在线| 在线免费视频一区二区| 日韩精品一区二区三区在线观看| 久久久久久久久99精品| 一区二区三区日韩在线观看| 五月天欧美精品| 成人av免费在线| 欧美日韩美女一区二区| 国产嫩草影院久久久久| 亚洲一区二区三区四区中文字幕| 免费人成精品欧美精品| av男人天堂一区| 欧美一级欧美三级在线观看| 一色桃子久久精品亚洲| 麻豆成人91精品二区三区| 成人av在线一区二区三区| 日韩欧美资源站| 亚洲国产一区在线观看| 波多野结衣在线一区| 日韩欧美国产高清| 天天综合网天天综合色| 9人人澡人人爽人人精品| 久久夜色精品国产噜噜av| 午夜在线成人av| 在线亚洲高清视频| 一区二区视频在线看| 99在线精品观看| 中文字幕第一区| 成人黄色小视频在线观看| 日韩久久免费av| 美国三级日本三级久久99| 欧美日产国产精品| 日韩精品一区第一页| 欧美三级韩国三级日本三斤| 一区二区理论电影在线观看| av一区二区三区| 亚洲人一二三区| 色94色欧美sute亚洲线路二| 亚洲精品国产无天堂网2021 | 国产精品亲子乱子伦xxxx裸| 精品一区二区三区久久久| 精品国产91久久久久久久妲己| 国产精品天天看| 97国产一区二区| 亚洲精品中文字幕在线观看| 欧美日韩高清一区二区不卡| 日韩精品一二三| 精品国产伦一区二区三区观看方式 | 色综合天天综合网天天狠天天| 日韩美女精品在线| 欧美主播一区二区三区| 久久99日本精品| 亚洲私人黄色宅男| 欧美一级精品在线| 色综合久久综合网97色综合| 亚洲精品国产成人久久av盗摄 | 欧美精品一区视频| 美国av一区二区| 国产精品美女一区二区三区 | 成人中文字幕电影| 亚洲尤物视频在线| www激情久久| 91精品国产综合久久小美女| 国产精品911| 日本伊人色综合网| 亚洲精品国产精品乱码不99 | 成人av综合一区| 经典三级视频一区| 亚洲国产aⅴ成人精品无吗| 国产情人综合久久777777| 欧美精品vⅰdeose4hd| 91麻豆福利精品推荐| 国产精品88av| 国产麻豆精品久久一二三| 日本欧美一区二区| 亚洲综合激情另类小说区| 国产精品久久久久永久免费观看| 日韩午夜在线观看视频| 欧美日韩性生活| 欧美中文字幕一区| 日本高清不卡视频| 99热99精品| 欧日韩精品视频| 欧美在线一二三| 精品视频在线视频| 91精品啪在线观看国产60岁| 欧美精品 日韩| 欧美一区二区在线看| 欧美一级片在线| 欧美精品一区二区三区在线| 26uuu精品一区二区| 亚洲精品在线免费观看视频| www久久久久| 国产精品国产成人国产三级| 综合色中文字幕| 亚洲电影在线播放| 麻豆国产精品官网| 高潮精品一区videoshd| 91在线观看成人| 欧美色图12p| 国产日韩视频一区二区三区| 中文在线免费一区三区高中清不卡| 日本一区二区视频在线| 亚洲美女屁股眼交| 久久99精品国产麻豆不卡| 国产精品一区二区黑丝| 91老师国产黑色丝袜在线| 欧美精品三级在线观看| 久久久久久久久久看片| 亚洲黄色录像片| 国产寡妇亲子伦一区二区| 一本色道久久综合亚洲aⅴ蜜桃| 91精品国产综合久久福利| 亚洲国产成人一区二区三区| 亚洲成人777| 91视频一区二区三区| 久久夜色精品国产欧美乱极品| 亚洲国产综合人成综合网站| 国产一区二区精品久久| 日韩一区二区在线看| 亚洲男人的天堂一区二区| 成人爱爱电影网址| 欧美一区二区免费| 亚洲电影第三页| 91网上在线视频| 中文字幕中文字幕中文字幕亚洲无线| 天堂精品中文字幕在线| 欧美三级电影网| 亚洲综合色视频| 欧美性感一区二区三区| 亚洲激情中文1区| 一本久久a久久免费精品不卡| 国产精品麻豆99久久久久久| 国产在线播放一区二区三区| 久久久影视传媒| 国产精品资源站在线| 久久综合久久久久88| 国内精品写真在线观看| 欧美精品一区二区三区四区 | 亚洲欧洲美洲综合色网| 国产一区二区免费视频| 精品国产91亚洲一区二区三区婷婷| 麻豆91精品91久久久的内涵| 91精品免费在线观看| 久久99精品国产.久久久久久| 精品国产免费视频| 成人黄色777网| 艳妇臀荡乳欲伦亚洲一区| 欧美一区二区日韩一区二区| 日韩电影在线一区| 欧美精品一区二区三区在线播放 | 亚洲成年人网站在线观看| 欧美日韩国产另类一区| 青娱乐精品视频| 国产精品久久久久久亚洲毛片| 色诱亚洲精品久久久久久| 免费观看在线综合| 国产精品三级av在线播放|