Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This Assembly Project will allow us to take user input. So far we've used the . text and . data sections in our programs. We
This Assembly Project will allow us to take user input.
So far we've used the text and data sections in our programs. We will now use the bss Block Started by Symbol It allows us to reserve space in memory for uninitialized variables. We will need these to store the user input.
We have several options for the size:
resb byte
resw word bits or bytes
resd double word bytes
resq quad word bytes, also used for floats
rest bytes, also used for extended floats
In order to get user input, we will need to use a system call. So far, we have used two system calls:
eax system call exit sys exit
eax system call write syswrite
For this lab, we will add:
eax system call read sysread
System calls take arguments we need to load three registers with values besides the register EAX.
For sysread, we need:
edx loaded with the max bytes of space in memory
ecx loaded with the address of our variable in the bss section
ebx loaded with the location we want to read from in our casesthiN standard input keyboard
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