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
 

 

How can i display / define the negative values assembler?

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

New User


Joined: 19 May 2005
Posts: 31

PostPosted: Thu Mar 13, 2008 7:54 pm    Post subject: How can i display / define the negative values assembler?
Reply with quote

Hello ,


I have a preliminary question about assembler. How can i display negative values using WTO macro.



thanks,
Gafur
Back to top
View user's profile Send private message

Bill O'Boyle

CICS Moderator


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

PostPosted: Thu Mar 13, 2008 8:22 pm    Post subject: How can i display / define the negative values assembler?
Reply with quote

Ultimately, you'd have to UNPACK the data into a display-workarea large enough to hold the number, such as a CL16.

Then, test the source-field of this data and determine of it's positive or negative and insert the appropriate sign in the 1st-byte of the CL16.

If the source-data is in a halfword or fullword, then you're going to have to load it into a work-register and issue a CVD into an aligned-doubleword, with the sign-nibble resolving to either a 4-Bit "C" or "D", with the latter representing a negative value.

Now, you could be fooled if the halfword value exceeds 32767, but it really represents a positive value, such as 65535. So, I would move the halfword to the low-order of a fullword work-area, clear the high-order of the fullword to X'0000' and then load this fullword into the work-register, followed then by the CVD.

To me, this is an easy method and you don't need to define an edit-pattern and use the ED instruction (YUK!).

HTH....

Regards,

Bill
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 A not very Christmassy PL/I tale, wit... prino PL/I & Assembler 3 Mon Dec 26, 2016 1:01 am
No new posts Display ZEDLMSG without Pressing F1 &... anandgbe CLIST & REXX 8 Thu Dec 15, 2016 4:20 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts Overlaying one set of charater values... Kevin Lindsley SYNCSORT 7 Sat Nov 05, 2016 3:21 am
No new posts Low values Results from VARCHAR FORMAT balaji81_k DB2 10 Thu Oct 20, 2016 1:18 am


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