Write and run a program that adds 5 bytes of data and saves the result. The data should be the following hex numbers: 25, 12, 15, IF, and 2B. Show the program and the snapshot of the output. The beginning of the program is given:
.MODEL SMALL
.STACK 0100h
.DATA
DATA_IN DB 25H, 12H, 15H, 1FH, 2BH
sum db?
I'm not able to get the output in hexadecimal. I have tried this code but still cant get the output I want:
.model small
.stack 100h
.data
data_in db 25H, 12H, 15H, 1FH, 2BH
sum db ?
msg1 db 'The result is : $' ;
.code
mov ax,@data
mov ds,ax
lea si,data_in
mov al,[si]
mov cx, 4
again:
inc si
add al, [si]
loop again
mov sum,al
lea dx, msg1
mov ah,09h
int 21h
mov ah, 2
mov dl, SUM
int 21h
mov ah,4ch ; end operation
int 21h
end