IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Difference between Jump and Branch instruction


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sheersh

New User


Joined: 24 May 2008
Posts: 17
Location: Gurgaon

PostPosted: Sat May 24, 2008 1:09 pm
Reply with quote

Please help me understanding difference between Jump and Branch instruction....like JNE & BNE
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Sat May 24, 2008 5:39 pm
Reply with quote

The branch needs a base register and a displacement to describe the to address. The newer jump only needs the (relative to the jump instruction) displacement for the destination address.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Sat May 24, 2008 8:55 pm
Reply with quote

does the jump automatically store the address of the instruction after the jump in an special register?

NCR assembler (NEATVS - probably called something else now) has a jump instruction and it stores a return address in reg??. to return, you BR on the register. like a link within a program.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Sat May 24, 2008 9:31 pm
Reply with quote

dbzTHEdinosauer wrote:
does the jump automatically store the address of the instruction after the jump in an special register?
Sometimes, as in:
BRANCH RELATIVE AND SAVE
BRAS R1,I2 [RI]
Information from the current PSW, including the updated instruction address, is saved as link information at the first-operand location. Subsequently, the instruction address in the PSW is replaced by the branch address.

But not in:
BRANCH RELATIVE ON CONDITION
BRC M1,I2 [RI]
The instruction address in the current PSW is replaced by the branch address if the condition code has one of the values specified by M1; otherwise, normal instruction sequencing proceeds with the updated instruction address.
Back to top
View user's profile Send private message
sheersh

New User


Joined: 24 May 2008
Posts: 17
Location: Gurgaon

PostPosted: Sat May 24, 2008 9:53 pm
Reply with quote

Thanks for the reply.....One more thing....I noticed BRAS and Jump has same OPCODE (A7, if I remember correctly)......why???
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Sat May 24, 2008 10:02 pm
Reply with quote

sheersh wrote:
One more thing....I noticed BRAS and Jump has same OPCODE (A7, if I remember correctly)......why???
Jump is not the 'real' instruction, it is a (I forget the term) substituted name for the BRAS opcode.....Makes it easier to remember......
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Sat May 24, 2008 11:38 pm
Reply with quote

thx for the info CICS Guy.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Sun May 25, 2008 12:42 am
Reply with quote

Hello,

Quote:
Please help me understanding difference between Jump and Branch instruction....like JNE & BNE
Once upon a time (on a different IBM computer), a big difference between a Jump and a Branch was instruction length and range of operation. A Jump was 2-bytes and could only move +/- 256 bytes from the current address (IIRC). A Branch was 4-bytes and had no such limitation.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Sun May 25, 2008 12:51 am
Reply with quote

Yes, my first assembler, on an 1130.....grin......
Back to top
View user's profile Send private message
sheersh

New User


Joined: 24 May 2008
Posts: 17
Location: Gurgaon

PostPosted: Sun May 25, 2008 2:32 am
Reply with quote

I also read in some manual (+/- 256 one). I was looking for HLASM, so i guess first answer by CICS guy holds more appropriate.....Thankyou all for your reponces.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Sun May 25, 2008 2:41 am
Reply with quote

FWIW (IIRC), the I2 is an half word (two byte) count of the number of half words to be added to the current PSW address......
I don't recall seeing a sign bit to alter it to +/-......But I'll check it out....
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Sun May 25, 2008 2:52 am
Reply with quote

I stand corrected:
z/Architecture Principles of Operation wrote:
The contents of the I2 field are a signed binary integer specifying the number of halfwords that is added to the address of the instruction to generate the branch address.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts NI AND IMMEDIATE instruction PL/I & Assembler 2
No new posts Difference between joblib and steplib JCL & VSAM 2
No new posts Pull data using date difference betwe... DB2 6
No new posts Difference between PLT txn and schedu... CICS 3
No new posts Timestamp difference and its average ... DB2 11
Search our Forums:

Back to Top