slr instruction



High Level Assembler(HLASM) for MVS & VM & VSE

slr instruction

Postby Pankaj7985 » Tue May 25, 2010 12:03 pm

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
Pankaj7985
 
Posts: 4
Joined: Tue May 18, 2010 12:38 pm
Has thanked: 0 time
Been thanked: 0 time

Re: slr instruction

 

Re: slr instruction

Postby dick scherrer » Tue May 25, 2010 11:56 pm

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).
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: slr instruction

Postby Lindovaldo » Wed May 26, 2010 9:57 pm

SLR 0,0 /* equal "MOVE ZEROS TO REGISTER 0"
/* register0 = register0 - register0

Lindovaldo
Lindovaldo
 
Posts: 5
Joined: Thu Mar 11, 2010 11:56 pm
Has thanked: 0 time
Been thanked: 0 time

Re: slr instruction

Postby steve-myers » Thu Jun 03, 2010 6:29 pm

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.
steve-myers
Global moderator
 
Posts: 1885
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 197 times


Return to Assembler

 


  • Related topics
    Replies
    Views
    Last post