The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: astak on October 27, 2007, 09:10:35 AM

Title: New to asm, need some help
Post by: astak on October 27, 2007, 09:10:35 AM
I searched the forum but could'nt find any good answers so I test make my own thread.
I've just downloaded masm and read through the helpfiles, I understand the basics of asm know, but.

I want to make a simple program, like "hello world" and in 32-bit versions since I read in another post that it is no 16-bit linker in masm nowadays.
No messagebox, just a clean console output.
Title: Re: New to asm, need some help
Post by: Vortex on October 27, 2007, 11:39:58 AM
Welcome to the forum.

Here is an example :

.386
.model flat, stdcall
option casemap :none

include     \masm32\include\windows.inc
include     \masm32\include\kernel32.inc
include     \masm32\include\masm32.inc

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

.data

message     db 'Hello world!',13,10,0

.code

start:

    invoke  StdOut,ADDR message ; masm32.lib provides this function to print strings
    invoke  ExitProcess,0       ; terminate the application

END start
Title: Re: New to asm, need some help
Post by: astak on October 27, 2007, 05:25:24 PM
Thank you so much :D
I want to read more about asm-programming for the console, where should I "look"?
Title: Re: New to asm, need some help
Post by: Vortex on October 27, 2007, 08:21:36 PM
You are welcome.

Have a look at Masmlib.hlp file coming with the Masm32 package :

\masm32\help\MASMLIB.hlp

The chapter entitled Console Mode Functions explains the basics of console handling.