Question
1. Each of the following lines of code generates an error message when we invoke the assembler. Explain what is wrong with each line. 1
1. Each of the following lines of code generates an error message when we invoke the assembler. Explain what is wrong with each line.
1 movb $0xF, (%ql)
2 movl %eax,$0xFA
3 movl %eax,%bx
4 movb %ah,%sh
5 movw 4(%esp), (%ebx)
2. In one sentence, write what operation each instruction performs?
I) movl %eax,(%edx)
II) movl 12(%ebp), %ecx
III) addl %eax, %edx
IV) sall %eax, %ebx
V) incl %edx
3. Suppose register %eax holds the value of variable named a and %ecx holds the value of variable named b. Fill in the table below with formulas indicating the value that will be stored in register %edx for each of the given assembly code instructions:
Instruction | Result |
leal 4(%eax), %edx |
|
leal (%ecx,%eax), %edx |
|
leal 3(%ecx,%eax,2), %edx |
|
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