Anonymous asked in Computers & InternetSoftware · 1 decade ago

How do you write a simple Assembly Language program that says " Hello World"?

Also, how do you run the program/

Note: I am running Windows Vista, 32bit Operating system

2 Answers

  • Zee
    Lv 4
    1 decade ago
    Favorite Answer

    Here's the "Hello World" program in assembly:


    .MODEL flat, stdcall





    IncludeLib kernel32.lib

    IncludeLib masm32.lib


    HelloMsg DB "Hello World", 0

    CRLF DB 00Ah, 00Dh, 0

    ExitMsg DB "Enter to Exit", 0


    buffer DB ?



    invoke StdOut, addr HelloMsg

    invoke StdOut, addr CRLF

    invoke StdOut, addr ExitMsg

    invoke StdIn, addr buffer, 1

    invoke ExitProcess, 0

    End Start

    You need WinAsm to run this:

    • Login to reply the answers
  • 1 decade ago

    Use interrupt 10h. That's a call which is left over from the very earliest days of IBM PCs.

    Here's a link to an old C influenced Assembly language program which writes a string to the screen:

    It writes a null terminated string. How? cputs calls cputs_2. cputs_2 compares the char to be written to the null char. If it's not equal, it jumps back to cputs_1, which calls putch then falls back int cputs_2. When cputs_2 reaches he null character, it terminates. This program was meant to be compiled with nasm, which is a good program.

    Here is another simple example, for older compilers:

    Gosh, this all reminds me I haven't tried ANY Assembler in years.

    • Login to reply the answers
Still have questions? Get your answers by asking now.