Question: PLEASE READ THE ASSIGNMENT CAREFULLY AND FOLLOW ALL STEPS. Keyboard input and string concatenation The purpose of this assignment is to give you practice processing
PLEASE READ THE ASSIGNMENT CAREFULLY AND FOLLOW ALL STEPS.
Keyboard input and string concatenation
The purpose of this assignment is to give you practice processing keyboard input and then mixing initialized and uninitialized data together using string concatenation techniques. In this assignment, you will utilize both styles of string concatenation dual syswrite calls and storing two strings in one piece of uninitialized data
Steps:
Open the Online Assembler
Near the top of the source code file, use comments to place your name into the code for credit No name, no credit!
Make sure every line of code you write has comments to explain what you are doing!
Follow the specifications below to get full credit for the assignment. Any errors or warnings will result in zero points for the code line in question:
SPECIFICATIONS
For this assignment, you are expected to do the following before we get to the text section:
Reserve bytes of uninitialized data called "inpbuf" to hold our class number
Reserve bytes of uninitialized data called "con" to hold our concatenated course name
Define a string of initialized data called "course" that holds 'CISP'
Define a string of initialized data called "hello" that holds My favorite class is
Create pieces of initialized and uninitialized data as needed to hold the lengths of these strings
IMPORTANT
Use only instructions as: mov, int, add, sub, mul, div, etc. in the text portion of the program.
Description of functionality
Your program should assume up to a byte course number for example, if the course is CISP then the course number would be being typed in the stdin box before running. Your program should retrieve this number and place it into the "inpbuf" reference above.
You should transfer over the string in "course" to the "con" buffer. Afterward, you should transfer over the data in "inpbuf" to the "con" buffer at the end of the first data placed there. For example, if the user entered as the input, your con buffer should contain 'CISP since that is the concatenation of the 'CISP' string with the input
You should do your first syswrite call recall how to display text to the console and write the "hello" string. You should also do a second syswrite call that writes the "con" buffer.
Make sure to properly exit the program as always
Expected Output
If you did everything correctly assuming input of your output should be:
My favorite class is CISP
You should also have no errors or warnings.
THIS IS AN EXAMPLE HOW TO ORGANIZE THE CODE:
section bss
count resd ; holds number of bytes read
inpbuf: resb ; our input buffer
inplen equ $inpbuf ; max bytes
section text
global start
start:
mov eax, ; sysread code
mov ebx, ; stdin keyboard
mov ecx, inpbuf ; Our input buffer
mov edx, inplen ; Max length
int x ; System call
mov count eax ; Save number of bytes read to count
mov eax, ; syswrite code
mov ebx, ; stdout console
mov ecx, inpbuf ; display input buffer
mov edx, count ; number of characters read from stdin
int x ; System call
mov eax, ; sysexit code
mov ebx, ; exit is normal
int x ; System call
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
