1.保护模式(win7,Linux系统,绝大多数平台)
    2.实地址模式,intel 8086/8088 硬件平台,winXP

    1. .386 ;选择的处理器类型
    2. .model flat,stdcall ;存储类型,平展(flat)模型,stdcall为函数调用方式
    3. option casemap:none ;指明标志符大小写敏感
    4. include kernel32.inc
    5. includelib kernel32.lib
    6. includelib msvcrt.lib ;引用C语言的库文件msvcrt.lib
    7. printf PROTO C: ptr sbyte,:vararg
    8. .data ;数据段
    9. fmt BYTE '%s',13,10,0 ;定义格式字符串fmt,值为"%s\n"
    10. s BYTE 'WIN32汇编,你好!',0
    11. .code
    12. start:
    13. invoke printf,ADDR fmt,ADDR s
    14. invoke ExitProcess,0
    15. end start
    1. .386
    2. .model flat,stdcall
    3. option casemap:none
    4. include windows.inc
    5. include user32.inc
    6. include kernel32.inc
    7. includelib user32.lib
    8. includelib msvcrt.lib
    9. includelib kernel32.lib
    10. system PROTO C:ptr sbyte,:vararg
    11. printf PROTO C:ptr sbyte,:vararg
    12. .data
    13. szTitle BYTE 'windows',0
    14. szText BYTE 'hello,world!',10,13,0
    15. fmt BYTE '%s',0
    16. szPause BYTE 'pause',0
    17. .code
    18. start:
    19. invoke printf,ADDR fmt,ADDR szText
    20. invoke MessageBox,NULL,offset szText,offset szTitle,MB_OK
    21. invoke system,ADDR szPause
    22. end start