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 line 52: Name or string > 250 char... Ashishpanpaliya CLIST & REXX 5 Sat Oct 14, 2017 2:29 am
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts Accessing CICS tran with map from JCL... navdeepaggarwal CICS 5 Tue Oct 03, 2017 6:15 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
No new posts column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm

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