Pages

Wednesday, January 13, 2016

Write a program that print A 5 times in output by loop


Program/Code:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
mov Bx, 5
mov ah, 2
mov dl,'A'
loopLabel:
int 21h
sub Bx, 1
Cmp Bx, 0
JNE LoopLabel

Output:
AAAAA

Print * 5 times in output by loop keyword

Program/Code:

1
2
3
4
5
6
mov Cx, 5
mov Ah, 2
Label:
mov dl, '*'
int 21h
loop label

Output:
*****

No comments:

Post a Comment