Average of block of bytes in Assembly -masm 8086

Average of block of bytes in Assembly -masm 8086

org 100h
.model small
.data
ARR DB 10,9,8,7,6,5,4,3,2,1
arr_size = $ - offset ARR
sum db 0
avg db 0
.code
;Initilize Data Segment
mov ax,@DATA
mov DS,ax
;====find total sum of array
lea si,arr
mov cl,arr_size
mov ch,00h
L:
mov ah,sum
add ah,[si]
mov sum,ah
inc si
LOOP L
;=====find average==========
mov al,sum
mov ah,00h
mov bl,arr_size
div bl
mov avg,al
;to terminate program
mov ah,4ch
int 21h
ret

3 thoughts on “Average of block of bytes in Assembly -masm 8086

  1. You really make it appear so easy together with your presentation but I find this topic to be really something that I think I might by no means understand. It kind of feels too complicated and very huge for me. I am having a look ahead for your subsequent submit, I will attempt to get the cling of it!

    Liked by 1 person

  2. Fantastic site. Lots of helpful information here. I am sending it to a few friends ans additionally sharing in delicious. And of course, thank you for your sweat!

    Liked by 1 person

  3. hi!,I really like your writing very a lot! percentage we keep in touch extra approximately your post on AOL? I need an expert on this space to solve my problem. Maybe that’s you! Looking forward to look you.

    Liked by 1 person

Leave a comment