Question

Given an array of words aw, an array of double words adw and a byte variable...

Given an array of words aw, an array of double words adw and a byte variable called vb, write the code that does the following: adw[5]=aw[3]+8-vb. "Assembly Language"(x86).

Homework Answers

Answer #1

Answer:

DATA SEGMENT

vb DB 5 ; declare a byte variable 'vb'

aw DW 6, 7, 8, 5, 22, 12, 11. ;. declare a word array

adw DD. 12, 45, 56, 12, 5, 34, 65. ; declare a double word array

DATA ENDS

CODE SEGMENT

ASSUME. CS: CODE, DS: DATA

BEGIN:

MOV AX, DATA

MOV DS , AX

MOV AX, aw[3]

MOV BX, 8

MOV BH, 0. ; Fill the upper byte of BX with zeros

ADD AX, BX . ; AX contains aw[3] + 8

MOV BX, vb

MOV BH, 0. ; Fill the upper byte of BX with zeros

SUB AX, BX . ; AX now contains aw[3] + 8 - vb

MOV adw[5], AX . ; adw[5] now contains aw[3] + 8 - vb

CODE ENDS

END BEGIN

-----------------------------------------------------------------------------------------------------------------

  

Know the answer?
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
Similar Questions
In Assembly x86 please Write an assembly program(call it lab6_file1.asm)that contains 10 double words in memory...
In Assembly x86 please Write an assembly program(call it lab6_file1.asm)that contains 10 double words in memory in the .data section where the first five initialized to 0 and the last five are initialized to 1. In addition, reserve ten uninitialized double words in .bss section. Using a loop, write an assembly program that copies the ten initialized values into the ten reserved double words, starting at the last position, moving to the first(reverse order the data in your uninitialized array)....
Given this array, write some JavaScript code that creates a new variable called "matchingAttendees" containing an...
Given this array, write some JavaScript code that creates a new variable called "matchingAttendees" containing an array with all attendees whose names start with an 'A' or a 'J'. let attendees = [ ["Jim", "Susan", "Emily", "Robert", "Carl"], ["Anthony", "Frank", "Hunter", "Colin", "Amanda"], ["Jenae", "Arthur", "Ronald", "Mary", "Rhonda"]
Consider the array of double values called "measurements". Complete the code so it would display on...
Consider the array of double values called "measurements". Complete the code so it would display on the console the values from "measurements" that deviate from TARGET by no more than TOLERANCE. You may want to use Math static method "abs", which returns the absolute value of a given number or expression. For example, if double variable measure = 2.9, then Math.abs(measure - 3) = 0.1.. To be clear, the expected output of your program should be the numbers 3.51, 3.49,...
JAVA /** * numDistinctElements returns the number of distinct elements in a given array of doubles....
JAVA /** * numDistinctElements returns the number of distinct elements in a given array of doubles. * * Some examples: * numDistinctElements(new double[] { }) is 0 * numDistinctElements(new double[] { 1, -4, -7, 7, 8, 11 }) is 6 * numDistinctElements(new double[] { -7, -4, -7, 3, 8, 8 }) is 4 */ Code Below: public static int numDistinctElements (double[] list) { return 0; }
Write a Java code to complete the following operations: (1) Define a double variable var1, initialize...
Write a Java code to complete the following operations: (1) Define a double variable var1, initialize it with value 9.99 (2) Given two integer variables var2 and var3, write a statement that gives var3 a value that is 4 more than the value of var2. (3) Define a double variable var4, initialize it with value 1234.56. Write a statement to change var4 so it will just hold one third (1/3) of the original value (4) Given four double variables var5,...
For questions 1 and 2 declare the array size as name constant first then use it...
For questions 1 and 2 declare the array size as name constant first then use it to declare the array 1. Declare an array named scores of type double and size 30. 2. Declare an array named names of string objects and size 15 3. Given the following array definition: int values[] = {2, 5, 8, 11}; What does each of the following display? cout << values[1];         B) cout << value[3]+values[0];   Define a three element array named letters, initialize it...
Given the following UTF-8 byte stream: 0x63 0xec 0xa7 0x93 0x33 0xd3 0xa9 what are the...
Given the following UTF-8 byte stream: 0x63 0xec 0xa7 0x93 0x33 0xd3 0xa9 what are the unicode character code points encoded by the above stream?
Given the existence of two-dimensional array double A[M][N], where M and N are #defined as the...
Given the existence of two-dimensional array double A[M][N], where M and N are #defined as the number of rows and columns, respectively, define a function named sqabsmax that accepts array A as an argument (i.e. input parameter) and returns the square of the maximum absolute value element in A. Use the const qualifier if appropriate. Only show the function definition. Do not write an entire program with a main function. Just write the definition for function sqabsmax.
Programming in C: 1. Given the following variable declarations: const size_t n = 50; 2. Write...
Programming in C: 1. Given the following variable declarations: const size_t n = 50; 2. Write the declaration of an an array of pointers to n memory blocks containing 16-bit signed integer values. Use 'x' for the name of the variable. 3. What is the type of the variable x? uint8_t *x[256]; 4. What type does the variable x decay to when used in an expression? uint8_t *x[256] 5. What is the data type of an array of five strings?...
2.  Suppose we have 3 arrays A, B, and C, array A’s base address is in $S3,...
2.  Suppose we have 3 arrays A, B, and C, array A’s base address is in $S3, B’s base address is in $S4, C’s base address is in $S5. You can only use two temporal registers $t0 and $t1. Convert the following code into MIPS assembly language code. Suppose every array element occupies 1 word in MIPS (32 bits). A[21] = B[0] + C[16];
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT