Thread: [MASM32] Hello World

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1 [MASM32] Hello World 
    Banned

    Join Date
    Feb 2009
    Posts
    1,676
    Thanks given
    24
    Thanks received
    25
    Rep Power
    0
    .486
    .model flat, stdcall
    option casemap :none ; case sensitive

    include \masm32\include\windows.inc
    include \masm32\include\masm32.inc
    include \masm32\include\kernel32.inc
    include \masm32\macros\macros.asm

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

    .code

    start:

    print "Hello world"

    exit

    end start
    Not as hard as you thought, huh?
    Reply With Quote  
     

  2. #2  
    distilled entanglement
    Guest
    MASM32 is a joke because of the fact there are excessive macros, like '.IF' and '.ENDIF', oh, and that dastardly 'print'.

    Code:
    bits 32
    
    extern _GetStdHandle@4
    extern _WriteFile@20
    extern _ExitProcess@4
    
    STD_OUTPUT_HANDLE equ 0xFFFFFFFB
    NULL equ 0
    EXIT_SUCCESS equ 0
    
    segment .data
        OUTPUT_MSG db "MASM32 is junk; NASM is clearly superior.",0x0A,0x0D,"    - ent",0x0A,0x0D
        OUTPUT_MSG_LEN equ $ - OUTPUT_MSG
    
    segment .text
        push dword STD_OUTPUT_HANDLE
        call _GetStdHandle@4
        push dword NULL
        push dword NULL
        push dword OUTPUT_MSG_LEN
        push dword OUTPUT_MSG
        push dword eax
        call _WriteFile@20
        push dword EXIT_SUCCESS
        call _ExitProcess@4

    Code:
    nasm -fwin32 -omsgbox msgbox.asm
    ld -lkernel32 -luser32 -omsgbox msgbox.o
    Reply With Quote  
     

  3. #3  
    Banned

    Join Date
    Feb 2009
    Posts
    1,676
    Thanks given
    24
    Thanks received
    25
    Rep Power
    0
    Quote Originally Posted by distilled entanglement View Post
    MASM32 is a joke because of the fact there are excessive macros, like '.IF' and '.ENDIF', oh, and that dastardly 'print'.

    Code:
    bits 32
    
    extern _GetStdHandle@4
    extern _WriteFile@20
    extern _ExitProcess@4
    
    STD_OUTPUT_HANDLE equ 0xFFFFFFFB
    NULL equ 0
    EXIT_SUCCESS equ 0
    
    segment .data
        OUTPUT_MSG db "MASM32 is junk; NASM is clearly superior.",0x0A,0x0D,"    - ent",0x0A,0x0D
        OUTPUT_MSG_LEN equ $ - OUTPUT_MSG
    
    segment .text
        push dword STD_OUTPUT_HANDLE
        call _GetStdHandle@4
        push dword NULL
        push dword NULL
        push dword OUTPUT_MSG_LEN
        push dword OUTPUT_MSG
        push dword eax
        call _WriteFile@20
        push dword EXIT_SUCCESS
        call _ExitProcess@4

    Code:
    nasm -fwin32 -omsgbox msgbox.asm
    ld -lkernel32 -luser32 -omsgbox msgbox.o
    Microsoft is a joke. Visual Basic, MASM, VC++.. What is new?

    I posted this because I found it somewhere on my computer and have a friend who wants to learn MASM.
    Reply With Quote  
     

  4. #4  
    Renown Programmer
    veer's Avatar
    Join Date
    Nov 2007
    Posts
    3,746
    Thanks given
    354
    Thanks received
    1,370
    Rep Power
    3032
    Quote Originally Posted by distilled entanglement View Post
    MASM32 is a joke because of the fact there are excessive macros, like '.IF' and '.ENDIF', oh, and that dastardly 'print'.

    Code:
    bits 32
    
    extern _GetStdHandle@4
    extern _WriteFile@20
    extern _ExitProcess@4
    
    STD_OUTPUT_HANDLE equ 0xFFFFFFFB
    NULL equ 0
    EXIT_SUCCESS equ 0
    
    segment .data
        OUTPUT_MSG db "MASM32 is junk; NASM is clearly superior.",0x0A,0x0D,"    - ent",0x0A,0x0D
        OUTPUT_MSG_LEN equ $ - OUTPUT_MSG
    
    segment .text
        push dword STD_OUTPUT_HANDLE
        call _GetStdHandle@4
        push dword NULL
        push dword NULL
        push dword OUTPUT_MSG_LEN
        push dword OUTPUT_MSG
        push dword eax
        call _WriteFile@20
        push dword EXIT_SUCCESS
        call _ExitProcess@4

    Code:
    nasm -fwin32 -omsgbox msgbox.asm
    ld -lkernel32 -luser32 -omsgbox msgbox.o
    msgbox.asm lol?
    Reply With Quote  
     

  5. #5  
    Banned

    Join Date
    Feb 2009
    Posts
    1,676
    Thanks given
    24
    Thanks received
    25
    Rep Power
    0
    Quote Originally Posted by super_ View Post
    msgbox.asm lol?
    l0l0l
    Reply With Quote  
     

  6. #6  
    Registered Member

    Join Date
    Feb 2009
    Age
    27
    Posts
    2,861
    Thanks given
    127
    Thanks received
    226
    Rep Power
    700
    This is why I use Java.
    Reply With Quote  
     

  7. #7  
    Registered Member thiefmn6092's Avatar
    Join Date
    Dec 2006
    Age
    24
    Posts
    2
    Thanks given
    26
    Thanks received
    389
    Rep Power
    0
    Wow noobs, use AS.
    https://twitter.com/********s1

    If you are a starter and want to learn rsps coding, i think that the server that fits most of your requests is deathlypvpz.
    I know some stone heads will flame and say its shit, i completely agree buy deathlypvpz is the best thing to start with.
    And you must do some Java courses in codecademy to improve yourself.
    Reply With Quote  
     

  8. #8  
    Banned

    Join Date
    Feb 2009
    Posts
    1,676
    Thanks given
    24
    Thanks received
    25
    Rep Power
    0
    Quote Originally Posted by Jarba View Post
    This is why I use Java.
    l2accesslevels or gtfo.
    Reply With Quote  
     

  9. #9  
    Registered Member thiefmn6092's Avatar
    Join Date
    Dec 2006
    Age
    24
    Posts
    2
    Thanks given
    26
    Thanks received
    389
    Rep Power
    0
    Quote Originally Posted by R3CoN View Post
    l2accesslevels or gtfo.
    l2useas or gtfo.

    Anyways, trolling aside - using MASM32 (or 64 if it exists?) will not do anything really when it comes to helping you learn Assembler. It has to many macros for things such as control structures that simplify the code to much for you to use real instructions such as Jump On <condition>, which are the only control structures you have available to use when programming in raw Assembler. If you are serious about learning how a processor works and the instructions to go along with it, go grab a i386 INTEL programmers manual. It will explain EVERY instruction in the i386 processor (which is most that exist minus extensions such as SSE, MMX and 3dNOW!). It also explains things in categories such as Task Switching (believe it or not, the processor has the built-in ability to save states for different "tasks" - allowing you to use this functionality to implement any kind of multi-tasking). If you would like to REALLY be able to use Assembler to its full potential, install a Linux distribution; install Bochs; find a tutorial for writing a SIMPLE kernel (only because you can have pretty much unlimited resource access and really learn how things work) and boot it with Bochs.
    Reply With Quote  
     

  10. #10  
    Banned

    Join Date
    Feb 2009
    Posts
    1,676
    Thanks given
    24
    Thanks received
    25
    Rep Power
    0
    Quote Originally Posted by thiefmn6092 View Post
    l2useas or gtfo.

    Anyways, trolling aside - using MASM32 (or 64 if it exists?) will not do anything really when it comes to helping you learn Assembler. It has to many macros for things such as control structures that simplify the code to much for you to use real instructions such as Jump On <condition>, which are the only control structures you have available to use when programming in raw Assembler. If you are serious about learning how a processor works and the instructions to go along with it, go grab a i386 INTEL programmers manual. It will explain EVERY instruction in the i386 processor (which is most that exist minus extensions such as SSE, MMX and 3dNOW!). It also explains things in categories such as Task Switching (believe it or not, the processor has the built-in ability to save states for different "tasks" - allowing you to use this functionality to implement any kind of multi-tasking). If you would like to REALLY be able to use Assembler to its full potential, install a Linux distribution; install Bochs; find a tutorial for writing a SIMPLE kernel (only because you can have pretty much unlimited resource access and really learn how things work) and boot it with Bochs.
    Quote Originally Posted by R3CoN View Post
    Microsoft is a joke. Visual Basic, MASM, VC++.. What is new?

    I posted this because I found it somewhere on my computer and have a friend who wants to learn MASM.
    mhmm.
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •