1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

help in code

Discussion in 'Assembly Language Programming (ALP) Forum' started by super man, Jan 2, 2012.

  1. super man

    super man New Member

    Joined:
    Jan 2, 2012
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    hi all>>> H.N.Y
    plz help in an assimbly code that count the number of a's in string
    'i am playing football in univercity'
    and save the count in register AX.
    and another code that searching for AB in memory from ABCD:1000 to ABCD:2000 if it found ab print ' AB found' if not print ' AB not found


    thx for help :nonod::cuss::freak:

    :disappoin
     
    Last edited by a moderator: Jan 2, 2012
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,293
    Likes Received:
    365
    Trophy Points:
    83
    Do you think posting with such big fonts will make big impact?
     
  3. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,012
    Likes Received:
    203
    Trophy Points:
    0
    Occupation:
    Senior Support Engineer
    Location:
    England
    For the first, set a variable V to zero, loop over the string, and check each character to see if it's an 'a'. If it is, then increase V by 1.

    The second one is even easier; you don't have to wait until the loop ends and can bail out at the first occurrence. Therefore you don't even need V.
     

Share This Page