+ Reply to Thread
Results 1 to 2 of 2

Thread: get the summation of array elements

  1. #1
    Junior Member
    Join Date
    Jan 2012
    Posts
    15

    get the summation of array elements

    I would like to Write an Assembly language gets the summation of array elements [125,235,197,91,48]

  2. #2
    Junior Member
    Join Date
    Jan 2012
    Posts
    40
    Code:
    .model small
    .data
    count equ 05
    DATA1 db 125,235,197,91,48
    sum dw  ?
    .code
    start:
        mov ax,@data
        mov ds,ax
        mov cx,count
        mov SI,OFFSET DATA1
        mov ax,0000h
        back:add al,[SI]
        inc SI
        dec cx
        jnz back
        mov sum,ax
        mov ah,4ch
        int 21h
    end start

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts