News:

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

Hey, this actually doesn't work.

Started by $nooc, February 09, 2008, 11:13:21 PM

Previous topic - Next topic

$nooc

thank you guys for your explanations :)

MrBogus

Quote from: Vortex on March 30, 2008, 11:32:27 AM
print is a macro defined in macros.asm :

    print MACRO arg1:REQ,varname:VARARG      ;; display zero terminated string
        invoke StdOut,reparg(arg1)
      IFNB <varname>
        invoke StdOut,chr$(varname)
      ENDIF
    ENDM


chr$ is another macro defining NULL terminated strings in the data section :


chr$ MACRO any_text:VARARG
        LOCAL txtname
        .data
          txtname db any_text,0
        .code
        EXITM <OFFSET txtname>
      ENDM


Where does StdOut came from? I've seached its declaration in macro.asm file but I haven't found any.
Just wanted to learn how print macro really works. Thanks.

Vortex

StdOut.asm can be found here :

\masm32\m32lib\stdout.asm

MrBogus

Thanks for the quick reply. But why is it that there is no statement such as this


include \masm32\m32lib\stdout.asm


in macros.inc file?

MichaelW

For MASM32 there is no macros.inc file - most of the MASM32 macros are in the file masm32\macros\macros.asm. Placing the statement:

include \masm32\m32lib\stdout.asm

In macros.asm would effectively include the source file in macros.asm, and this would cause multiple problems building any source that included macros.asm, starting with multiple model directives and duplicated include files. The source file stdout.asm, like the other source files for the MASM32 library, is structured so it can be assembled and linked into the library masm32.lib. A source can use the MASM32 library procedures by including masm32.lib and masm32.inc, along with the include files and libraries that the MASM32 library depends on, and the source can then call any of the macros in macros.asm without problems.
eschew obfuscation