Question: a) Calculating the average value of array elements and assigning it to the variable avg, b) Implementing the Quick Sorting algorithm in assembly language(8086) with
a) Calculating the average value of array elements and assigning it to the variable avg,
b) Implementing the Quick Sorting algorithm in assembly language(8086) with the option a
Write the code in the blank space below, explain the code.
n= 10 (size of array)
a[10] = { 9, 7, 5, 11, 12, 2, 14, 3, 10, 6 }
Answer:
MY_DATA SEGMENT PARA 'DATA'
n DB 10
a DB 5, 2, 3, 6, 12, 7, 14, 9, 10, 11
avg DW ?
MY_DATA ENDS
MY_CODE SEGMENT PARA 'CODE'
MY_PROG PROC FAR
ASSUME CS:MY_CODE, DS:MY_DATA
MOV AX,MY_DATA
MOV DS,AX
// ADD CODE HERE
MOV AH, 04CH
INT 21H
RET
MY_PROG ENDP
MY_CODE ENDS
END MY_PROG
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
