;count the number of capital letters in a string
.model small
.code
start:  mov     ax, @data
	mov     ds, ax
	mov     es, ax

	mov     di, 0
agin:   mov     al, msg [di]    ;get each letter in sequence
	cmp     al, 'A'         ;is it a capital letter??
	jb      nxt
	cmp     al, 'Z'
	ja      nxt
	inc     count
nxt:    inc     di
	or      al, al          ; wow!  sets some flags!!
	jnz     agin

	mov     ah, 4ch         ;return to dos
	mov     al, 00          ;error level 0 (no error)
	int     21h             ;dos function call

.data
msg       db  'Hello Out There!!!',42H,0
count     db   0
.stack 100h

	end start