Search code examples
assemblygnu-assembler

Meaning of .-main expression


What does this expression mean:

.-main

in context of:

.size   main, .-main

?


Solution

  • Here, the dot . means "current location".

    Then .-main would be the distance to the start of main. If placed at the end of main, it would also be the size of main.