question archive Repeat below code - use a posttest loop and indexed addressing to calculate the
Subject:Computer SciencePrice: Bought3
Repeat below code - use a posttest loop and indexed addressing to calculate the .sum of the "table" values.
.data
table db '0123456789'
table size equ $ - offset table
.code
mov ax,@data
mov ds,ax
lea si,table ; load effective address for addition
xor di,di; arithmetic xor operation
mov cx,10 ; getting the length of table elements
xor ax,ax
tsum: ; loop entry
add al,table[di] ; addition of table elements
inc di ; count increment
loop tsum ; loop repeats till all elements are added
mov sum,ax ; resulting arithmetic sum
mov ah, 4ch ;1st line of interrupt
int 21h ;2nd line of interrupt which will exit the code