.model small
.stack 100h
.code

start:
xor cx, cx

mov ah, 1h
@loop:
int 21h

cmp al, 0dh
je @end
push ax
inc cx
jmp @loop

@end:
mov ah, 2h
dis:
pop ax
int 21h
loop dis

mov ah, 4ch
int 21h

end start

The first thing you should understand is how commands group together.
Certain values are set and then an interrupt is issued.
When that happens, an effect takes place.

Reference

So, if you look at your first grouped "command", you see AH is being set to 1 and in interrupt 21 is then issued.

If you look at that reference for 21h, what do you see happens if AH is set at 1 and that interrupt is issued?

Once you learn that, you can learn anything dealing with this.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.