News:

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

What is the syntax for this?

Started by baltoro, January 12, 2011, 12:42:20 AM

Previous topic - Next topic

dedndave


baltoro

...I can just imagine what would have happened if my jokes were alot worse.  :eek
...and yes, it has a certain therapeutic value,...
Baltoro

Vortex

Another example :


.386
.model flat

EXTERN      _ExitProcess@4:PROC
EXTERN      _MessageBoxA@16:PROC

ExitProcess EQU <_ExitProcess@4>
MessageBox  EQU <_MessageBoxA@16>

; PUBLIC _start

includelib  \masm32\lib\kernel32.lib
includelib  \masm32\lib\user32.lib


_DATA SEGMENT

msg     db 'Hello world!',0

_DATA ENDS


_TESTSEG SEGMENT

capt    db 'Testing',0

_TESTSEG ENDS


_TEXT SEGMENT

_start:

    push    OFFSET capt
    push    OFFSET msg
    call    myfunc
    push    0
    call    ExitProcess

myfunc PROC

    push    ebp
    mov     ebp,esp
    push    0
    push    DWORD PTR [ebp+12]
    push    DWORD PTR [ebp+8]
    push    0
    call    MessageBox
    leave
    ret     8
   
myfunc ENDP

_TEXT ENDS

END _start


\masm32\bin\dumpbin.exe /HEADERS Segments.exe


SECTION HEADER #2
   .data name
      A2 virtual size
    2000 virtual address
     200 size of raw data
     400 file pointer to raw data
       0 file pointer to relocation table
       0 file pointer to line numbers
       0 number of relocations
       0 number of line numbers
C0000040 flags
         Initialized Data
         Read Write

SECTION HEADER #3
_TESTSEG name
       8 virtual size
    3000 virtual address
     200 size of raw data
     600 file pointer to raw data
       0 file pointer to relocation table
       0 file pointer to line numbers
       0 number of relocations
       0 number of line numbers
C0000040 flags
         Initialized Data
         Read Write



Both of the sections .data and _TESTSEG have the same characteristics.



baltoro

Vortex,
Thanks,...that is really helpful.
Baltoro