help in code

super man's Avatar, Join Date: Jan 2012
Newbie Member
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

Last edited by shabbir; 2Jan2012 at 18:52.. Reason: Unreadable font
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Do you think posting with such big fonts will make big impact?
xpi0t0s's Avatar, Join Date: Aug 2004
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.