Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
assembler program to count no. of digits in a string

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
parikshit123

Active User


Joined: 01 Jul 2005
Posts: 269
Location: India

PostPosted: Mon Aug 28, 2006 1:04 pm    Post subject: assembler program to count no. of digits in a string
Reply with quote

Hi folks,

I need an assembler program to count no. of digits in a string.

Can anyone please help me?

I am new to assembler.

Thanks,
Parikshit.
Back to top
View user's profile Send private message

bengtpelle

New User


Joined: 28 Aug 2006
Posts: 24
Location: St. Petersburg, FL

PostPosted: Mon Aug 28, 2006 9:15 pm    Post subject: Digits in a string
Reply with quote

I like to use registers for all processing of this type. Here is an example using 3 registers:

Code:
          SR    2,2        Set counter to zero
          LA    3,String   Start of string
          LA    4,10       Length of string
LOOP      TM    0(3),X'F0' Test if it is a digit
          BNO  *+8         If not a digit, bypass next instruction
          LA    2,1(2)     Add one to counter
          BCT   4,LOOP     Loop the length of the string

Register 2 now contains number of digits.
icon_biggrin.gif
Back to top
View user's profile Send private message
parikshit123

Active User


Joined: 01 Jul 2005
Posts: 269
Location: India

PostPosted: Tue Aug 29, 2006 12:44 am    Post subject: Re: assembler program to count no. of digits in a string
Reply with quote

Hi,

Thanks a lot.

It was really good solution.

well, I welcome other solutios as well.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Skip records depends on count lakshmiibmmainframes DFSORT/ICETOOL 5 Sun Dec 24, 2017 9:51 pm
No new posts The same REXX program doesnt work for... jackzhang75 CLIST & REXX 5 Wed Dec 06, 2017 2:51 am
No new posts ISMF Difference between volume count ... upendrasri IBM Tools 2 Tue Dec 05, 2017 12:40 pm
No new posts Calling IKJEFT01 program from Rexx upendrasri CLIST & REXX 8 Wed Nov 15, 2017 4:27 pm
No new posts line 52: Name or string > 250 char... Ashishpanpaliya CLIST & REXX 5 Sat Oct 14, 2017 2:29 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us