2016-08-06 3 views
0

문자열의 소문자를 대문자로 변환하는 간단한 프로그램을 작성하려고하지만 출력이 전혀 나오지 않습니다.소문자에서 대문자 없음 디스플레이로 표시

입력 : AABB 출력 : 예를 들어 AABB

내 실수이고

는 모르겠지만, 어쨌든 내 코드는 다음과 같습니다

data segment 
prompt db 0dh,0ah,"Your string: $" 
str1 db 15 dup('$') 
msg db 0dh,0ah,"Result after conversion: $" 
data ends 

code segment 
assume cs:code,ds:data 
START: 
mov ax,data 
mov ds,ax 

mov dx,offset prompt 
mov ah,09h 
int 21h 

mov ah,01h 
lea dx,str1 

read: 
int 21h 
mov bl,al 
cmp al,0Dh 
je display1 
cmp al,61h 
jl nexx 
cmp al,7Ah 
jg nexx 

sub al,20h 
mov [si],al 
inc si 
jmp read 

display1: 

lea dx,msg 
mov ah,09h 
int 21h 

lea dx,str1 
mov ah,09h 
int 21h 

mov ah,4ch 
int 21h 

nexx: 
inc si 
jmp read 

code ends 
end start 
+0

값을 저장하는 데 'si'를 사용하지만 주소를로드 할 위치를 볼 수 없습니다. –

+0

보, 어디서 불러 와야하나요? – user3848412

+0

디버거를 사용하여 코드를 단계별로 실행하고 문제를 직접 찾을 수 있습니다. 출력이 없으면 문제가있는 부분을 거의 알려주지 않습니다. –

답변

0

당신은 전에 str1과에시를 가리 키도록 잊었다 점점 입력 문자

mov ah,01h 
lea dx,str1 
mov si,dx ;point si to str1 

당신은 출력 문자열에 비 변환 대문자를 저장하는 것을 잊었다

nexx: 
mov [si],al 
inc si 
jmp read