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
/
string
/
memchr.c
File editor
#include <string.h> #ifdef BCC_ASM #asm mov bx,sp push di push es push ds pop es cld mov di,[bx+2] mov ax,[bx+4] mov cx,[bx+6] test cx,cx je is_z ! Zero length, do not find. repne ! Scan scasb jne is_z ! Not found, ret zero dec di ! Adjust ptr mov ax,di ! return jmp xit is_z: xor ax,ax xit: pop es pop di ret #endif void * memchr(const void * str, int c, size_t l) { unsigned char *p = (unsigned char *)str; while (l-- > 0) { if (*p == c) return p; p++; } return 0; }
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