Answer to Question #277462 in Assembler for Ahmed Ali

Question #277462

Write an assembly language program to find the sum of the following series:

Sum = 1 + 2 + 3 + 4 + ......................... 100.


1
Expert's answer
2021-12-08T16:29:35-0500
TITLE task.asm

; Description: The program   to find the sum of the following

;series: Sum = 1 + 2 + 3 + 4 + ......................... 100

 

INCLUDE Irvine32.inc

 

.data

msgSum                      BYTE    "Sum: ", 0

 

.code

main PROC

mov edx, OFFSET msgSum

call WriteString                                   ; "Sum: "

 

mov ecx,100

            xor eax, eax

            mov ebx, 1

             

l1:

            add eax, ebx

            inc ebx

loop l1

quit:

            call writeDec

            call CrLf

            call CrLf

Invoke ExitProcess, 0              ; exit

main ENDP

 

END main

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS