Using the console32 framework, write a complete assembly
language program that computes in EAX the perimeter (2*length +
2*width) of a rectangle where the length and width are in memory
doublewords.
ASSEMBLY LANGUAGE
console 32
answer:
#include <iostream>
using namespace std;
void Compute( float length, float width, float& perimeter,
float& area ) {
perimeter = 2 * ( length + width );
area = length * width;
}
int main( int argc, char** argv ) {
float len, wid, per, a;
cout << "Please enter the length of the rectangle: ";
cin >> len;
cout << "Please enter the width of the rectangle: ";
cin >> wid;
Compute( len, wid, per, a );
cout << endl <<
"The perimeter of the rectangle is: " << per << endl
<<
"The area of the rectangle is: " << a << endl;
}
Using the console32 framework, write a complete assembly language program that computes in EAX the perimeter (2*length +...
Please, Could someone please write me an assembly language program for PEP8 which outputs the perimeter of a rectangle? perim=(width+length)*2 ?
Write a short application that computes the perimeter of a rectangle. It should allow the user to input the length and width of the rectangle as a double. Java language.
12. Write a C function void rect(int *ar, int *per, int len, int wid) that computes the area ar and perimeter per of a rectangle with length len and width wid. Test it with a main program that inputs the length and width of a rectangle and outputs its area and perimeter. Output the value in the main program, not in the procedure. Sample Input 6 10 Sample Output Length: 6 Width: 10 Area: 60 Perimeter: 32
3. Write a program in assembly language that reads a number from the keyboard and displays it on the screen. 4. Write a program in assembly language to ask two digits from the user, store the digits in the EAX and EBX register, respectively, add the values, store the result in a memory location 'res' and finally display the result.
ARM assembly language Write a program "fibonacci.s" that computes the Nth Fibonacci number where N is not so large that overflow of integer arithmetic is a concern. When your assembly language program is called it should expect the value of N to be passed using register r0 and your program should return the Nth Fibonacci number in register r0. Please include comments as well. Do not just use the output generated by gcc -S
Assembly Language Program Help Write a procedure named CountNearMatches that receives pointers to two arrays of signed doublewords, a parameter that indicates the length of the two arrays, and a parameter that indicates the maximum allowed difference (called diff) between any two matching elements. For each element x(i) in the first array, if the difference between it and the corresponding y(i) in the second array is less than or equal to diff, increment a count. At the end, return a...
Write an assembly language program that corresponds to the following C program: int width; int length; int perim; int main () { scanf ("%d%d", &width, &length); perim = (width + length) * 2; printf ("width = %d\n", width); printf ("length = %d\n\n", width); printf ("perim = %d\n", perim); return 0; }
Create the following two programs in assembly language: 1. Write a program that will call a procedure to push the following Decimal value into eax - 31000 and then clear the register using pop. 2. Write a program that will call a procedure to use minMax to push an array values into eax register.
Using the MARIE computer assembly language, write a program that computes the following expression: z = a * b * c. The computer will read in the input values a, b, and c from the keyboard and the final result (z) have to be displayed. In addition, every time an input value is read in, it must be displayed on the screen. Remember that the instruction set does not have an instruction to execute multiplication. The program must be tested...
Write a Java program to find the perimeter of rectangle and ask the user to input length and width.