1b and 1f in GNU assembly

Labels “xb” and “xf”, where “x” is a number are a smart extension to the GNU assembly. It branches to the first found label “x” searching “forward” for “f” or “backward” for “b”.

That means that in your first listing using “1b” as a target will search for “1” BEFORE the instruction that uses it. In the second listing “2f” will search for “2” AFTER the instruction that uses it, the “2b” at the end of this listing will then branch to the same “2”, because it is BEFORE the instruction.

There may be multiple labels with numbers in your code.

See here – https://sourceware.org/binutils/docs-2.24/as/Symbol-Names.html#Symbol-Names – chapter “Local labels”.

Leave a Comment