Answer to Question #260307 in Assembler for Jsjs

Question #260307

Write a program that adds ten numbers and store the result in register AX,BX,CX,DX and DS

1
Expert's answer
2021-11-02T14:43:19-0400
DATA SEGMENT
DATA ENDS

CODE SEGMENT
ASSUME DS:DATA,CS:CODE
START:
    MOV AX,DATA
    MOV DS,AX
    MOV ES,AX    

    mov ax,10
    add ax,2    ; ax = 10+2
    MOV DS,AX    ; move result to DS
    
    mov ax,3
    add ax,2    ; ax = 2+3

    mov bx,4
    add bx,8    ; bx = 4+8
    
    mov cx,4
    add cx,1    ; cx = 4+1
    
    mov dx,8
    add dx,4    ; dx = 8+4
    
    mov ah, 4ch
    int 21h

CODE ENDS
END START




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