Assembly Language 1. Give the op code and number of bytes of code for each of th
ID: 3809292 • Letter: A
Question
Assembly Language
1. Give the op code and number of bytes of code for each of these instructions. 28 points
(a) mov ecx, 984 Op Code______ Number of Bytes _____
(b) xchg eax, ecx Op Code______ Number of Bytes _____
(c) add eax, ecx Op Code______ Number of Bytes _____
(d) add eax, value Op Code______ Number of Bytes _____
(assume value references a doubleword in memory)
(e) inc edx Op Code______ Number of Bytes _____
(f) inc DWORD PTR [edx] Op Code______ Number of Bytes _____
(g) neg value Op Code______ Number of Bytes _____
(assume value references a doubleword in memory)
(h) neg edx Op Code______ Number of Bytes _____
(i) neg DWORD PTR [edx] Op Code______ Number of Bytes _____
(j) add ecx, 894 Op Code______ Number of Bytes _____
(k) imul eax, ecx Op Code______ Number of Bytes _____
(l) div value Op Code______ Number of Bytes _____
(assume value references a doubleword in memory)
(m) div DWORD PTR [edx] Op Code______ Number of Bytes _____
(n) cdq Op Code______ Number of Bytes _____
Explanation / Answer
Following are the Op Codes and Number of Bytes :
(a) mov ecx, 984 Op Code MOV , Number of Bytes= 1
(b) xchg eax, ecx Op Code XCHG , Number of Bytes = 1
(c) add eax, ecx Op Code ADD , Number of Bytes = 1
(d) add eax, value Op Code ADD , Number of Bytes = 1
(e) inc edx Op Code INC , Number of Bytes = 1
(f) inc DWORD PTR [edx] Op Code INC , Number of Bytes = 1
(g) neg value Op Code NEG , Number of Bytes = 2
(assume value references a doubleword in memory)
(h) neg edx Op Code NEG , Number of Bytes = 2
(i) neg DWORD PTR [edx] Op Code NEG , Number of Bytes = 4
(j) add ecx, 894 Op Code ADD , Number of Bytes = 4
(k) imul eax, ecx Op Code : IMUL and Number of bytes = 2 (Signed multiplication)
(l) div value Op Code : DIV and Number of bytes = 2 (1 for quotient and another for reminder)
(m) div DWORD PTR [edx] Op Code : DIV and Number of bytes = 2
(n) cdq Op Code : CDQ and Number of bytes = 4 (converts double to quad)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.