我是汇编的新手,很抱歉,如果问题很明显。我正在尝试解决一个汇编程序,我需要逐个字符地解析字符串并对字符执行一些操作并将其存储在另一个字符中所以我的问题是如何在nasm程序集中按字符解析字符串。
答案 0 :(得分:3)
做这样的事情:
mov si, <adress of the string in memory>
mov cx, <whatever value tells you how long the string is>
cld ; make sure lodsb walks forward, not back (that'd be std then)
again:
lodsb ; get next char to AL and increase SI
;
; <al contains each char of string here, one by one>
;
dec cx
jnz again ; same as "loop", but not so small