假设您已经将一些ascii文本读入长度为255的字符缓冲区。如何检索缓冲区中存储的ascii文本的长度为CX寄存器? (修改)
由于
答案 0 :(得分:2)
使用rep scasb
搜索'$',然后减去以获取距离字符串开头的距离。
; warning: untested code.
mov di, offset buffer
mov al, '$'
mov cx, 255
repnz scasb
sub di, offset buffer
mov cx, di
答案 1 :(得分:1)
; STRLEN
LEA SI,PARA
MOV CX,-1
DO:
LODSB
INC CX
CMP AL,0
JNE DO