Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I'm completely new to assembly language, and I was just wondering what the working programing code would be to for this program below. Write a

I'm completely new to assembly language, and I was just wondering what the working programing code would be to for this program below.

Write a NASM 8086 program which will encrypt/decrypt a message.

It will do this by reading key and then using an exclusive OR operation to encrypt that character with the key.

Each character will then be pushed on the stack, keeping count of the number of characters in the message.

The end of the message will be indicated when the user presses the enter key.

At that point, the encrypted message will be popped off the stack, and displayed, character by character.

(Note: a key value of 0 will simply display the string in reverse.)

This problem can be solved by implementing the following algorithm:

repeat

prompt the user to enter a number between 0 and 31

enter an unsigned base 10 number from the keyboard and make it the key

until the key is between 0 and 31

initialize counter to 0

prompt user to enter the message

read a character from the keyboard

while character is not the CR character do

char <-- char XOR key

push char on the stack

increment the counter

endwhile

print a CR/LF pair

for counter times do

pop char off the stack

display it

endfor

Note that if you enter the cyphertext with the same key used to encrypt it, you should get the original plaintext back.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 24th International Conference Dexa 2013 Prague Czech Republic August 2013 Proceedings Part 1 Lncs 8055

Authors: Hendrik Decker ,Lenka Lhotska ,Sebastian Link ,Josef Basl ,A Min Tjoa

2013 Edition

3642402844, 978-3642402845

More Books

Students also viewed these Databases questions

Question

Explain the different types of marketing strategies.

Answered: 1 week ago

Question

Explain product positioning.

Answered: 1 week ago