There is a code on Tasm. It writes that there are 3 words in a line. Tell me how to display the length of a line and why counted only 3 words?
data segment para public "data" mas db 'podschitat kolichestvo slov v zadannom tekste''$' text1 db 'Slov v stroke: $ ' text2 db 'Dlina stroki: $' data ends code segment para public "code" start: assume ds:data,cs:code mov ax,data mov ds,ax lea di,mas mov si,0 l1 : cmp byte ptr [di],0 je l2 inc di inc si jmp l1 l2 : lea di,mas mov cx,si mov al,' ' mov bx,0 cld m1: repne scasb jcxz m2 inc bx jmp m1 m2: inc bx mov ah,9 mov dx,offset text1 int 21h add bx,30h mov ax,0200h mov dx,bx int 21h mov ax,4c00h int 21h code ends end start
esregister. But you don’t have tiny (if I understood correctly), therefore, thees:dipair doesn’t point at all to where you want :) And to calculate the length (in this case it doesn’t make sense, it’s already known at the assembly stage) criterion. For example, look for the$character instead of the zero byte. - PinkTux