Note:  We are programming for 64 bit Intel Architecture You have to use system calls Can someone please help me write a NASM assembly language program 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 include an example code for the NASM assembly language. The program should: Ask for user input between -20 and 20  Ask the user for a string and display the unedited string that the user entered Lastly, display the caesar cipher edited string.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Topic Video
Question

Note: 

  • We are programming for 64 bit Intel Architecture
  • You have to use system calls

Can someone please help me write a NASM assembly language program 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 include an example code for the NASM assembly language.

The program should:

Ask for user input between -20 and 20 

Ask the user for a string and display the unedited string that the user entered

Lastly, display the caesar cipher edited string.

;initializing variables with print statements
shift_value:
db "Enter shift value:
len_sv
equ $-shift_value
invalid_shift_msg:
len_is
section .data
original_msg:
len_om
invalid_msg:
len_in
current_msg:
len_cm
encrypted_msg:
len_en
main:
input
shift_buf
nsg_buf
db "Error: Please enter a shift value between 0-25", 0
equ $-invalid_shift_msg
;setting the format
print_fat:
input_fmt:
float_fmt:
db "Enter original message:
equ $-original_msg
db "Error: Please enter a message between 30-120 characters", 8
equ $-invalid_msg
db "Current message: ", e
equ $-current_msg
section .bss
user_input:
db "Encryption: ", 18
equ $-encrypted_msg
mov
mov
mov
mov
syscall
db "%s", 0
db "%d",
db "%f" 8
section .text
global main
resb 4
resb 1000
resb 1000
push rbp
mov r8, 8
call user_input
rax, 1
rdi, 1
rsi, shift_value
rdx, len_sv
;reserving bytes for input & buffers
;Used for keeping track of shifts
getting user inputs
;shift value prompt
Transcribed Image Text:;initializing variables with print statements shift_value: db "Enter shift value: len_sv equ $-shift_value invalid_shift_msg: len_is section .data original_msg: len_om invalid_msg: len_in current_msg: len_cm encrypted_msg: len_en main: input shift_buf nsg_buf db "Error: Please enter a shift value between 0-25", 0 equ $-invalid_shift_msg ;setting the format print_fat: input_fmt: float_fmt: db "Enter original message: equ $-original_msg db "Error: Please enter a message between 30-120 characters", 8 equ $-invalid_msg db "Current message: ", e equ $-current_msg section .bss user_input: db "Encryption: ", 18 equ $-encrypted_msg mov mov mov mov syscall db "%s", 0 db "%d", db "%f" 8 section .text global main resb 4 resb 1000 resb 1000 push rbp mov r8, 8 call user_input rax, 1 rdi, 1 rsi, shift_value rdx, len_sv ;reserving bytes for input & buffers ;Used for keeping track of shifts getting user inputs ;shift value prompt
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Instruction Format
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education