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 Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
No new posts A not very Christmassy PL/I tale, wit... prino PL/I & Assembler 3 Mon Dec 26, 2016 1:01 am
No new posts I can not compile my program PL1 V3.R... Miguel Fernandez PL/I & Assembler 13 Tue Dec 06, 2016 8:30 pm
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm


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