Assembly Caesar密码程序未将输出写入屏幕

Assembly Caesar密码程序未将输出写入屏幕,assembly,encryption,emulation,x86-16,Assembly,Encryption,Emulation,X86 16,我正试图用汇编语言编写一个凯撒密码程序。没有错误,但当它运行时,不会显示任何内容,并且会静默退出。这是我写的 .MODEL small .STACK 64 .DATA ORG 0000h ;Start of code MSG1 DB "Please input your string [Max 15 chars]: $" int 21h KEY1 DB "Please input your required shift [RANGE 0 -

我正试图用汇编语言编写一个凯撒密码程序。没有错误,但当它运行时,不会显示任何内容,并且会静默退出。这是我写的

.MODEL small
.STACK 64
.DATA

  ORG     0000h            ;Start of code   
  MSG1 DB "Please input your string [Max 15 chars]: $"
  int 21h
  KEY1 DB "Please input your required shift  [RANGE 0 -F]: $"
  MSG2 DB "YOUR ENCRYPTED MESSAGE  IS : $"
  ErrorKey DB "Key Value out of range-please renter it range 0-F : $"
  STR1 DW 15 DUP('$') ;store plain text
  KEYV DB ?  ;to store the value of the key 
  STR2 DW 15 DUP(?); store encrypted message

.CODE
MAIN PROC FAR
MOV AX,@DATA
MOV DS,AX

;to display message 1 
MOV DX, OFFSET MSG1
MOV AH,09H
INT 21H               

;now the user enters the message
mov ax, 0000h
int 16h

mov ax, 0000h ; This key press it just to pause the program so you can see.
Int 16h       ; that you can’t see your own input
mov STR1,ax ;moving the message to be stored in str1

;to display Key message 
MOV DX, OFFSET KEY1
MOV AH,09H
INT 21H           


;now the user enters the key
KEY:
mov al, 0000h
int 16h

mov ax, 0000h ; This key press it just to pause the program so you can see.
Int 16h       ; that you can see your own input
mov KEYV,al ;moving the message to be stored in KEYV        


;now checking that the value of the key is within the correct range
CHECK: 
CMP KEYV,0FH  ;
JG show;       if value greater than F go to show
CMP KEYV,10H  ; if value below or equal F go to encrypt
JB ENCRYPT ; 

show:   
;to display Error Key message 
MOV DX, OFFSET ErrorKey
MOV AH,09H
INT 21H           
;restore the key value         
Jp KEY



 ENCRYPT:   MOV SI,OFFSET STR1  ;put the message in SI
            MOV BL,KEYV
            MOV DI,OFFSET STR2 
            MOV CX,15   

 ENCPROCESS:             
            MOV AL ,BYTE PTR[SI]  ;move first byte of PT in AL
            ADD  AL,BL   ;37 Add to it the key value
            MOV [DI],AL;     ;store the encrypted byte in DI
            INC SI 
            INC DI
            LOOP ENCPROCESS 


 ;to display encrypted message
MOV DX, OFFSET STR2
MOV AH,09H
INT 21H   




MAIN ENDP
END MAIN

我做错了什么?

在其中放置断点/逐节调试以缩小问题范围

然后,当你发现问题时,如果你不能解决它,你可以更具体

你的另一个选择是希望某种善良的灵魂会在你的整个计划中拖网前进