Talk:Branch (computer science)

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Cleanup[edit]

Untitled[edit]

I've added the cleanup tag, mostly because of the last half of the article. It says that branch instructions can be taken or not taken --- this is only true of conditional branches, not branches in general. This is then mentioned again in the last sentence of the paragraph. --Ferris37 17:05, 3 October 2006 (UTC)[reply]

In general, it is completely true that a branch can be taken or not taken. Every branch is either taken or not taken. It is just that unconditional branches are always taken and conditional branches involve a choice. I think the article is pretty good on this point: it defines the terms taken and not taken, then tells us that unconditionals are always taken, conditionals depend on a condition. Is this not clear? NicM 17:34, 3 October 2006 (UTC).[reply]

Merge proposal[edit]

There are three articles which roughly deal with the same (or largely overlapping) subjects: Branch (computer science), Conditional branch, and Jump instruction. I think it makes sense to consolidate them. I'm not particularly happy with the name of this article being qualified with "(computer science)" since there are other computing uses, as with Branching (software). Perhaps "Branch instruction" may be better? But first lets merge and then deal with the names. -- Dmeranda 07:39, 20 June 2006 (UTC)[reply]

  • Support merge -- As long as the correct redirects are established, I'd support this merger. Atlant 16:31, 20 June 2006 (UTC)[reply]
  • Support merge -- Definitely; there is no point in having three separate articles for what is already a vague term that may cover all the articles together. Addps4cat 19:03, 14 September 2006 (UTC)[reply]

History...[edit]

A long time ago, I worked on an HC11 and I seem to remember the learned professor making a distinction between jump and branch (probably only for that architecture). Anyone else remember more?--66.93.220.66 04:28, 14 August 2007 (UTC)[reply]

I was thinking of the same thing ... Why look at unconditional jumps as branching ? In my opinion the program executes linearly (almost), there are not two possibilities - branches, especially on the today's pipelined hardware. Bytencoder 12:20, 8 October 2007 (UTC)[reply]
In some processors, there is a branch-always instruction. In other processors, jump is a "branch always" but the distinction is made in the mneumonics. In still other processors, branch instructions have a limited range while jump instructions have a much larger range and/or different addressing modes for the destination. — Val42 19:31, 8 October 2007 (UTC)[reply]
It's simple: The branch is the instuctions jumped to and executed as a result of a jump instruction.
I've seen some assembly languages where they're all called branches and others where they're all called jumps and others still where there's a mixture where the jump is unconditional and the branch is conditional, and others yet again where the jump means a long distance and branch is short distance. I think one can say that control flow always branches at a conditional jump or branch instruction, control flow doesn't jump. There is also a little nasty in that in some architectures the instruction after the jump or branch instruction is always executed because of pipelining. Also of course branch and link instructions don't at a high level correspond to any sort of branch in control flow but to a subroutine call, and return or exit instruction are also branches in machine terms.
Probably the article should just make a clear distinction between branch instructions and control flow branching or subroutine calling. Dmcq (talk) 12:28, 11 February 2011 (UTC)[reply]
Why make it so hard? Just follow the original language semantics instead of peculiar assembly mnemonics: What branch of code that should be executed at a particular point in a program is controlled by jumps at the machine level. The same kind of control is expressed as if condition then true-branch else false-branch, and similar, at higher levels. Whether a jump instruction is labeled "brcc dst" or "jmp nc,dst" is fairly irrelevant in that context.
Subroutine calling can be seen as another mechanism or as a special case or extension of this (which could well be mentioned). However, subroutines has it's own articles which explains the mechanics of call/ret instructions as well as branch and link instructions (and pipelines, if i remember correctly). 83.255.34.242 (talk) 03:42, 12 February 2011 (UTC)[reply]
We're supposed to follow what sources say, it is quite explicitly not a dictionary like wiktionary. That's why 'citation needed' is so important in Wikipedia. And that seems to be a problem with this article which might explain why this discussion is taking place. There are no citations. How about some computer science references that talk about branches, that would be a lot meore definitive than anything on tis talk page.Dmcq (talk) 10:52, 12 February 2011 (UTC)[reply]

External links modified[edit]

Hello fellow Wikipedians,

I have just modified one external link on Branch (computer science). Please take a moment to review my edit. If you have any questions, or need the bot to ignore the links, or the page altogether, please visit this simple FaQ for additional information. I made the following changes:

When you have finished reviewing my changes, please set the checked parameter below to true or failed to let others know (documentation at {{Sourcecheck}}).

This message was posted before February 2018. After February 2018, "External links modified" talk page sections are no longer generated or monitored by InternetArchiveBot. No special action is required regarding these talk page notices, other than regular verification using the archive tool instructions below. Editors have permission to delete these "External links modified" talk page sections if they want to de-clutter talk pages, but see the RfC before doing mass systematic removals. This message is updated dynamically through the template {{source check}} (last update: 18 January 2022).

  • If you have discovered URLs which were erroneously considered dead by the bot, you can report them with this tool.
  • If you found an error with any archives or the URLs themselves, you can fix them with this tool.

Cheers.—InternetArchiveBot (Report bug) 08:49, 7 November 2016 (UTC)[reply]