'map counter, 4
Key W Count The Words
'home
'text ^S^T
'crt CUROFF
'counter=0
loop:
'text ^W
'eol
'beq check
'range AZ az
'ifeq
(counter=counter+1
'endif
'jmp loop
check:
'eof
'bne loop
'text ^M^M
'print "There are ";counter;" words in this document"
'crt curon
'stop