Page 1 of 1

slr instruction

PostPosted: Tue May 25, 2010 12:03 pm
by Pankaj7985
Hi,
I have a code i want to know what does the instruction SLR perform in that I know that the instructions subtracts the right four in operand 2 with operand one and stores in opreand one
IF    EQ                                           
      BCTR  R0,0                SET TRUE           
      MVI   T360DAYS,C'Y'                           
      ZAP   TFDAYS,=P'360'                         
ELSE                                               
      SLR   R0,0                DEFAULT TO FALSE   
JOIN                                                                                                                                                                                 

R0 has the value 4.
I want to know the what the instruction does in the code

Re: slr instruction

PostPosted: Tue May 25, 2010 11:56 pm
by dick scherrer
Hello,

Look here and bookmark the page - you will use it regularly. . .
http://publibz.boulder.ibm.com/cgi-bin/ ... /CCONTENTS

Search for slr in that manual (the flashlight/tubelight is the search).

Re: slr instruction

PostPosted: Wed May 26, 2010 9:57 pm
by Lindovaldo
SLR 0,0 /* equal "MOVE ZEROS TO REGISTER 0"
/* register0 = register0 - register0

Lindovaldo

Re: slr instruction

PostPosted: Thu Jun 03, 2010 6:29 pm
by steve-myers
SLR is a subtract instruction. It "moves" 0s to register 2 because the result of the subtraction is always 0. 4 - 4 = 0. There are other ways to do this, for example

L 2,=F'0'

This instruction really does "move" 0s to register 2.

The possible bad news about SLR is it alters the current condition code, which is not always desirable. The L instruction does not alter the condition code.