View previous topic :: View next topic
|
Author |
Message |
himanshupant
New User
Joined: 21 Mar 2007 Posts: 46 Location: India
|
|
|
|
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 |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
I'd guess that R1 becomes the mask. |
|
Back to top |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
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 |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
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 |
|
|
Mickeydusaor
Active User
Joined: 24 May 2006 Posts: 258 Location: Salem, Oregon
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Yup, but we often write things more elegant than what we inherit. . . |
|
Back to top |
|
|
bengtpelle
New User
Joined: 28 Aug 2006 Posts: 24 Location: St. Petersburg, FL
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
bengtpelle
New User
Joined: 28 Aug 2006 Posts: 24 Location: St. Petersburg, FL
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Mickeydusaor
Active User
Joined: 24 May 2006 Posts: 258 Location: Salem, Oregon
|
|
|
|
They would have had to modifed somewheres else in the code. |
|
Back to top |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
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 |
|
|
|