repo.or.cz
/
idlebox.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
add files
[idlebox.git]
/
count-char.s
blob
0db440a9a1496ba2baa15e3b7ef6f2567ba2ee3f
1
.type count_chars, @function
2
.globl count_chars
3
4
.equ ST_STRING_START_ADDRESS, 8
5
count_chars
:
6
pushl
%
ebp
7
movl
%
esp
, %
ebp
8
9
movl $
0
, %
ecx
10
movl ST_STRING_START_ADDRESS
(%
ebp
), %
edx
11
12
count_loop_begin
:
13
movb
(%
edx
), %
al
14
cmpb $
0
, %
al
15
je count_loop_end
16
incl
%
ecx
17
incl
%
edx
18
jmp count_loop_begin
19
20
count_loop_end
:
21
movl
%
ecx
, %
eax
22
popl
%
ebp
23
ret
24