Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Design a flow chart Diagram for the Following Code in the Screenshots Below. org 100h = DA IA OPTION DB 1G,13,IF YOU UANT TO ENCRYPT
Design a flow chart Diagram for the Following Code in the Screenshots Below.
org 100h = DA IA OPTION DB 1G,13,"IF YOU UANT TO ENCRYPT PLEASE ENTER E F IF YOU UANT TO DECRYPT PLEASE ENTER| D : S" ERROR DB 1D.13, "THAT IS AN I L.LEGAL CHARACTER, PLEASE TRY AGAIN: 5" ENCRYPT DB 16,13;" MESSAGE AFT ER ENCRYPT I ON : DECRYPT DB 18,13;" DECRYPT DB 18,13 , "MESSAGE AFTER DECRYPTION : 5" MCODE MOU AX, PDATA MOU DS. AX BEGIN: MOU DX, OPFSET OPTION MOU AH, 9H INT 21H MOU AH; 1 ; READ E OR D INT 21H CMP 9I,E JE I NPUT T I NG CHP AL. D : JE INPUTTING: IF E OR D GO TO READ MOU DX, OFPSET ERROR ;ELSE ERROR MESSAGE MoU AH =9 INT 21H JHP BEGIN ;PROMPT AGAIN I NPU I I NG MOU [31 BH] ,AL,SAE E OR D MOU DX, OFPSET KEY ; PROHPT FOR KEY MOU AH A i READ KEY CHP [31 3OH],D, JE DECRYPT ION ; IF D. THEN GOTO DECRYPTION MOU DX,OFFSET INPUT ; ELSE READ MESSAGE TO BE ENCRYPTED HOU AH: 9 INI 21 II HoU .BH MOU DX OFPSET BUFFER1 ; READ INTO BUFPER1 INT 21 ENCRY PT I ON: LEA SI, BUPRERI I ENCRYPTION ADD SI: 1; COUNT PROH BUPFERINCREMENT TO GET THE MOU CH, ; COUNT PROM BUPEERINCMEMENT TOO GET THE MOU CL: [S1] ; LOAD COUNT INTO CX PUSH CX ISAUE CX FOR DECRYPTION ;SAUE CX FOR DECRYPTION AGA I N : INC SI MOU AL, [SI];T BUFFER GET THE CHAR FROM XOR AL;D1H ;INUERT THE LAST BIT ADD AL; [3101H] ; ADD KEY MOU [SI-2], AL ; BEGINING OF THE BUFFERSTORE IT TO THE LOOP AGAIN ; REPEAT MOU [SI],' ', LAST 2 LOGATIONSADD END OF STRING TO THE MoU [SI-1], '\$" MOU DX,OFFSET ENCRYPT MOU AH:9 INT 21H^ MOU DX.OFFSET BUFFER1 ; DISPLAY THE STRING AFTER ENCRYPTION Mou AH ?9 INT 21H^ JMP BEGIN ; GOTO START AGAIN DECRYPT I ON: LEA S I, BUFFER1 ; ONCE THE OPTION D IS PRESSED POP CX; ; LOAD CHAR COUNT INTO CX AGA I N1 : MOU AL, [SI]; CHAR FROM BUFPER LOAD THE ENCRYPTED SUB AL; [3101H] ;SUBTRACT KEY XOR AL; D1H ; INUERT THE LOWER BIT MOU [SI], AL ; BUFFERSAUE IT BACK TO THE INC SI ; INCREMENT INDEX LOOP AGAI IN1 ; REPEAT MOU DX, OFFSET DEGRYPT MOU AH:9 INT 21H^ MOU DX,OFFSET BUFFER1 ; DISPLAY THE DECRYPTED MESSAGE MOU AH:9 I NT 21H ST OP: H LT org 100h = DA IA OPTION DB 1G,13,"IF YOU UANT TO ENCRYPT PLEASE ENTER E F IF YOU UANT TO DECRYPT PLEASE ENTER| D : S" ERROR DB 1D.13, "THAT IS AN I L.LEGAL CHARACTER, PLEASE TRY AGAIN: 5" ENCRYPT DB 16,13;" MESSAGE AFT ER ENCRYPT I ON : DECRYPT DB 18,13;" DECRYPT DB 18,13 , "MESSAGE AFTER DECRYPTION : 5" MCODE MOU AX, PDATA MOU DS. AX BEGIN: MOU DX, OPFSET OPTION MOU AH, 9H INT 21H MOU AH; 1 ; READ E OR D INT 21H CMP 9I,E JE I NPUT T I NG CHP AL. D : JE INPUTTING: IF E OR D GO TO READ MOU DX, OFPSET ERROR ;ELSE ERROR MESSAGE MoU AH =9 INT 21H JHP BEGIN ;PROMPT AGAIN I NPU I I NG MOU [31 BH] ,AL,SAE E OR D MOU DX, OFPSET KEY ; PROHPT FOR KEY MOU AH A i READ KEY CHP [31 3OH],D, JE DECRYPT ION ; IF D. THEN GOTO DECRYPTION MOU DX,OFFSET INPUT ; ELSE READ MESSAGE TO BE ENCRYPTED HOU AH: 9 INI 21 II HoU .BH MOU DX OFPSET BUFFER1 ; READ INTO BUFPER1 INT 21 ENCRY PT I ON: LEA SI, BUPRERI I ENCRYPTION ADD SI: 1; COUNT PROH BUPFERINCREMENT TO GET THE MOU CH, ; COUNT PROM BUPEERINCMEMENT TOO GET THE MOU CL: [S1] ; LOAD COUNT INTO CX PUSH CX ISAUE CX FOR DECRYPTION ;SAUE CX FOR DECRYPTION AGA I N : INC SI MOU AL, [SI];T BUFFER GET THE CHAR FROM XOR AL;D1H ;INUERT THE LAST BIT ADD AL; [3101H] ; ADD KEY MOU [SI-2], AL ; BEGINING OF THE BUFFERSTORE IT TO THE LOOP AGAIN ; REPEAT MOU [SI],' ', LAST 2 LOGATIONSADD END OF STRING TO THE MoU [SI-1], '\$" MOU DX,OFFSET ENCRYPT MOU AH:9 INT 21H^ MOU DX.OFFSET BUFFER1 ; DISPLAY THE STRING AFTER ENCRYPTION Mou AH ?9 INT 21H^ JMP BEGIN ; GOTO START AGAIN DECRYPT I ON: LEA S I, BUFFER1 ; ONCE THE OPTION D IS PRESSED POP CX; ; LOAD CHAR COUNT INTO CX AGA I N1 : MOU AL, [SI]; CHAR FROM BUFPER LOAD THE ENCRYPTED SUB AL; [3101H] ;SUBTRACT KEY XOR AL; D1H ; INUERT THE LOWER BIT MOU [SI], AL ; BUFFERSAUE IT BACK TO THE INC SI ; INCREMENT INDEX LOOP AGAI IN1 ; REPEAT MOU DX, OFFSET DEGRYPT MOU AH:9 INT 21H^ MOU DX,OFFSET BUFFER1 ; DISPLAY THE DECRYPTED MESSAGE MOU AH:9 I NT 21H ST OP: H LT Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started