Posts

Showing posts from March, 2022

Assembly language program to display sum of all even numbers between 1 to 100

Image
Code org 100h .stack 100h .data string db "sum of all even number is: $"  sum dw 0 .code  main proc     mov ax,@data     mov ds,ax          mov ax,0     mov cx,0          l1:     add ax,cx     add cl,2     cmp cl,100     jle l1          mov dx,0     mov bx,10     mov cx,0          l2:     div bx     push dx     mov dx,0          mov ah,0     inc cx     cmp ax,0     jne l2               mov dx,offset string     mov ah,09     int 21h          mov ah,02h     l3:     pop dx     add dx,48     int 21h     loop l3               mov ah,4ch ...