Can someone please help me write a NASM assembly language program "caesar.asm" that does caesar cipher involves shifting letters in the given string by a given number in the alphabet? Thank you very much for your help. (I have included an example nasm code in the attachment) The program should: Ask for user input between -30 and 30 Ask the user for a string and display the unedited string that the user entered (string from the user should be more than 8) Lastly, display the caesar cipher edited string.
Can someone please help me write a NASM assembly language program "caesar.asm" that does caesar cipher involves shifting letters in the given string by a given number in the alphabet? Thank you very much for your help. (I have included an example nasm code in the attachment) The program should: Ask for user input between -30 and 30 Ask the user for a string and display the unedited string that the user entered (string from the user should be more than 8) Lastly, display the caesar cipher edited string.
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
Can someone please help me write a NASM assembly language program "caesar.asm" that does caesar cipher involves shifting letters in the given string by a given number in the alphabet? Thank you very much for your help. (I have included an example nasm code in the attachment)
The program should:
Ask for user input between -30 and 30
Ask the user for a string and display the unedited string that the user entered (string from the user should be more than 8)
Lastly, display the caesar cipher edited string.

Transcribed Image Text:The image shown contains assembly language code structured around several distinct sections for managing data, uninitialized data, and program text. Below is a transcription and explanation suitable for an educational website:
### Code Explanation:
#### Data Section
- **Purpose**: Stores initialized variables and string messages used throughout the program.
- **Variables**:
- `shift_value`: Asks the user to "Enter shift value: ".
- `len_sv`: Calculated as the length of `shift_value`.
- `invalid_shift_msg`: Error message if shift value is out of range, between 0-25.
- `original_msg`: Prompts the user to "Enter original message: ".
- `invalid_msg`: Error message if entered message is not within 30-120 characters.
- `current_msg`: Displays "Current message: ".
- `encrypted_msg`: Displays "Encryption: " with a newline character.
- **Constants** (`equ`): Used to determine the length of the various strings.
#### BSS Section
- **Purpose**: Reserves space for uninitialized variables.
- **Variables**:
- `input`: 4 bytes reserved for input data.
- `shift_buf`: 1000 bytes reserved to handle shift values.
- `msg_buf`: 1000 bytes reserved to handle message inputs.
#### Text Section
- **Purpose**: Contains the executable code for the application.
- **Functionality**:
- `main`: The starting point of the program.
- Pushes the base pointer onto the stack, which will be used for keeping track of shifts.
- Calls `user_input` function.
- `user_input`: A subroutine that handles user input:
- Sets up system calls to interact with the user for entering shift values and messages, using appropriate registers (`rax`, `rdi`, `rsi`, `rdx`).
### Formatting Information
- Print, input, and float formats (`print_fmt`, `input_fmt`, `float_fmt`) are defined for handling strings and numbers via specific system calls.
This assembly program structure is foundational in understanding how applications interact with users at a low level, demonstrating input handling and memory management in assembly language.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps

Recommended textbooks for you

Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON

Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning

Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON

Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education

Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY