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
 

 

Difference between Jump and Branch instruction

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

New User


Joined: 24 May 2008
Posts: 10
Location: Gurgaon

PostPosted: Sat May 24, 2008 1:09 pm    Post subject: Difference between Jump and Branch instruction
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: 2150
Location: At my coffee table

PostPosted: Sat May 24, 2008 5:39 pm    Post subject:
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    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Sat May 24, 2008 9:31 pm    Post subject:
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: 10
Location: Gurgaon

PostPosted: Sat May 24, 2008 9:53 pm    Post subject: Reply to: Difference between Jump and Branch instruction
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: 2150
Location: At my coffee table

PostPosted: Sat May 24, 2008 10:02 pm    Post subject: Re: Reply to: Difference between Jump and Branch instruction
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    Post subject:
Reply with quote

thx for the info CICS Guy.
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 May 25, 2008 12:42 am    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Sun May 25, 2008 12:51 am    Post subject:
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: 10
Location: Gurgaon

PostPosted: Sun May 25, 2008 2:32 am    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Sun May 25, 2008 2:41 am    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Sun May 25, 2008 2:52 am    Post subject:
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    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 Difference between TWALENG and TWASIZE Arunkumar Chandrasekaran CICS 3 Tue Jan 03, 2017 12:57 pm
No new posts Sticky: difference between ... DUMMY ... and ... enrico-sorichetti JCL & VSAM 0 Mon Oct 17, 2016 4:31 pm
No new posts Difference space showed for TS and it... autobox DB2 1 Thu Apr 14, 2016 1:07 pm
No new posts Difference Between CICS WebSupport an... sachinji84 CICS 1 Mon Mar 07, 2016 7:25 pm
No new posts Difference between -180 and -181 with... deepak_shrivastava DB2 4 Wed Jan 06, 2016 10:00 am


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