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
 
To decrement the value in one byte field by one.

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

New User


Joined: 24 Jul 2009
Posts: 51
Location: Pune

PostPosted: Sat Jul 25, 2009 1:31 am    Post subject: To decrement the value in one byte field by one.
Reply with quote

I have a one byte field in the input file . The value could be a hexadecimal from 00 to 99 .

I have to decrement the value by 1 and update the 1 byte field with new value.

What is the most efficient and shortest way of doing it in assembler .Please help with the code.
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10327
Location: italy

PostPosted: Sat Jul 25, 2009 1:41 am    Post subject: Reply to: To decrement the value in one byte field by one.
Reply with quote

post what You have devised, and we' ll comment on it

this is a help forum, not a do it for me one icon_smile.gif
Back to top
View user's profile Send private message
Pankaj Shrivastava
Currently Banned

New User


Joined: 24 Jul 2009
Posts: 51
Location: Pune

PostPosted: Sat Jul 25, 2009 1:56 am    Post subject:
Reply with quote

Ok Enric icon_smile.gif

This is what i have designed :

SR R5,R5
IC R5,VAR1BYTE
SH R5,=H'1'
STC R5,VAR1BYTE


Your comment please.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2504
Location: Atlanta, Georgia, USA

PostPosted: Sat Jul 25, 2009 2:04 am    Post subject: Reply to: To decrement the value in one byte field by one.
Reply with quote

Looks OK. You can eliminate the 2-Byte H'1' Literal by using -

Code:

AHI R5,-1    SUBTRACT 1 FROM R5 (CC SET)

or you can use -

Code:

BCTR R5,0    SUBTRACT 1 FROM R5 (CC NOT SET)

There isn't any SHI, so using the AHI adding a negative 1 will work.

FWIW, BCTR R0,0 will not work....

Bill
Back to top
View user's profile Send private message
Pankaj Shrivastava
Currently Banned

New User


Joined: 24 Jul 2009
Posts: 51
Location: Pune

PostPosted: Sat Jul 25, 2009 2:08 am    Post subject:
Reply with quote

Thx Bill icon_smile.gif
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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Partial color change of a field in CI... waseem0424 CICS 5 Fri Sep 29, 2017 7:56 pm
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts JES2 job size field matching Windows ... SRICOBSAS All Other Mainframe Topics 4 Tue Sep 05, 2017 5:49 pm

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