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
 

 

LNR, LPR and LCR Instruction

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

New User


Joined: 19 Feb 2010
Posts: 27
Location: India

PostPosted: Fri Dec 10, 2010 1:16 pm    Post subject: LNR, LPR and LCR Instruction
Reply with quote

Hello,

1. In LNR instruction, If the source register(Operand 2) contents are X'FFFFFFFF', then what will be loaded in the Dest. register(1st Operand)?

2. In LNR instruction, If the source register(Operand 2) contents are X'00000000', then what will be loaded in the Dest. register(1st Operand)?

3. How LPR will work in above situation?

4. Does it mean that, LCR can be replaced by LNR and LPR or is there any other difference between LCR and LPR, LNR?

Can anybody help me?


Thank you,
Vijay
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: Fri Dec 10, 2010 2:47 pm    Post subject: Reply to: LNR, LPR and LCR Instruction
Reply with quote

The answer to number one is X'00000001' (positive 1).

The answer to number two is X'00000000' (positive zero). Negative zero is illogical. But, you need to try this.

The answer to number three would be the negative sending register value would be equal to its positive counterpart. X'FFFFFFFF' becomes X'00000001'.

The answer to number four is whatever positive or negative value is in the sending register, it's negative or positive complement will be the result in the receiving register. X'FFFFFFFF' becomes X'00000001'.

I guess in certain situations LPR and LNR can be replaced by LCR, but that's entirely up to the programmer. Keeping the code self-documenting overrides "cuteness". icon_wink.gif

Review the POPS Manual link which I had given you several days ago and (to avoid possible future flaming), please test these instructions yourself. icon_eek.gif

As an alternative (and less intimidating than POPS), review the "Assembler Connection" at ===> http://www.simotime.com

FWIW, in COBOL, when you move a signed fullword-binary field to an unsigned fullword-binary field, the compiler generates a LPR before populating the unsigned fullword-binary field. This is to ensure an absolute value, which will then be addressed as a positive value.

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 Interpret instruction not working in ... spoorni CLIST & REXX 2 Fri Feb 07, 2014 10:22 pm
No new posts Displaying the value set by the EXIT ... Ricardo Viegas CLIST & REXX 12 Tue Dec 03, 2013 5:17 am
No new posts Data studio(for zos) instruction manual srilata83 DB2 2 Fri Jan 18, 2013 10:37 am
No new posts AL1(XXX) usage in DC instruction yugendran PL/I & Assembler 1 Thu Dec 06, 2012 3:59 pm
No new posts Assembler compare instruction Arunkumar Chandrasekaran PL/I & Assembler 3 Thu Jul 19, 2012 11:49 pm


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