i need to count words, where is more big letters than numbers.
I use inr c
if big letter is in word and dcr c
if there is number. At the end of word i try c>0, if it is true, I do inr d
. d
is number of words with more big letters than numbers. Problem is, that c>0 is always true. (i think, because it count all words).
cpi 'A' ;find if it is letter
jnc mozno_pismeno
cpi '9'+1 :find if it is number
jc mozno_cislo
mozno_pismeno: ;maybe it is letter
cpi 'Z'+1 ;second chceck if it is letter
jc je_to_pismeno
jmp getchar_main
je_to_pismeno: ;it is letter so inr c
inr c
jmp getchar_main
mozno_cislo: ;maybe it is number
cpi '0' ;second check if it is number
jnc je_to_cislo
jmp getchar_main
je_to_cislo: ;it is number so dcr c
dcr c
jmp getchar_main
koniec_slova: ;it is end of the word
mov a,c
cpi 1 ;if c>0 that mean that there was more letters
jnc ma_viac_pismen
mvi c,0 ;prepare c for next one character
jmp getchar_main
ma_viac_pismen: ;c>0 so inr d
inr d
mvi c,0 ;prepare c for next one character
jmp getchar_main