Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts Dump analysis of an assembler module monica1 PL/I & Assembler 4 Tue May 09, 2017 10:05 am
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us