Opcode: BXLE



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

Re: Opcode: BXLE

Postby RISCCISCInstSet » Sun Nov 20, 2011 4:34 am

I think I'm making proper sense of this opcode. Thanks everybody for their help. :mrgreen:
RISCCISCInstSet
User avatar
RISCCISCInstSet
 
Posts: 121
Joined: Mon Oct 17, 2011 1:46 pm
Has thanked: 146 times
Been thanked: 0 time

Re: Opcode: BXLE

Postby steve-myers » Mon Nov 21, 2011 6:37 am

Not very many people use BXLE/BXH. Let's see what you've learned.
         LA    0,1
         LA    1,avalue  Or something equivalent
         BXLE  0,0,*
Hint: this loop does terminate. What is in register 0 when the loop terminates. I actually used this in a production program.

These users thanked the author steve-myers for the post:
RISCCISCInstSet (Mon Nov 12, 2012 4:57 am)
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: Opcode: BXLE

Postby bobguo » Wed Mar 20, 2013 12:55 pm

steve-myers wrote:Not very many people use BXLE/BXH. Let's see what you've learned.
         LA    0,1
         LA    1,avalue  Or something equivalent
         BXLE  0,0,*
Hint: this loop does terminate. What is in register 0 when the loop terminates. I actually used this in a production program.



i know how to use BXLE, but i would like to catch what's mean, can somebody explain these three lines? Thx.
bobguo
 
Posts: 76
Joined: Thu Apr 26, 2012 11:18 am
Location: shanghai
Has thanked: 22 times
Been thanked: 0 time

Re: Opcode: BXLE

Postby steve-myers » Wed Mar 20, 2013 4:35 pm

bobguo wrote:... i know how to use BXLE, but i would like to catch what's mean, can somebody explain these three lines? Thx.
If you know how to use BXLE - which I doubt - and you understand the previous example, you should have no trouble with this example. Try changing the second line to

LA 1,5

Get out your "Principles of Operation" and work through the 4 times the BXLE instruction will execute. Remember that the * in the BXLE is the current location, so the first 3 times the instruction executes it will "branch" to itself. Remember the formal name of the instruction is "branch on index low or equal." Change the word "index" to "value," or in the earlier example, "address," and you will have it.

I sort of suspect "index" was used in the name to sort of fool people using the 704/709/7040/7090/7094 computers that immediately preceded the System/360 computers. Most of the time when I use BXLE or BXH I have addresses in first operand and the compare register.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: Opcode: BXLE

Postby bobguo » Wed Mar 20, 2013 8:44 pm

         LA    0,1
         LA    1,5
         BXLE  0,0,*


After the 1st time was executed:
R0=2 and it jumps to itself

After the 2nd time was executed:
R0=4 and it jumps to itself too

After the 3rd time was executed:
R0=8 and it jumps to the next instruction

"Hint: this loop does terminate. What is in register 0 when the loop terminates. I actually used this in a production program."

i puzzled why writing this codes? what's the purpose?
bobguo
 
Posts: 76
Joined: Thu Apr 26, 2012 11:18 am
Location: shanghai
Has thanked: 22 times
Been thanked: 0 time

Re: Opcode: BXLE

Postby enrico-sorichetti » Wed Mar 20, 2013 9:03 pm

i puzzled why writing this codes? what's the purpose?


the problem/puzzle to be solved is ..

given
F(x1) = y1
F(x2) = y2
F(x3) = y3
F(x4) = y4
...
F(xn) = yn


and You can easyily determine the xN and yN running the code a few times

describe the function F

not that complicated :mrgreen:
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 165 times

Re: Opcode: BXLE

Postby steve-myers » Wed Mar 20, 2013 9:32 pm

What are 2, 4, and 8? What are the next values? Actually, I didn't show the whole code.

LA 0,1
LA 1,5
BXLE 0,0,*
SRA 0,1

I stole the idea from an Algol function in Communications of the ACM from the 1950s. In C it would be

for ( i = 1; i <= 5; i = i + i);
i = i >> 1;

These users thanked the author steve-myers for the post:
bobguo (Thu Mar 21, 2013 11:57 am)
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Previous

Return to Assembler

 


  • Related topics
    Replies
    Views
    Last post