Question: Hi I need help with a simple assembly language program to calculate some geometric information for trapezoid in a series of trapezoids. Specifically, the program

Hi I need help with a simple assembly language program to calculate some geometric information for trapezoid in a series of trapezoids. Specifically, the program will find the area and perimeter for each of the trapezoid in a set of trapezoids. Once the values are computed, the program should find the minimum, maximum, middle value, sum, and average for the areas and perimeters.

Since the list is not sorted, we will estimate the median value as follows. For an odd length list, the estimated median is computed by summing the first, last, and middle values and dividing by 3.

The formulas for trapezoid area and perimeter are as follows:

trapAreas[n] = bSides[n] ((aSides[n]cSides[n])/ 2)

trapPerims[n] = aSides[n] + 2 bSides[n] + cSides[n] Do not change the sizes/types of the provided data sets. All data is unsigned. As such, the DIV/MUL

would be used (not IDIV/IMUL). The JA/JB/JAE/JBE must be used (as they are for unsigned data).

There is no provided main. You may declare additional variables as needed.

Provided Code:

section .data

; Provided Data

aSides dd 1145, 1135, 1123, 1123, 1123

dd 1254, 1454, 1152, 1164, 1542

dd 1353, 1457, 1182, 1142, 1354

dd 1364, 1134, 1154, 1344, 1142

dd 1173, 1543, 1151, 1352, 1434

dd 1355, 1037, 1123, 1024, 1453

dd 1134, 2134, 1156, 1134, 1142

dd 1267, 1104, 1134, 1246, 1123

dd 1134, 1161, 1176, 1157, 1142

dd 1153, 1193, 1184, 1142

bSides db 10, 14, 13, 37, 54

db 31, 13, 20, 61, 36

db 14, 53, 44, 19, 42

db 27, 41, 53, 62, 10

db 19, 28, 14, 10, 15

db 15, 11, 22, 33, 70

db 15, 23, 15, 63, 26

db 24, 33, 10, 61, 15

db 14, 34, 13, 71, 81

db 38, 73, 29, 17

cSides dw 133, 114, 173, 131, 115

dw 164, 173, 174, 123, 156

dw 144, 152, 131, 142, 156

dw 115, 124, 136, 175, 146

dw 113, 123, 153, 167, 135

dw 114, 129, 164, 167, 134

dw 116, 113, 164, 153, 165

dw 126, 112, 157, 167, 134

dw 117, 114, 117, 125, 153

dw 123, 173, 115, 106

length dd 49

areaMin dd 0

areaMid dd 0

areaMax dd 0

areaSum dd 0

areaAve dd 0

perimMin dd 0

perimMid dd 0

perimMax dd 0

perimSum dd 0

perimAve dd 0

; ---------------------------------------------------

; Uninitialized Data

section .bbs

trapAreas resd 49

trapPerims resd 49

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!