Please, Could someone please write me an assembly language program for PEP8 which outputs the perimeter of a rectangle? perim=(width+length)*2 ?
BR main
;******* void rect (int& p, int w, int h)
p: .EQUATE 6 ;formal parameter
w: .EQUATE 4 ;formal parameter
h: .EQUATE 2 ;formal parameter
rect: LDA w,s ;p = (w + h) * 2
ADDA h,s
ASLA
STA p,sf
endIf: RET0 ;pop retAddr
;
;******* main ()
perim: .EQUATE 4 ;local variable
width: .EQUATE 2 ;local variable
height: .EQUATE 0 ;local variable
main: SUBSP 6,i ;allocate locals
STRO msg1,d
DECI width,s
STRO msg2,d
DECI height,s
MOVSPA ;push address of perim
ADDA perim,i
STA -2,s
LDA width,s ;push value of width
STA -4,s
LDA height,s ;push value of height
STA -6,s
SUBSP 6,i ;push params
CALL rect ;rect (perim, width, height)
ra1: ADDSP 6,i ;pop params
STRO msg3,d
DECO perim,s
CHARO '\n',i
ADDSP 6,i ;deallocate locals
STOP
msg1: .ASCII "Enter width: \x00"
msg2: .ASCII "Enter height: \x00"
msg3: .ASCII "perim = \x00"
.END
Please, Could someone please write me an assembly language program for PEP8 which outputs the perimeter...
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
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; }
In
PEP8 code.
assembly pep8 code.
30. Write an assembly language program that corresponds to the following C+ program #include <iostream> using namespace std; int num; int main() cin >> num: num = num/ 16; cout << "num = " << num << endl; return 0; 21 de
Write a Java program to find the perimeter of rectangle and ask the user to input length and width.
Write an assembly language program that reads in a number, n, and outputs, Fibonacci number, F_n. Test your program on input 13. Turn in a listing of your program, and the results of this test run. (Your answer should be 233.)
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.
Your assignment is to write an assembly language program which read a string and print it in uppercase. This program asks the user to enter a string which is subsequently displayed in uppercase. It is important to first ensure that string to be converted is in the a-z range. The program does not recognize any space, symbols or any kind of punctuation marks. Any time the user enters any of this character the program is going to repeatedly ask for the...
Please write in assembly language 8086 windows32 Question 3: Write an assembly program that has a macro maximum that finds the larger of two numbers inputted by the user
In assembly language HCS12 please
art (b) PRE-LAB 1) Write an assembly program which flashes Blue LED 10 times with on time of 0.25 seconds and off time of 0.25 seconds
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