VirtualBox

Ignore:
Timestamp:
Oct 28, 2018 5:00:27 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
126206
Message:

IPRT: Make Watcom C an alterntive for compiling the OS/2 kernel code (GA mainly), governed by VBOX_USE_WATCOM_FOR_OS2.

Location:
trunk/src/VBox/Runtime/common/string/watcom
Files:
1 added
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/string/watcom/strcmp.asm

    r75123 r75129  
    11; $Id$
    22;; @file
    3 ; IPRT - No-CRT strcmp - AMD64 & X86.
     3; IPRT - No-CRT strcmp - Watcom register calling convention.
    44;
    55
     
    2727%include "iprt/asmdefs.mac"
    2828
    29 BEGINCODE
     29%define ASM_CALL32_WATCOM
     30%define NAME(name) name %+ _
     31%include "common/string/strcmp.asm"
    3032
    31 ;;
    32 ; @param    psz1   gcc: rdi  msc: rcx  x86:[esp+4]
    33 ; @param    psz2   gcc: rsi  msc: rdx  x86:[esp+8]
    34 RT_NOCRT_BEGINPROC strcmp
    35         ; input
    36 %ifdef RT_ARCH_AMD64
    37  %ifdef ASM_CALL64_MSC
    38   %define psz1 rcx
    39   %define psz2 rdx
    40  %else
    41   %define psz1 rdi
    42   %define psz2 rsi
    43  %endif
    44 %else
    45         mov     ecx, [esp + 4]
    46         mov     edx, [esp + 8]
    47   %define psz1 ecx
    48   %define psz2 edx
    49 %endif
    50 
    51         ;
    52         ; The loop.
    53         ;
    54 .next:
    55         mov     al, [psz1]
    56         mov     ah, [psz2]
    57         cmp     al, ah
    58         jne     .not_equal
    59         test    al, al
    60         jz      .equal
    61 
    62         mov     al, [psz1 + 1]
    63         mov     ah, [psz2 + 1]
    64         cmp     al, ah
    65         jne     .not_equal
    66         test    al, al
    67         jz      .equal
    68 
    69         mov     al, [psz1 + 2]
    70         mov     ah, [psz2 + 2]
    71         cmp     al, ah
    72         jne     .not_equal
    73         test    al, al
    74         jz      .equal
    75 
    76         mov     al, [psz1 + 3]
    77         mov     ah, [psz2 + 3]
    78         cmp     al, ah
    79         jne     .not_equal
    80         test    al, al
    81         jz      .equal
    82 
    83         add     psz1, 4
    84         add     psz2, 4
    85         jmp     .next
    86 
    87 .equal:
    88         xor     eax, eax
    89         ret
    90 
    91 .not_equal:
    92         movzx   ecx, ah
    93         and     eax, 0ffh
    94         sub     eax, ecx
    95         ret
    96 ENDPROC RT_NOCRT(strcmp)
    97 
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette