IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

LNR, LPR and LCR Instruction


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
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
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: 2501
Location: Atlanta, Georgia, USA

PostPosted: Fri Dec 10, 2010 2:47 pm
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 ===> 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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
This topic is locked: you cannot edit posts or make replies. Assembler - Packed Decimals - PACK in... PL/I & Assembler 3
No new posts Using L' to get length of instruction PL/I & Assembler 1
No new posts LA instruction in assembler PL/I & Assembler 4
No new posts The Test under Mask (TM) Instruction PL/I & Assembler 7
No new posts Control-M restart instruction CA Products 2
Search our Forums:

Back to Top