Get the latest tech news

Writing string.h functions using string instructions in asm x86-64 (2025)


Introduction The C standard library offers a bunch of functions (whose declarations can be found in the string.h header) to manage NULL-terminated strings and arrays. These are some of the most used C functions, often implemented as builtin by the C compiler, as they are crucial to the speed of programs. On the other hand, the x86 architecture contains “string instructions”, aimed at implementing operations on strings at the hardware level. Moreover, the x86 architecture was incrementally enhanced with SIMD instructions over the years, allowing for the processing of multiple bytes of data in a single instruction.

None

Get the Android app

Or read this on Hacker News

Read more on:

Photo of x86

x86

Photo of ASM

ASM

Photo of string.h functions

string.h functions

Related news:

News photo

SPF/PC v4 for MS-DOS, FreeDOS, x86

News photo

Never Bet Against x86

News photo

ASM’s Sales Outlook Beats Estimates as China Demand Rebounds