Changeset 40788 in vbox for trunk/src/VBox/Runtime/common/string
- Timestamp:
- Apr 6, 2012 12:52:33 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 77296
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/string/strncpy.asm
r40783 r40788 1 1 ; $Id$ 2 2 ;; @file 3 ; IPRT - No-CRT str cpy - AMD64 & X86.3 ; IPRT - No-CRT strncpy - AMD64 & X86. 4 4 ; 5 5 6 6 ; 7 ; Copyright (C) 2006-20 07Oracle Corporation7 ; Copyright (C) 2006-2012 Oracle Corporation 8 8 ; 9 9 ; This file is part of VirtualBox Open Source Edition (OSE), as … … 32 32 ; @param pszDst gcc: rdi msc: rcx x86:[esp+4] 33 33 ; @param pszSrc gcc: rsi msc: rdx x86:[esp+8] 34 ; @param cbMax gcc: rdx msc: r8 x86:[esp+12] 34 35 RT_NOCRT_BEGINPROC strcpy 35 36 ; input … … 38 39 %define pszDst rcx 39 40 %define pszSrc rdx 41 %define cbMax r8 40 42 %else 41 43 %define pszDst rdi 42 44 %define pszSrc rsi 45 %define cbMax rdx 43 46 %endif 44 mov r 8, pszDst47 mov r9, pszDst 45 48 %else 46 49 mov ecx, [esp + 4] 47 50 mov edx, [esp + 8] 51 push ebx 52 mov ebx, [esp + 12 + 4] 48 53 %define pszDst ecx 49 54 %define pszSrc edx 55 %define cbMax ebx 50 56 push pszDst 51 57 %endif 52 58 53 59 ; 54 ; The loop.60 ; The rolled out loop. 55 61 ; 56 62 .next: 63 cmp cbMax, 4 64 jb .simple_intro 65 57 66 mov al, [pszSrc] 58 67 mov [pszDst], al … … 77 86 add pszDst, 4 78 87 add pszSrc, 4 88 sub cbMax, 4 79 89 jmp .next 90 91 ; 92 ; Char by char. 93 ; 94 .simple_intro: 95 test cbMax, cbMax 96 jz .done 97 98 .simple_next: 99 mov al, [pszSrc] 100 mov [pszDst], al 101 test al, al 102 jz .done 103 104 dec cbMax 105 jz .done 106 107 inc pszSrc 108 inc pszDst 109 jmp .simple_next 80 110 81 111 .done: 82 112 %ifdef RT_ARCH_AMD64 83 mov rax, r 8113 mov rax, r9 84 114 %else 115 pop ebx 85 116 pop eax 86 117 %endif
Note:
See TracChangeset
for help on using the changeset viewer.