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
 

 

Working of EX instruction and TM instruction

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

New User


Joined: 21 Mar 2007
Posts: 46
Location: India

PostPosted: Fri Apr 13, 2007 10:42 am    Post subject: Working of EX instruction and TM instruction
Reply with quote

In a code fragment as below

EX R1,LABEL
BNO END
.
.
.

LABEL TM SWITCH1,X''00'
.
.
.
SWITCH1 DC XL1'00'

As per the processing of EX , the R1 takes in some value whose rightmost byte is used as a modifier .But with reference to the target instruction ( TM ) in our case , how will the R1 influence its processing ?

2) If we execute the LABEL in isolation , then the condition code will always be 00 .Right ??
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Fri Apr 13, 2007 10:57 am    Post subject:
Reply with quote

I'd guess that R1 becomes the mask.
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 743
Location: Germany

PostPosted: Thu Apr 19, 2007 5:51 pm    Post subject:
Reply with quote

Hi There !

Sorry, the TM instruction doesn't influence content of R1. In the Example R1 is used for the EX instruction. So it only has to keep the correct length for the desired instruction. In this case zero because TM is a one-byte instruction. TM compares one byte with a direct-value. Only the brach-code is set.

One could also have coded:

L R1,=A(Byte) ...adress of Field
TM 0(R1),240 ...is it numeric
BO XYZ ...yes it is

For example TRT influences R1 and R2.

Regards, UmeySan
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Thu Apr 19, 2007 6:02 pm    Post subject:
Reply with quote

UmeySan,
The bits 24-31 of the register are ORed with bits 8-15 of the instruction, which normally is the length bits, but for the TM they are the immediate operand.
himanshupant had it right about R1 influencing the TM.
Back to top
View user's profile Send private message
Mickeydusaor

Active User


Joined: 24 May 2006
Posts: 258
Location: Salem, Oregon

PostPosted: Fri Apr 20, 2007 3:54 am    Post subject:
Reply with quote

I'm sorry but this is A total waste of coding, when you could have just
tested the field.

TM SWITCH1,X'00'
BNO END
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Apr 20, 2007 4:45 am    Post subject:
Reply with quote

Yup, but we often write things more elegant than what we inherit. . . icon_smile.gif
Back to top
View user's profile Send private message
bengtpelle

New User


Joined: 28 Aug 2006
Posts: 24
Location: St. Petersburg, FL

PostPosted: Sat Apr 21, 2007 8:55 pm    Post subject:
Reply with quote

The

TM SWITCH1,X'00'
BNO END

will never branch to end since there is no mask to test agains.

As far as the original question about how the R1 will influence the instructions, the answer is:

The low order byte of the R1 is temporarely OR'ed to the second byte of the TM during the execute. The TM instruction is not changed.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Apr 21, 2007 10:08 pm    Post subject:
Reply with quote

Hello,

Are you sure about this
Quote:
TM SWITCH1,X'00'
BNO END

will never branch to end since there is no mask to test agains.


Is BNO a "branch not one" (i believe it is)? This
Quote:
TM instructions are commonly followed by a branch instruction. The most common ones are:

BZ branch if all bits tested are ZERO

BO branch if all bits tested are ONE

BM branch if tested bits are MIXED

BNZ branch if tested bits are NOT ZERO

BNO branch if tested bits are NOT ONE

BNM branch if tested bits are NOT MIXED
is from an old reference.

Each time a TM is executed the "condition code" is set.

Quote:
A mask bit of one indicates that the storage bit is
to be tested. When the mask bit is zero, the
storage bit is ignored. When all storage bits thus
selected are zero, condition code 0 is set. Condition
code 0 is also set when the mask is all zeros.

When the selected bits are all ones, condition
code 3 is set; otherwise, condition code 1 is set.


As was posted in another recent topic, the mask may be created dynamically before the TM is executed. . .
Back to top
View user's profile Send private message
bengtpelle

New User


Joined: 28 Aug 2006
Posts: 24
Location: St. Petersburg, FL

PostPosted: Sun Apr 22, 2007 12:24 am    Post subject:
Reply with quote

Sorry you are right. Since no bits exist in the mask, you can never have a mask result with any one bit in it.
The BNO will always be taken.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sun Apr 22, 2007 1:34 am    Post subject:
Reply with quote

I'm just curious if this line
Code:
LABEL TM SWITCH1,X''00'
is modified before the code posted in the fragment above is invoked.

Having a label on the TM and having it EXed is one way to indicate the code is being modified at run-time.
Back to top
View user's profile Send private message
Mickeydusaor

Active User


Joined: 24 May 2006
Posts: 258
Location: Salem, Oregon

PostPosted: Mon Apr 23, 2007 7:56 pm    Post subject:
Reply with quote

They would have had to modifed somewheres else in the code.
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 743
Location: Germany

PostPosted: Fri Apr 27, 2007 6:35 pm    Post subject:
Reply with quote

Hi there !

I think that the original question is a real philosophical question.

Fact ist, that the TM instruction has no affect on both operands. Only the branchcode is set.
The original code ist: TM D1(B1),I2


Another fact is that the EX instruction has two different effects.

EX with Register-0 doesn't change anything, it only executes the command at that label.

EX with an other Register, 1-15, modifies that command.
Therefore the second byte of the objectcode is disjunctioned (OR) with the almost rigth byte of the register which is coded in the EX instruction.
This now modified instruction is executed. After the execution this command is reset to its original value.

So you normaly use the EX to modify the length of a mvc,clc,pack,ap or sp instruction.


Also I acknowledge Mickeydusaor, it's a waste of coding. It sucks.

For example TRT influences R1 and R2.
R1 = adress of actual byte.
R2 = content of table

Regards & nice sunny weekend
UmeySan
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 SCRNAME not working on my mainframe? mrsidhu12 TSO/ISPF 7 Thu Sep 01, 2016 2:17 pm
No new posts 2 same CLIST pgm but with different n... boyti ko CLIST & REXX 5 Fri Jun 03, 2016 4:55 pm
No new posts REXX Screen not working due to LINKED... sundarkudos CLIST & REXX 1 Mon May 09, 2016 1:44 pm
No new posts Free FILE not working for specific users sankalp-goyal CLIST & REXX 12 Mon Apr 25, 2016 6:33 pm
No new posts PF7 and PF8 not working in Dynamic area Appu TSO/ISPF 6 Sat Dec 26, 2015 10:15 pm


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