;This program inputs a string which is exactly 50 (dec) chars long
;starting at location 300h
;Output: num of caps - 2ffh
mov si, 0 ;offset into string
mov cl, 0 ;num of caps
lp: cmp byte ptr 300h [si], 'A' ;below an 'A', not a cap
jb nxtbyte
cmp byte ptr 300h [si], 'Z' ;above a 'Z', not a cap
ja nxtbyte
inc cl ;i.e., add 1 to cl
nxtbyte: inc si
cmp si, 50
jb lp
mov byte ptr 2ffh, cl
int 20h