
185
; If f lag bit is set, then increment word count (R6) by 1, else quit.
; is is necessary when array terminates with a character other than space.
JNB 00H, OVER ; f lag bit is cleared
INC R6 ; add up the last word
OVER: MOV A, R6 ; the accumulator collects word count
RET ; done
13.8 | GENERATE PRIME NUMBERS
The problem becomes much simpler if it is assumed that there would be no space at
the beginning and there would be only one space between any two words. The reader
may rewrite the program with these assumptions.
13.8 | Generate Prime Numbers
Example 13.8
Purpose: Highlighting multiple types of data-manipulation operations ...