News:

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

Endm with macro name

Started by Magnum, May 29, 2010, 07:28:45 PM

Previous topic - Next topic

Magnum

This code assembles fine but there is no macro name, just the endm?

I also cannot see what is being repeated 8 times here either.


.startup

    invoke sleep, 50

    REPEAT 8

      ctr_begin 100
      ctr_end
      print dword$(eax)," cycles, empty",13,10

      ctr_begin 100
        invoke CtBits, 123
      ctr_end
      print dword$(eax)," cycles, CtBits",13,10

      ctr_begin 100
        mov dx, 123
        call CBits
      ctr_end
      print dword$(eax)," cycles, CBits",13,10

    ENDM

Have a great day,
                         Andy

qWord

the macro loops are also finalized by ENDM:
REPEAT count
    ...
ENDM
WHILE cond
    ...
ENDM
FOR arg,<args>
    ...
ENDM
FPU in a trice: SmplMath
It's that simple!

dedndave

in other words, the ENDM directive is paired with the REPEAT directive in this case

Magnum

Quote from: dedndave on May 29, 2010, 07:47:52 PM
in other words, the ENDM directive is paired with the REPEAT directive in this case

Thanks. I thought endm was only used with macros.

Have a great day,
                         Andy

BogdanOntanu

Quote from: Magnum on May 29, 2010, 09:06:02 PM
...
Thanks. I thought endm was only used with macros.

REPEAT, WHILE and FOR directives are in fact MACROS that do not need a name and have predefined arguments...  and because of this they are paired / ended with ENDM like any other macro does.
Ambition is a lame excuse for the ones not brave enough to be lazy.
http://www.oby.ro