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

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

?? strncpy.asm

?? C語言庫函數的原型,有用的拿去
?? ASM
字號:
        page    ,132
        title   strncpy - copy at most n characters of string
;***
;strncpy.asm - copy at most n characters of string
;
;       Copyright (c) Microsoft Corporation. All rights reserved.
;
;Purpose:
;       defines strncpy() - copy at most n characters of string
;
;*******************************************************************************

        .xlist
        include cruntime.inc
        .list

page
;***
;char *strncpy(dest, source, count) - copy at most n characters
;
;Purpose:
;       Copies count characters from the source string to the
;       destination.  If count is less than the length of source,
;       NO NULL CHARACTER is put onto the end of the copied string.
;       If count is greater than the length of sources, dest is padded
;       with null characters to length count.
;
;       Algorithm:
;       char *
;       strncpy (dest, source, count)
;       char *dest, *source;
;       unsigned count;
;       {
;         char *start = dest;
;
;         while (count && (*dest++ = *source++))
;             count--;
;         if (count)
;             while (--count)
;                 *dest++ = '\0';
;         return(start);
;       }
;
;Entry:
;       char *dest     - pointer to spot to copy source, enough space
;                        is assumed.
;       char *source   - source string for copy
;       unsigned count - characters to copy
;
;Exit:
;       returns dest, with the character copied there.
;
;Uses:
;
;Exceptions:
;
;*******************************************************************************

        CODESEG

        public  strncpy
strncpy proc \
        dest:ptr byte, \
        source:ptr byte, \
        count:dword

        OPTION PROLOGUE:NONE, EPILOGUE:NONE

        .FPO    ( 0, 3, 0, 0, 0, 0 )

        mov     ecx,[esp + 0ch]     ; ecx = count
        push    edi                 ; preserve edi
        test    ecx,ecx
        jz      finish              ; leave if count is zero

        push    esi                 ; preserve edi
        push    ebx                 ; preserve ebx
        mov     ebx,ecx             ; store count for tail loop
        mov     esi,[esp + 14h]     ; esi -> source string
        test    esi,3               ; test if source string is aligned on 32 bits
        mov     edi,[esp + 10h]     ; edi -> dest string
        jnz     short src_misaligned    ; (almost always source is aligned)

        shr     ecx,2               ; convert ecx to dword count
        jnz     main_loop_entrance
        jmp     short copy_tail_loop    ; 0 < count < 4

; simple byte loop until string is aligned

src_misaligned:
        mov     al,byte ptr [esi]   ; copy a byte from source to dest
        add     esi,1
        mov     [edi],al
        add     edi,1
        sub     ecx,1
        jz      fill_tail_end1      ; if count == 0, leave
        test    al,al               ; was last copied byte zero?
        jz      short align_dest    ; if so, go align dest and pad it out
                                    ; with zeros
        test    esi,3               ; esi already aligned ?
        jne     short src_misaligned
        mov     ebx,ecx             ; store count for tail loop
        shr     ecx,2
        jnz     short main_loop_entrance

tail_loop_start:
        and     ebx,3               ; ebx = count_before_main_loop%4
        jz      short fill_tail_end1    ; if ebx == 0 then leave without
                                        ; appending a null byte

; while ( EOS (end-of-string) not found and count > 0 ) copy bytes

copy_tail_loop:
        mov     al,byte ptr [esi]   ; load byte from source
        add     esi,1
        mov     [edi],al            ; store byte to dest
        add     edi,1
        test    al,al               ; EOS found?
        je      short fill_tail_zero_bytes  ; '\0' was already copied
        sub     ebx,1
        jnz     copy_tail_loop
fill_tail_end1:
        mov     eax,[esp + 10h]     ; prepare return value
        pop     ebx
        pop     esi
        pop     edi
        ret

; EOS found. Pad with null characters to length count

align_dest:
        test    edi,3               ; dest string aligned?
        jz      dest_align_loop_end
dest_align_loop:
        mov     [edi],al
        add     edi,1
        sub     ecx,1               ; count == 0?
        jz      fill_tail_end       ; if so, finished
        test    edi,3               ; is edi aligned ?
        jnz     dest_align_loop
dest_align_loop_end:
        mov     ebx,ecx             ; ebx > 0
        shr     ecx,2               ; convert ecx to count of dwords
        jnz     fill_dwords_with_EOS
        ; pad tail bytes
finish_loop:                        ; 0 < ebx < 4
        mov     [edi],al
        add     edi,1
fill_tail_zero_bytes:
        sub     ebx,1
        jnz     finish_loop
        pop     ebx
        pop     esi
finish:
        mov     eax,[esp + 8]       ; return in eax pointer to dest string
        pop     edi
        ret

; copy (source) string to (dest). Also look for end of (source) string

main_loop:                          ; edx contains first dword of source string
        mov     [edi],edx           ; store one more dword
        add     edi,4               ; kick dest pointer
        sub     ecx,1
        jz      tail_loop_start

main_loop_entrance:
        mov     edx,7efefeffh
        mov     eax,dword ptr [esi] ; read 4 bytes (dword)
        add     edx,eax
        xor     eax,-1
        xor     eax,edx
        mov     edx,[esi]           ; it's in cache now
        add     esi,4               ; kick dest pointer
        test    eax,81010100h
        je      short main_loop

        ; may have found zero byte in the dword

        test    dl,dl               ; is it byte 0
        je      short byte_0
        test    dh,dh               ; is it byte 1
        je      short byte_1
        test    edx,00ff0000h       ; is it byte 2
        je      short byte_2
        test    edx,0ff000000h      ; is it byte 3
        jne     short main_loop     ; taken if bits 24-30 are clear and bit
                                    ; 31 is set

; a null character was found, so dest needs to be padded out with null chars
; to count length.

        mov     [edi],edx
        jmp     short fill_with_EOS_dwords

byte_2:
        and     edx,0ffffh          ; fill high 2 bytes with 0
        mov     [edi],edx
        jmp     short fill_with_EOS_dwords

byte_1:
        and     edx,0ffh            ; fill high 3 bytes with 0
        mov     [edi],edx
        jmp     short fill_with_EOS_dwords

byte_0:
        xor     edx,edx             ; fill whole dword with 0
        mov     [edi],edx

; End of string was found. Pad out dest string with dwords of 0

fill_with_EOS_dwords:               ; ecx > 0   (ecx is dword counter)
        add     edi,4
        xor     eax,eax             ; it is instead of ???????????????????
        sub     ecx,1
        jz      fill_tail           ; we filled all dwords

fill_dwords_with_EOS:
        xor     eax,eax
fill_with_EOS_loop:
        mov     [edi],eax
        add     edi,4
        sub     ecx,1
        jnz     short fill_with_EOS_loop
fill_tail:                          ; let's pad tail bytes with zero
        and     ebx,3               ; ebx = ebx % 4
        jnz     finish_loop         ; taken, when there are some tail bytes
fill_tail_end:
        mov     eax,[esp + 10h]
        pop     ebx
        pop     esi
        pop     edi
        ret

strncpy endp
        end



?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品嫩草影院com| 偷拍与自拍一区| 免费精品视频在线| 成人福利在线看| 日韩美女一区二区三区| 亚洲欧美日韩一区| 国产成人福利片| 欧美一区欧美二区| 亚洲综合色自拍一区| 高清国产一区二区| 日韩精品一区二区三区四区| 亚洲自拍欧美精品| 97久久精品人人做人人爽50路| 亚洲精品一区二区三区99| 亚洲午夜私人影院| 色综合久久中文字幕| 中文av字幕一区| 国产精品一卡二| 久久综合色一综合色88| 日本欧美韩国一区三区| 欧美色综合网站| 亚洲电影第三页| 欧美伊人精品成人久久综合97 | 尤物av一区二区| 成人一级片网址| 国产午夜亚洲精品不卡| 久草这里只有精品视频| 欧美一区二区视频观看视频| 亚洲午夜一二三区视频| 欧美撒尿777hd撒尿| 亚洲高清免费观看| 欧美日韩久久一区| 舔着乳尖日韩一区| 日韩三级视频在线看| 精品亚洲porn| 精品电影一区二区| 国产精品综合一区二区三区| 久久综合九色综合97_久久久| 国产真实精品久久二三区| 国产亚洲欧美一区在线观看| 国产精品一卡二卡在线观看| 中文一区在线播放| 成人精品一区二区三区四区| 最新热久久免费视频| 91一区二区三区在线播放| 一区二区三区成人在线视频| 欧美自拍偷拍午夜视频| 日一区二区三区| 精品日韩一区二区三区免费视频| 国产在线一区观看| 亚洲欧洲www| 欧美日韩国产三级| 久久精品国产精品亚洲精品| 久久夜色精品国产欧美乱极品| 国产成人在线观看| 一区二区三区中文字幕在线观看| 久久亚洲二区三区| 成人黄色片在线观看| 亚洲午夜精品在线| 日韩免费视频一区| 91免费看`日韩一区二区| 午夜久久久久久久久久一区二区| 日韩视频一区二区三区在线播放| 国产成人亚洲综合a∨婷婷图片| 亚洲欧美另类久久久精品 | 91国产丝袜在线播放| 亚洲成人高清在线| 久久久国产精品午夜一区ai换脸| 91在线国内视频| 奇米在线7777在线精品| 国产精品久久久久久久久晋中| 欧美午夜精品理论片a级按摩| 国产在线播放一区| 亚洲国产视频一区| 国产亚洲精品bt天堂精选| 在线观看一区不卡| 国产成人午夜99999| 亚洲成人av中文| 亚洲视频免费观看| 久久久美女毛片| 欧美日韩激情一区二区| 成人av在线看| 精品一区二区三区影院在线午夜 | 国产欧美精品区一区二区三区 | 国产一区二区福利| 亚洲自拍偷拍综合| 国产精品视频免费看| 日韩欧美你懂的| 国产色产综合产在线视频| 91久久香蕉国产日韩欧美9色| 国产一区二区三区免费看 | 在线播放欧美女士性生活| 99久久国产综合精品女不卡| 狠狠色狠狠色综合日日91app| 亚洲高清视频在线| 亚洲视频一区在线观看| 日本一区二区三区四区在线视频 | 欧美人xxxx| 91久久精品一区二区三| 成人国产一区二区三区精品| 国产麻豆欧美日韩一区| 精品一区二区三区不卡 | 337p亚洲精品色噜噜噜| 色综合天天综合色综合av| 国产999精品久久| 国产毛片精品国产一区二区三区| 蜜臀av一级做a爰片久久| 视频在线观看91| 婷婷综合五月天| 亚洲成人自拍网| 日韩av不卡在线观看| 亚洲成av人片一区二区三区| 天堂精品中文字幕在线| 亚洲在线中文字幕| 亚洲综合成人网| 亚欧色一区w666天堂| 亚洲mv大片欧洲mv大片精品| 亚洲www啪成人一区二区麻豆| 午夜激情综合网| 天堂蜜桃91精品| 精品一区二区av| 狠狠色2019综合网| 粉嫩13p一区二区三区| 国产成人免费av在线| 福利视频网站一区二区三区| 成人黄动漫网站免费app| 91蜜桃网址入口| 欧美日韩性生活| 日韩免费成人网| 日本一区二区高清| 亚洲一区在线看| 美女任你摸久久| 成人理论电影网| 欧美性欧美巨大黑白大战| 欧美一区二区视频观看视频| 久久久国产精品不卡| 国产精品视频免费| 亚洲一区二区偷拍精品| 免费一级欧美片在线观看| 国产一区二区三区黄视频 | 国产精品一二三区在线| www.成人在线| 欧美日韩一区二区电影| 日韩免费电影一区| 国产精品色呦呦| 亚洲一区欧美一区| 激情伊人五月天久久综合| 不卡电影免费在线播放一区| 色999日韩国产欧美一区二区| 欧美一区二区视频网站| 国产精品欧美极品| 日日欢夜夜爽一区| www.亚洲精品| 制服丝袜激情欧洲亚洲| 中文字幕av一区二区三区免费看| 亚洲bdsm女犯bdsm网站| 国产一区二区看久久| 欧美日韩性生活| 国产精品久久二区二区| 日本中文字幕不卡| 91丨porny丨中文| 精品国免费一区二区三区| 亚洲免费色视频| 国产精品99久久久久久久女警| 欧美在线999| 中文字幕av不卡| 久88久久88久久久| 欧美日韩亚洲综合| 成人欧美一区二区三区1314| 裸体一区二区三区| 91精彩视频在线| 欧美高清在线视频| 激情综合一区二区三区| 欧美三级日本三级少妇99| 欧美国产日产图区| 激情五月播播久久久精品| 9191成人精品久久| 亚洲精品国产a久久久久久| 国产成人午夜电影网| 久久综合狠狠综合久久综合88| 亚洲高清免费观看| 欧洲国内综合视频| 亚洲色欲色欲www| 丁香婷婷综合五月| 久久九九99视频| 国内精品免费**视频| 日韩精品一区二区三区三区免费| 五月天一区二区三区| 在线观看视频一区二区| 亚洲欧美日韩在线| 色婷婷一区二区三区四区| 国产精品狼人久久影院观看方式| 国产一区二区在线观看视频| 精品欧美乱码久久久久久| 偷拍一区二区三区四区| 欧美精品久久99| 日本人妖一区二区| 制服丝袜在线91| 久草精品在线观看| 久久久久久99久久久精品网站|