ARM Assembly Language Part-II
Computer Architecture · 12,455 words · 62 min read · EN-ORIG

Below is the complete, readable transcript of ARM Assembly Language Part-II by Computer Architecture on YouTube. Read the full text, copy any part you need, or generate a transcript for any video with our free tool.
Now let's move to the more interesting part of the ARM instruction set that deals with branch instructions. We need branch instructions to implement if statements, for loops, while loops, and almost any kind of program where we need to make a decision on the value of a certain variable. So ARM, like simple RISC, supports some
very simple branch instructions. There are some complicated ones as well, but let's take a look at the simple ones. So uh similar to simple RISC, the format of every branch statement is the same, which is essentially a branch instruction and a label.
So we branch to the label, we jump to the label, and the label is uh the first uh instruction uh at the branch target. So let's say if this is a program, and uh so there is a certain label {dot} foo over here, and we branch to {dot} foo, what this means is
that the control gets transferred from here to here. So the basic and the simplest instruction is an unconditional branch B. So an example would be, let's say B {dot} foo, it would jump unconditionally to label {dot} foo. Similar to simple RISC, we have BEQ, branch if the flags indicate equality and branch if the flags indicate
unequality. So, what I mean by flags is that the last instruction that set the flags should have had an equal to, should have concluded that both the values that are being given to it are equal. Only on that condition would this particular branch actually branch to this label. So, the explanation is that we branch to
{dot} foo if the last flag setting instructions, mind you this is one phrase, flag setting instruction has resulted in an equality and this will show up in the Z flag being equal to one. Similarly we'll have branch not equal to which is just the opposite of branch if equal to where the Z flag is equal to
Transcribe another video
Paste any YouTube, Instagram or TikTok link to get a free transcript.