elks-enhanced
public
Read
Owner: themaster
Branch: master
Commits: 6893
Updated: 2026-04-19 00:15
Git CLI clone URL
git clone https://www.xt-emporium.com/git/elks-enhanced.git
Fullscreen desktop URL
Code
Commits
History
Branches
Bug Reports
Discussions
Compare
Settings
elks-enhanced
/
libc
/
asm
/
strcmp-s.S
File editor
//------------------------------------------------------------------------------ // #include <string.h> // int strcmp(const char *s1, const char *s2) //------------------------------------------------------------------------------ #include <libc-private/call-cvt.h> .arch i8086, nojumps .code16 .text .global strcmp strcmp: push %bp mov %sp,%bp #ifndef __IA16_CALLCVT_REGPARMCALL mov %si,%dx // save SI DI ES -> DX BX CX mov %di,%bx mov %es,%cx mov %ds,%ax mov %ax,%es #else push %si mov %di,%bx mov %es,%cx mov %ds,%si mov %si,%es #endif #ifndef __IA16_CALLCVT_REGPARMCALL mov 4+FAR_ADJ_(%bp),%di // s1 mov 6+FAR_ADJ_(%bp),%si // s2 #else mov %ax,%di // s1 mov %dx,%si // s2 #endif cld 1: lodsb scasb jne 2f // if bytes different skip out test %al,%al jne 1b // if this byte NUL then strings equal xor %ax,%ax // so return zero jmp 3f 2: cmc sbb %ax,%ax // return correct val (-1,1) orb $1,%al 3: #ifndef __IA16_CALLCVT_REGPARMCALL mov %dx,%si // restore SI DI ES mov %bx,%di mov %cx,%es #else pop %si mov %bx,%di mov %cx,%es #endif pop %bp RET_(2) //------------------------------------------------------------------------------
Commit message
This repository is read-only for this account.
Repository snapshot
Current branch
master
Visibility
public
Your access
Read
Remote
Configured
File activity
View file history