Находит до 99 символов в строке
data segment
buff db 064h,?,100 dup(?)
count1 db 0ah,0dh,0,'$',0ah,0dh,?,?,'$';48
data ends
code segment
assume ds:data,cs:code
start:
mov ax,data
mov ds,ax
mov es,ax
mov ah,0Ah
lea dx,buff
int 21h
xor ax,ax
dec bx
l1:inc bx
cmp bl,[buff+1]
jae exit1
cmp [buff+bx+2],','
jne l1
inc ax
jmp l1
exit1:
mov [count1+2],al
cmp [count1+2],10
jae graph1
mov ah,09h
add [count1+2],48
mov dx,offset count1
int 21h
mov ax,4c00h
int 21h
graph1:
xor ax,ax
xor bx,bx
mov bx,10
mov al,[count1+2]
div bx
mov [count1+6],al
mov [count1+7],dl
xor ax,ax
xor dx,dx
mov ah,09h
add [count1+6],48
add [count1+7],48
mov dx,offset [count1+4]
int 21h
mov ax,4c00h
int 21h
code ends
end start
|