LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   labels in ASM (https://www.linuxquestions.org/questions/programming-9/labels-in-asm-4175668600/)

theKbStockpiler 01-28-2020 07:27 PM

labels in ASM
 
Hi. I want to be able to do simple assembly programming. I have studied some asm and higher level languages in the past but I can't find a definition of a (label) with context.

It just looks to me like a identifier to throw on a line that gives a temporary reference point for the compiler. Why not just use 'line one of code' for the first statement and then use 'line 2 of code' for the second?

What's the naming convention for using labels in any case?

Thank you for your expertise!

SoftSprocket 01-28-2020 07:43 PM

Quote:

Originally Posted by theKbStockpiler (Post 6083961)
Hi. I want to be able to do simple assembly programming. I have studied some asm and higher level languages in the past but I can't find a definition of a (label) with context.

It just looks to me like a identifier to throw on a line that gives a temporary reference point for the compiler. Why not just use 'line one of code' for the first statement and then use 'line 2 of code' for the second?

If you refered to line numbers in code you'd have to update all your markers every time you added or remove a preceding line. A label is a simple way to refer to a place in code that you wish to jump to, whether for a loop or a path selection. They exist in many high level languages as well.


All times are GMT -5. The time now is 09:34 AM.