8086微机原理,统计以$结尾的字符串SPRING的字符个数
1个回答
展开全部
dseg segment
s db 'abcdefghijklmnlop$'
dseg ends
assume cs:cseg, ds:dseg
cseg segment
start:
mov ax, dseg
mov ds, ax
mov bx, 10
mov cx, 0
lea si, s
mov ax, 0
m0:
mov dl,[si]
cmp dl,'$'
jz m1
inc si
inc ax
jmp m0
m1:
xor dx, dx
div bx
xor dx, 0e30h
push dx
inc cx
cmp ax,0
jnz m1
m2:
pop ax
int 10h
loop m2
mov ah,4ch
int 21h
cseg ends
end start
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询