Question

Write down the value of each destination operand: .data var1 WORD 0A8B4h, 1234h, 0BA23h var2 DWORD...

Write down the value of each destination operand:

.data

var1 WORD 0A8B4h, 1234h, 0BA23h

var2 DWORD 0E2A478C1h

.code

mov ax, WORD PTR [var1+3]

mov eax, WORD PTR [var2+1]

mov ebx, DWORD PTR [var1+2]

0 0
Add a comment Improve this question Transcribed image text
Answer #1

.data

var1 WORD 0A8B4h, 1234h, 0BA23h // it stores data in memory for little endian B4 A8 34 12 23 BA and var1 points to memory of first byte B4

var2 DWORD 0E2A478C1h // it stores data in memory in little endian C1 78 47 2A and var2 poitns to C1 , skip E2 it is more than 4 byte (DWORD)

.code

mov ax, WORD PTR [var1+3]

// ax=2312 => var1 is point B4 after adding pointer 3 it points 12 so it read 2 bytes 12 an 23 and arrange in MSB to LSB 2312

mov eax, WORD PTR [var2+1]

// eax=4778=> var2 is point C1 after adding pointer 1 it points 78 so it read 78 an 47 and arrange in MSB to LSB 4778

mov ebx, DWORD PTR [var1+2]

// ebx=1234 => var1 is point B4 after adding pointer 2 it points 34 so it read 2 bytes 34 an 12 and arrange in MSB to LSB 1234

Add a comment
Know the answer?
Add Answer to:
Write down the value of each destination operand: .data var1 WORD 0A8B4h, 1234h, 0BA23h var2 DWORD...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write down the value of each destination operand: .data var1 WORD 3056h, 7645h, 0E347h var2 DWORD...

    Write down the value of each destination operand: .data var1 WORD 3056h, 7645h, 0E347h var2 DWORD 3E56F289h .code mov ax, WORD PTR [var2+1] mov eax, DWORD PTR [var1] mov ebx, DWORD PTR [var1+3]

  • Assembly Language: Write and run a program to find the values of each destination operand: .data...

    Assembly Language: Write and run a program to find the values of each destination operand: .data varB BYTE 65h,31h,02h,05h varW WORD 6543h,1202h varD DWORD 12345678h .code mov ax, WORD PTR [varB+2] ; a= mov bl, BYTE PTR varD ; b= mov bl, BYTE PTR [varW+2] ; c= mov ax, WORD PTR [varD+2] ; d= mov eax,DWORD PTR varW   ; e=

  • What will be the value of the parity flag after the following lines execute? Mov al,...

    What will be the value of the parity flag after the following lines execute? Mov al, 3 Add al, 5 What will be the value of the destination operand after each of the following instructions execute?            .data var1 SBYTE     -1, -2, -3, -4 var2 WORD A000h, B000h, C000h, D000h var3 SWORD     -16, -42 var4 DWORD     11, 22, 33, 44 .code mov ax, var2 mov ax, [var2+4] mov ax, var3 mov ax, [var3-2]

  • Use the following data declarations. Assume that the offset of byteVal is 00000000: data byteValsbyte 1,2,3,ffh...

    Use the following data declarations. Assume that the offset of byteVal is 00000000: data byteValsbyte 1,2,3,ffh dwordVal dword 34567890h, 90785634h, 12346745h Show the value of the final destination operand after each of the following code fragments has executed:(If any instruction/s is invalid, indicate "INV" as the answer and briefly explain why) a.mov edi, 2 answer al mov al, (byte Val + edi) b.mov ebx, dwordVal+4 answer ebx - [esi).- (show your answer in liteedim mov esi, offset dwordVal+8 xchg ebx,...

  • Q 2. Assuming a 32-bit operating environment, identify the mode of each operand in the following...

    Q 2. Assuming a 32-bit operating environment, identify the mode of each operand in the following instructions. (Note: There are two operands in each instruction; identify both modes.) For a memory operand, specify whether it is direct memory mode or register indirect memory mode. Assume that the instructions are in a program also containing the code. .DATA value DWORD ? char BYTE *1. mov value, 100 2. movecx, value 3. mov ah, Oah *4. moveax, (esi] 5. mov [ebx], ecx...

  • #include "stdio.h" #include <iostream> int main() { unsigned char var1 = 4; unsigned short int var2...

    #include "stdio.h" #include <iostream> int main() { unsigned char var1 = 4; unsigned short int var2 = 255; unsigned short int var3 = 16; unsigned int var4 = 1; asm_ MOV AL, var1; MOV AX, var2; MOV AX, var3; MOV EBX, var4; MOVZX ECX, AX; What is the hexadecimal value of BX?

  • Assembly Please answer the following above, compile and single step through the program, writing...

    Assembly Please answer the following above, compile and single step through the program, writing down the value of the destination for each instruction. 1. Using Visual Studio on the system, create a project using the code given below unsigned char short int int gArray 0x09, 0xFA, 0x5A, 0x18, 0x48, 0xAC, 0xD4, 0x71 ; cAr rays 1 [ ] = { 0:09, 0xfa, Ox5A, Ox18, 0x48, OxAC, OxD4, 0x71 }; gArray! [ ] = { Ox09, OxFA, Ox5A, Ox18, 0x48, OxAC,...

  • ) Identify the hexadecimal value moved to the destination by each of the following instruction below...

    ) Identify the hexadecimal value moved to the destination by each of the following instruction below based on the given data declaration. Assume that the offset of byteVal is 00000000H data byteVal wordVal dwordVal aString BYTE 1,2,3,4 WORD 1000H,2000H,3000H,4000H DWORD 12345678H,34567890H BYTE "ABCDEFG",0 ax,offset byteVal i. mov dx,wordVal i. mov al,aString+2 i11. mov dx,wordVal+4 iv. mov mov eax,offset byteVal+2 V. CO2 (10 marks) d) The incomplete program below used to find the multiplication product of the given numbers by 4...

  • 1. Assume that you are given values in eax, ebx, ecx. Write an assembly code that...

    1. Assume that you are given values in eax, ebx, ecx. Write an assembly code that does the following: eax = (ecx + edx ) - (eax + ebx) 2. Write a piece of code that copies the number inside al to ch. Example: Assume that Initially eax = 0x15DBCB19. At the end of your code ecx = 0x00001900. Your code must be as efficient as possible. 3. You are given eax = 0x5. Write one line of code in...

  • NOTE: explain the lines in comments for better understanding Write an assembly program (for x86 processors...

    NOTE: explain the lines in comments for better understanding Write an assembly program (for x86 processors - Irvine) that has two procedures, a main procedure and a procedure called Fib. The fib procedure is to uses a loop to calculate and printout the first N Fibonacci numbers. Fibonacci sequence is described by the following formula: Fib(1) = 1, Fib(2) = 1, Fib(n) = Fib(n – 1) + Fib(n – 2). The value of N is to be communicated to this...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT