Howdy, Stranger!

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

Categories

Beginner, small program to count ascii

singerksingerk Member Posts: 11
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

  • slicer69slicer69 Member Posts: 272
    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
    :
    :

  • Andre YoungAndre Young USAMember Posts: 0

    ____ < http://forcoder.org /> free video tutorials and ebooks about { Ruby Python Scratch Delphi Go Swift PHP PL/SQL C# Java Visual Basic .NET R C Objective-C C++ Perl JavaScript Visual Basic Assembly MATLAB FoxPro D Erlang Prolog Apex Clojure Bash Lua Scala COBOL SAS LabVIEW Lisp Hack F# Julia Fortran Ada Crystal Scheme Awk VBScript Kotlin Rust ML Logo Transact-SQL Alice ABAP Dart } __

Sign In or Register to comment.