Objectives of the project To assess your understanding of basic programming stru
ID: 3822137 • Letter: O
Question
Objectives of the project To assess your understanding of basic programming structures in assembly language. To assess your knowledge of programming with MASM (Microsoft Macro Assembler) and Visual Studio Problem Description & Programs Write an assembly language program in MASM to perform the following tasks: Write a program that computes the sum of a sequence of integers. The program consists of the following procedures: 1) main: calls genData to generate an array of 10 random numbers (0-99), calls displayArray to display the random numbers, calls countNumbers to count the number of elements in the array that are greater than 50, calls displayCount to display the counting result. 2) genData: generate 10 random numbers (0 ~ 99) 3) displayArray: display the array 4) countNumbers: counts the number of elements that are greater than 50. 5) DisplayCount: displays the counting result A sample of run: The random numbers are: 12 3 67 34 52 78 11 18 43 83 There are 4 numbers that are greater than 50Explanation / Answer
Solution ::
assume that cs:code,
ds:data
data segment
org 2100h
series dw 1234h,2345h,0abcdh,103fh,5455h,1456h,5678h,1432h,3225h,108eh
sum dw 00h
carry dw 00h
data ends
code segment
begin: mov ax,data
mov ds,ax
mov ax,00h
mov bx,00h
mov cx,05h
mov si,2100h
move: add ax,[si]
adc bx,00h
inc si
inc si
dec cx
jnz move
mov sum,ax
mov carry,bx
mov ah,4ch // move 4ch into ah
int 21h
code ends
end begin // end of code
// ** thank you **//
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.