Inlined assembly and ebx – Intel ARCHITECTURE IA-32 User Manual
Page 546

IA-32 Intel® Architecture Optimization
D-10
Inlined Assembly and ebx
When using aligned frames, the
ebx
register generally should not be
modified in inlined assembly blocks since
ebx
is used to keep track of
the argument block. Programmers may modify
ebx
only if they do not
need to access the arguments and provided they save
ebx
and restore it
before the end of the function (since
esp
is restored relative to
ebx
in the
function’s epilog).
For additional information on the use of
ebx
in inline assembly code and
other related issues, see relevant application notes in the Intel
Architecture Performance Training Center.
CAUTION.
Do not use the
ebx
register in inline
assembly functions that use dynamic stack alignment
for double, __m64, and __m128 local variables unless
you save and restore
ebx
each time you use it. The
Intel C++ Compiler uses the
ebx
register to control
alignment of variables of these types, so the use of
ebx
,
without preserving it, will cause unexpected program
execution.