Beginner, small program to count ascii

I need some help writing a small program in assembly that has a variable named STRING that stores up to a 20 byte string with mixed upper and lower case.
I then need to count the upper and lower cases of letters in STRING and seperately store each total of upper and lower case in different locations: eg

STRING db 'My nAme iS Mr sMIth'
UPPER db ?
LOWER db ?
so, the end result should store in UPPER is 6
and the number of lower case in LOWER should store the number 9

I am not sure how to do this. Do I need to do BCD to ASCII conversion?
I am using MASM. 2.44
If anyone has any suggestions I would like to hear from you because being a beginner is tough enough

Comments

  • Upper case numbers are 65 to about 90 in binary. The lower case ones are 97 to 122...I think. Check for these ranges in your string.

    : I need some help writing a small program in assembly that has a variable named STRING that stores up to a 20 byte string with mixed upper and lower case.
    : I then need to count the upper and lower cases of letters in STRING and seperately store each total of upper and lower case in different locations: eg
    :
    : STRING db 'My nAme iS Mr sMIth'
    : UPPER db ?
    : LOWER db ?
    : so, the end result should store in UPPER is 6
    : and the number of lower case in LOWER should store the number 9
    :
    : I am not sure how to do this. Do I need to do BCD to ASCII conversion?
    : I am using MASM. 2.44
    : If anyone has any suggestions I would like to hear from you because being a beginner is tough enough
    :
    :

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion