TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: Jasen Betts
from: Pascal Schmidt
date: 2004-04-21 13:57:58
subject: strlen

Hi Jasen! :-)

[glibc's strlen asm part]
 PS>>     : "=c" (cnt)
 PS>>     : "D" (str), "0" (-1), "a" (0)
[...]
 JB> yeah, extremely generic notes... like I didn't know I could call EDI 
 JB> "D" or ECX "c" in the inputs and outputs
fields... I assume the 0
 JB> refers to ECX again.
The operands are numbered, starting with 0. The "0" for the
operand name means "this operand must use the same location, whether a
register or memory, as the operand number 0".

The registers have "funny" names because this is a boundary
between machine-dependant assembler code and machine-independent C code.
The operand specs are supposed to be machine-independent, thus they don't
use the asm names but more generic ones. However, since i386 has so few
registers and almost all of them have some special purposes, the operand
constraints for i386 are very similar to the asm names, just shortened to
one letter.

There is some more information under C Extensions, Constraints. The
subtopic "Machine constraints" lists the special register names
for i386. You need to scroll down a little since other architectures come
first. ;)

Note that I'm referring to the gcc-3.2.3 manual, older or newer version may
have other info.

Ciao
Pascal

--- Msged/LNX 6.1.1
* Origin: By order of the king, the city must empty. (1:153/401.2)
SEEN-BY: 633/267 270
@PATH: 153/401 307 140/1 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.