News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Labels

Started by Astro, August 18, 2009, 01:56:43 AM

Previous topic - Next topic

Astro

A couple of questions:

1) Am I correct in thinking the size of a label in the source doesn't matter?

e.g.

I_AM_A_VERY_VERY_LONG_LABEL:

and

JH:

will compile to the same size code?

2) How does @@: and jmp @A work?

Best regards,
Astro.

dedndave

dunno 'bout "@A" - i think that is just a branch label
but
@@: is an anonymous branch label
it may be referenced by @B or (backward) @F (forward)
jz @F branches to the next (forward) anonymous label
jmp @B branches to the most recent (backward) anonymous label

the names can be any length up to 247 bytes
i sometimes make them long to write the code, then clean them up a little

Astro

Ahh! That makes sense. I wondered how they were referenced.

@A was just an arbitrary letter I chose - likely isn't valid then.

Thanks!  :thumbu

Best regards,
Astro.

hutch--

Astro,

A label is just a notation for a location in code, in the final code there are no lables, just addresses that are targets for jumps and / or calls.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Astro

Hi,

Quotein the final code there are no lables, just addresses that are targets for jumps and / or calls.
That's what I thought it did, but it was based upon another architecture, and wasn't sure if the label made it into the final binary verbatim (it appeared that it wasn't the case, but wanted to check).

I was busy cleaning up some code I'd written and it prompted the question.

Best regards,
Astro.

FORTRANS

Hi,

   The easiest way to see this is with a program listing.


      13 0013  B9 0008                          MOV     CX,8
      14 0016                           @@:
      15 0016  90                               NOP
      16 0017  E2 FD                            LOOP    @@
      17
      18 0019  B9 0008                          MOV     CX,8
      19 001C                           Honking_Big_Label:
      20 001C  90                               NOP
      21 001D  E2 FD                            LOOP    Honking_Big_Label


   And noting that the generated code is the same.

Steve N.