Question

Consider array x as shown below. x sdword 43,12,13,53,-1,21 Give the assembly instructions for each of...

Consider array x as shown below. x sdword 43,12,13,53,-1,21 Give the assembly instructions for each of the following:

Move the value of the first element of x to the EAX register.

Move the value of the third element of x (the element containing 13) to the EBX register.

Move the address of x to the ESI register

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

mov EAX,[x] 4 moves value of firm elecur into EAX Register EAX = 43 mov Eax, (x+2] Il It makes Eax = 13. mov EST, OPFSET X; .

Add a comment
Know the answer?
Add Answer to:
Consider array x as shown below. x sdword 43,12,13,53,-1,21 Give the assembly instructions for each of...
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
  • Consider the following array declaration: int myarray[20]; If %eaxcontains the address of this array, provide assembly...

    Consider the following array declaration: int myarray[20]; If %eaxcontains the address of this array, provide assembly code that will move the value at an index stored in register %ebx into register %ecx.

  • Question#1 Write a short program demonstrating that the INC and DEC instructions do not affect the...

    Question#1 Write a short program demonstrating that the INC and DEC instructions do not affect the Carry flag. Question#2 Write a program that uses addition and subtraction to set and clear the Overflow flag. After each addition or subtraction, insert the call DumpRegs statement to display the registers and flags. Make sure to include an ADD instruction that sets both the Carry and Overflow flags. Using comments, explain how and why the Overflow flag was affected by each instruction. Question#3...

  • Assembly Language NASM create a substring ASSIGNMENT INSTRUCTIONS: Create the Substring from the Given string, beginIndex...

    Assembly Language NASM create a substring ASSIGNMENT INSTRUCTIONS: Create the Substring from the Given string, beginIndex and endIndex The program should create a new string that is a substring of this string. The substring begins at the specified beginIndex and extends to the character at index endIndex – 1. Thus the length of the substring is endIndex-beginIndex. In other words you can say that beginIndex is inclusive and endIndex is exclusive while getting the substring. Initialize the following values in...

  • Task is to implement the following algorithms in Assembly language for x86 processor

    Task is to implement the following algorithms in Assembly language for x86 processor1) Insertion sort Demonstrate Sorted Array of 10 elements in Watch Window for each one Running time of each algorithmsample bubble sort code:;----------------------------------------------------------BubbleSort PROC USES eax ecx esi,pArray:PTR DWORD, ; pointer to arrayCount:DWORD ; array size;; Sort an array of 32-bit signed integers in ascending; order, using the bubble sort algorithm.; Receives: pointer to array, array size; Returns: nothing;-----------------------------------------------------------mov ecx,Countdec ecx ; decrement count by 1L1: push ecx ; save outer...

  • read carefully Which DOES NOT evaluate. Consider the following arithmetic operations in C: int X-20; int Y-20; int Z-2*(X+Y) which assembly code(0x86) does not evaluate value for Z correctly? mov...

    read carefully Which DOES NOT evaluate. Consider the following arithmetic operations in C: int X-20; int Y-20; int Z-2*(X+Y) which assembly code(0x86) does not evaluate value for Z correctly? mov eax.X b) mov ebx. Y add eax ebx mov el.4 mov ebx.Y a) add eax.ebx mov cl.2 imul cl mov Z eax imul cl shr eax. 1 mov Z.eax d) mov eax.X mov ebx.Y add eax.ebx shl eax, I mov Z,eax mov eax X c) mov ebx,Y shl eax.2 shl...

  • 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...

  • the answer is movl 8(%ebp), %edx or movl 4(%ebp), %edx? Consider the following C and assembly...

    the answer is movl 8(%ebp), %edx or movl 4(%ebp), %edx? Consider the following C and assembly code: int increment(int x){ return x+1; } increment: 1 push? 2 movl 3 movl 4 addl 5 6 popl ret %ebp %esp, %ebp 8(%ebp), %eax $1, %eax %ebp Suppose we want to move the return address into register %edx on line 5. Write 1 line of assembly code to perform this action. (Write your answer with exactly 2 spaces: one after the instruction, and...

  • Exercise 3 [Conditionals] Consider the following assembly code for a function F3 with two integer arguments:...

    Exercise 3 [Conditionals] Consider the following assembly code for a function F3 with two integer arguments: F3: push EBP mov EBP, ESP mov EDX, DWORD PTR [ebp+12] mov EAX, DWORD PTR [ebp+8] cmp EAX, EDX # setup stack #if # goto .L1 #EAX- mov EAX, EDX # ignore for now mov DWORD PTR [EBP-4], EAX mov ESP, EBP pop EBE ret # cleanup stack To the right of each instruction, show the contents of the register whose value changes as...

  • Consider the following MIPS assembly language instructions: addi $1, $2, 100 swr $1, 0($2): addi $rt,...

    Consider the following MIPS assembly language instructions: addi $1, $2, 100 swr $1, 0($2): addi $rt, $rs, immediate # add immediate swr $rt, immedi ate ($rs) # store word write register These instructions are I-format instructions similar to the load word and store word instructions. The addi and swr instructions store a computed value to the destina- tion register $rt. The instructions do not require any physical hardware changes to the datapath. The effect of each instruction is given below....

  • Please answer 2.6.1 2.6 The table below shows 32-bit values of an array stored in memory...

    Please answer 2.6.1 2.6 The table below shows 32-bit values of an array stored in memory Address Data 24 38 2 4 32 36 40 2.6.1 [5] <COD §§22, 2.3-For the memory locations in the table above, write C code to sort the data from lowest to highest, placing the lowest value in the smallest memory location shown in the figure. Assume that the data shown represents the C variable called Array, which is an array of type int, and...

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