You need to read the ARM documentation. The answers to your questions are there.
Yes ARM uses flags. As with any instruction set that uses flags you need to examine each instruction you are using or wish to use or for general understanding to see what if any flags they modify. For example an AND operation does it make sense to set the carry flag? Nope, but does it make sense to set the zero flag? Sure it could be useful, or sometimes they TST sets the zero flag but AND doesnt, depends on architecture.
Unlike your typical flag basd solution, ARM for a while there had a twist, you have to ASK the instruction to set the flags. If you notice
loop:
sub r0,#1
bne loop
does not do what you want it to do because as written (per the arm docs) the subtract dos NOT touch any flags in particular the Z flag we are testing, but...
loop:
subs r0,#1
bne loop
This code, the subtract DOES touch the Z flag.
It allows for things like
cmp r2,r3
moveq r1,#1
bxeq lr
mov r1,#0
bx lr
Or say
if(foo==1)
{
bar++;
}
you normally would need to implement that as
compare with 1
branch if not equal to skip
increment
skip:
so you have a pipe and maybe fetch hit with the branch
but instead
compare with 1
increment if equal
conditional execution, the condition bits.
Now thats for full sized arm instructions, the thumb instructions are a different story.
And with the 64 bit instruction set aarch64 this whole conditional thing went away, four bits being burned every instruction for conditional execution is a bit painful, not used enough. They could have had 32 general purpose registers instead that might have been more useful...
So not sure what you are asking about functions, first off in assembly language you can often use labels like WhileLoop. The assembler turns that into the right instrution, WhileLoop is not an instruction it is basically an address, in this case the assembler should use the instruction you asked for and do a pc relative offset (the fixed address is not used, it counts up how many instructions between the label and the beq and says if equal branch backward N instructions). if you put a beq to some label and that is defined in another module/object the linker will then have to patch up the instruction later.
As far as functions, so if writing a program in C and I want to make several instructions do I need to make all the function names different? Yep. There is really no such thing as a function in assembly, there are some directives to give the illusion of one, but its just a fancy label. But the code that represents a function, if you want to write 7 of them yes you need to use different labels for each. Assembly language has nothing to do with it.
gnu assembler has an interesting feature which there is no reason to assume other assembly languages support (asssembly language is defined by the assembler, the tool, NOT the target (ARM instruction set)), very easy to demonstrate this for many different instruction sets, easy to write arm assembly that does not assemble across all the actively supported assemblers out there. So here is a gnu assembler trick that may or may not help you with labels
1:
subs r0,#1
beq 1f
b 1b
1:
You normally would want to just do the bne but this demonstrates the feature. a label that is a number is special 1f means label 1: forward so the next label 1: down the page. 1b means 1: backward so from that point read backward up the page to find the next 1: so you dont have to do
myfunction:
...
myfunction00:
...
myfunction01:
...
myfunction02:
...
because you are struggling to make intermediate labels to deal with simple branches over stuff and loops.
You can choose whether it is a feature or a burden because it creates a habit that may or may not be tool specific.