Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; You may customize this and other start-up templates;
- ; The location of this template is c:\emu8086\inc\0_com_template.txt
- org 100h
- .data
- A db 1,2,3,4,5,6,7,8,9
- B db 0
- message db 'Enter the value of N: $'
- .code
- main proc
- mov ax,@data
- mov ds,ax
- xor ax,ax
- xor cx,cx
- mov si,offset A
- mov di,offset B
- mov dx,offset message
- mov ah,09
- int 21h
- mov ah,01h
- int 21h
- mov cl,al
- sub cl,48
- xor al,al
- xor bl,bl
- loop_1:
- mov al,[si]
- mul al
- add bl,al
- inc si
- loop loop_1
- mov ah,02h
- mov dl,13
- int 21h
- mov dl,10
- int 21h
- xor ah,ah
- mov al,bl
- mov bl,10
- div bl
- mov bl,ah
- mov dl,al
- add dl,48
- mov ah,02h
- int 21h
- mov dl,bl
- add dl,48
- mov ah,02h
- int 21h
- main endp
- end main
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement