Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hello everyone I have a question for assembly language course and I need a good

ID: 3580965 • Letter: H

Question

Hello everyone I have a question for assembly language course and I need a good expert who can helps me to solve that question. Thank you I just solve (a)and (b) can you please do the rest of it 2. (5 points) Data manipulation. Given the following data definitions: data my Bytes BYTE 12h, 34h, 56h, 78h, 9Ah, my words WORD 8000h. 2 DUP my string BYTE "CS251, ISFUN!" a) Insert a directive into the given data that aligns myBytes to an even-numbered address. b) What does the value of the EAx register become after each of the following instructions execute? i mov eax, TYPE myBytes ii mov eax, LENGTHOF myBytes iii. mov eax, SIZEOF myBytes iv. mov eax, TYPE myWords v. mov eax LENGTHOF myWords vi, mov eax, SIZEOF myWords vii. mov eax, SIZE OF mystring c) What is a single instruction that moves the first 2 bytes in myBytes to the Dx register, with a resulting value of 3412h? d) write an instruction that moves the second byte in mywords to the AL register. e) write an instruction that moves all 4 bytes in myBytes to the EAx register. Insert a LABEL directive in the given data that permits mywords to be moved directly to a 32-bit register. g) Insert a LABEL directive in the given data that permits myBytes to be moved directly to a 16-bit register.

Explanation / Answer

c) Here we need to move first two values in single instruction, if we directly write mov [dx], 2 then system may directly put 16 bit integer value of 2 into dx. Hence we use WORD PTR here because BYTE PTR transfers only 2 numbers while WORD PTR transfers 4 numbers i.e. 3421h

mov DX, WORD PTR myBytes

d) since we need to move second byte of myWords , we need to access it by its index , that is, [myWords+1] and BYTE PTR as we need only 1 byte transfer

mov AL,BYTE PTR myWords+1

e) since all four bytes need to be moved, we directly assign the myBytes

mov EAX,[myBytes]

f) format of doing this is

Name LABEL type.

.DATA

myWordsD LABEL DWORD

so now when we execute, mov EAX,myWordsD

this will give all the data stored in myWords

g) same as the above solution

myBytesW LABEL WORD

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote