Question: What is wrong with this code? Program says InputTheString (I put it in bold) is unmatched block nest. Please fix this for me. Thank you

What is wrong with this code?

Program says InputTheString (I put it in bold) is unmatched block nest. Please fix this for me. Thank you

INCLUDE Irvine32.inc

KEY = 239 ; any value between 1-255

BUFMAX = 128 ; maximum buffer size

.data

sPrompt BYTE "Enter the plain text: ",0

sEncrypt BYTE "Cipher text: ",0

sDecrypt BYTE "Decrypted: ",0

buffer BYTE BUFMAX+1 DUP(0)

bufSize DWORD ?

.code

main PROC

call InputTheString ; input the plain text

call TranslateBuffer ; encrypt the buffer

mov edx,OFFSET sEncrypt ; display encrypted message

call DisplayMessage

call TranslateBuffer ; decrypt the buffer

mov edx,OFFSET sDecrypt ; display decrypted message

call DisplayMessage

exit

main ENDP

pushad

mov edx,OFFSET sPrompt ; display a prompt

call WriteString

mov ecx,BUFMAX ; maximum character count

mov edx,OFFSET buffer ; point to the buffer

call ReadString ; input the string

mov bufSize,eax ; save the length

call Crlf

popad

ret

InputTheString ENDP

pushad

call WriteString

mov edx,OFFSET buffer ; display the buffer

call WriteString

call Crlf

call Crlf

popad

ret

DisplayMessage ENDP

pushad

mov ecx,bufSize ; loop counter

mov esi,0 ; index 0 in buffer

L1:

xor buffer[esi],KEY ; translate a byte

inc esi ; point to next byte

loop L1

popad

ret

TranslateBuffer ENDP

END main

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!