Question: How can i make this code work in assembly language Kip Irvine.32 (it appears to be a type of assembly code but is not working
How can i make this code work in assembly language Kip Irvine.32 (it appears to be a type of assembly code but is not working for #INCLUDE Irvine.32) These are two separate programs.
1) Calculating the average of ten numbers by accesing the array using indexed operands.
DATA SEGMENT
A DB 1,2,3,4,5,6,7,8,9,10
SUM DB ?
DATA ENDS
CODE SEGMENT
ASSUME DS:DATA, CS:CODE
START:
MOV AX, DATA
MOV DS, AX
LEA BX, A
MOV CL,10
MOV AX, 0000
L1:ADD AL,BYTE PTR[BX]
INC BX
DEC CL
CMP CL, 00
JNZ L1
MOV SUM, AL
MOV BH,10
DIV BH
MOV AH, 4CH
INT 21H
CODE ENDS
END START
2) AVERAGE OF TEN NUMBERS USING ACCESS ARRAYS USING POINTERS
DATA SEGMENT
ARRAY DB 1,4,2,3,8,6,7,5,9
AVG DB ?
MSG DB "AVERAGE = $"
ENDS
CODE SEGMENT
ASSUME DS:DATA CS:CODE
START:
MOV AX, DATA
MOV DS, AX
LEA SI, ARRAY
LEA DX, MSG
MOV AH, 9
INT 21H
MOV AX,00
MOV BL, 9
MOV CX, 9
LOOP1:
ADD AL, ARRAY[SI]
INC SI
LOOP LOOP1
DIV BL
ADD AL, 30H
MOV DL, AL
MOV AH, 2
INT 21H
MOV AH, 4CH
INT 21H
ENDS
END START
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
