我正在尝试计算'。'的出现次数。字符,但我的代码不起作用(结果为0,无论有多少个点)。怎么了?
global _main
extern _printf
extern _scanf
section .data
text: db "One. Two, Three, Four. Five.", 0
txtlen: equ $-text
format: db "%d", 0
section .text
_main:
mov al, '.'
mov cx, txtlen
lea di, [text]
xor ebx, ebx
B:
repne scasb
jcxz A
inc ebx
jmp B
A:
push ebx
push format
call _printf
add esp, 8
mov eax, 4C00h
ret
答案 0 :(得分:0)
lea edi, [text]
好。我去了