Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设您已将一些 ascii 文本读入长度为 255 的字符缓冲区。如何将存储在缓冲区中的 ascii 文本的长度检索到 CX 寄存器中?(已编辑)
谢谢
使用 搜索“$” rep scasb,然后减去以获取与字符串开头的距离。
rep scasb
; warning: untested code. mov di, offset buffer mov al, '$' mov cx, 255 repnz scasb sub di, offset buffer mov cx, di
; STRLEN LEA SI,PARA MOV CX,-1 DO: LODSB INC CX CMP AL,0 JNE DO