-1
이 코드에는 몇 가지 문제점이 있습니다. 연속되는 숫자의 수를 계산해야합니다. 나는 masm 어셈블리 언어를 사용한다. 여기 내 코드입니다 :행의 최대 연속 자릿수 찾기
Extrn OutInt:Far
data segment
string db 100 dup ('$')
string2 db 'Input the string!', 0dh,0ah, '$'
string3 db 'Count - $'
data ends
code segment
assume cs:code,ds:data
start:
mov ax, data
mov ds, ax
mov ah,9
lea dx,string2
int 21h
mov ah,0ah
lea dx,string
int 21h
mov ah,9
lea dx,string3
int 21h
mov si,offset A
mov BX,0
mov DX,0
mov CX,100
looperunda:
lodsb
test AL,10000000b
je nosigno
cmp BX,DX
jnb neatral
mov BX,DX
xor DX,DX
jmp neatral
nosigno:
inc DX
neatral:
loop looperunda
mov ax, 16
Call OutInt
code ends
end start
OutInt :
Title OutInt
CodeSg Segment PARA 'Code'
OutInt Proc FAR
Assume CS:CodeSg
Public OutInt
aam
add ax,3030h
mov dl,ah
mov dh,al
mov ah,02
int 21h
mov dl,dh
int 21h
mov ah, 10h
int 16h
mov ax, 4c00h
int 21h
OutInt endp
CodeSg ENDS
END OutInt
이 프로그램은 그런 식으로 일해야한다 : " 입력 문자열
aa23333c
수 - 4 "
하지만 My c ode는 작동하지 않습니다. 아무도 도와 줄 수 없습니까? 실수는 어디 있습니까?