Print Alphabets from A to Z using Assembly Language Program in 8086
stack segment
stack ends
data segment
data ends
code segment
mov ah,02h
mov cx,26
mov dl,65
lop:
int 21h
add dl,1
loop lop
mov ax,4c00h
int 21h
code ends
end
stack segment
stack ends
data segment
data ends
code segment
mov ah,02h
mov cx,26
mov dl,65
lop:
int 21h
add dl,1
loop lop
mov ax,4c00h
int 21h
code ends
end
There is no code in stack and data segment of this program, mov dl,65 dl having the 65 in decimal which is code ascii code for the 'A'. and it will be increment by 1 by add dl,1 in to loop lop: int 21h is used to print the value to the output screen.
The variable cx having the value 26 which is decremented by 1 at every execution of iteration of the loop lop.
It will helps to print only 26 alphabets on to the screen.
output :
A
B
C
.
.
.
Z
For learning Subjects of BCA, MCA, Engineering, Diploma visit website : www.vataliyatuitionclasses.com
No comments:
Post a Comment