Here in the question it was asked to write a microblaze assembly program which takes a list of 10 integers and displays the average by using floating-point instructions.
we have to write the complete assembly code.
In the below the code was written:
MODEL SMALL
.DATA
VAL1 DB ?
NL1 DB 0AH,0DH,\' Enter the number of numbers you want to find out
the average:\',\'$\'
NL2 DB 0AH,0DH,\'Enter a number:\',\'$\'
NL3 DB 0AH,0DH,\'The mean or average is:\',\'$\'
.CODE
MAIN PROC
MOV AX,@DATA
MOV DS,AX
LEA DX,NL1
MOV AH,09H
INT 21H
MOV AH,01H
INT 21H
SUB AL,30H
MOV CL,AL
MOV BL,AL
MOV AL,00
MOV VAL1,AL
LBL1:
LEA DX,NL2
MOV AH,09H
INT 21H
MOV AH,01H
INT 21H
SUB AL,30H
ADD AL,VAL1
MOV VAL1,AL
LOOP LBL1
LBL2:
LEA DX,NL3
MOV AH,09H
INT 21H
MOV AX,00
MOV AL,VAL1
DIV BL
ADD AX,3030H
MOV DX,AX
MOV AH,02H
INT 21H
MOV AH,4CH
INT 21H
MAIN ENDP
END MAIN
Output
Enter the number of numbers you want to find out the average :
5
Enter a number : 3
Enter a number : 7
Enter a number : 4
Enter a number : 10
Enter a number : 6
The mean or average is : 6
Hence we have determined the mean average value.
1.) (25 pts.) Write a MicroBlaze assembly language program that takes in a list of 10 integers an...
write a program in x86 assembly language that sorts 10 integers entered from the keyboard and displays them in order
Write a computer program that takes as input a floating point number x in the interval [−π, π], and an integer n in the range 1, 2, ..., 10, and calculates sin(x) using the Taylor series definition within an accuracy of 10−n . Indicate your programming language of choice, and include a screen shot of your test cases.
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
Easy 68k code - assembly language Write a 68K program that reads two integers (>10 and <225) of the keyboard, adds them together and multiplies them, writes the numbers and the results of addition and multiplication on the screen. If the numbers are not on the range, writes an error message and requests a new number. Example of the execution: Insert the first number: 10 Insert the second number:15 The sum is: 25 The product is: 150 Please take a...
Assembly Language////Write a program that read in 10 integers from the user. Save the numbers into an array; reverse the array and display the reversed array. .data arrayInt DWORD 10 DUP(?) Your program consists of 4 procedures: 1. main procedure: call procedures getInput, reverseArray, displayArray 2. getInput procedure: prompt user to enter 10 integer numbers, save the numbers into the memory for the arrayInt 3. reverseArray: reverse arrayInt 4. displayArray: display the reversed array
Write a program for a 2-bit multiplier in assembly language. Also, multiple 01 and 10 and show the output in the program. Review the pipeline table and suggest changes to improve the performance. Output: Assembly language code with screenshot of the output. Also mention/highlight the cycle count for the complete program. The cycle count should be optimized for performance improvement. Also, display pipeline table with 3-4 suggestion for improvements FOR RISC-V using RIPES simulator
Intel 80x86 microprocessors 1. (%25) Write an assembly language program which asks the user to enter his/her name and surname through the keyboard. After the entry: The program clears the left top quarter of the screen and displays the name at the center of that quarter. Similarly the program clears the right bottom quarter of the screen and displays the surname at the center of that quarter. For example: If your name and surname are "Al and "Velir, the following...
This is a question from Assembly Language for x86 7th Edition by Kip Irvine, but the solution is not there. Programming exercise 12.7 #2. The code must be in assembly language for Intel using Kip Irvine library. An example of the source code would be: INCLUDE Irvine32.inc .code main PROC mov ax,4000h mov bx,1000h mov cx,1500h sub ax,bx sub ax,cx call DumpRegs exit main ENDP END main Question: Write a procedure that receives a single-precision floating-point binary value and displays...
(a) Write a C program to print a list of all integers between 1 and 1,000 (inclusive) which are divisible by 7 but not by 13. The list should be printed to a file called "output.dat". Remember to close the file after use. (35%) (b) Explain what is meant by the C preprocessor. Explain the effect of the following line of code: #define SQUARE (x) (x) * (x) (25%) (c) Explain the concept of an array in C. Write down...
Task 1 : Write a Java program that prompts for and reads 10 integers from the user into an integer array of size 10, it then: - calculates the sum and average of positive numbers of the array and displays them. [Note: consider 0 as positive] Note: The program must display the message: "There are no positive values" if the array does not contain any positive value.