www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/10/11/19:49:06

Date: Mon, 12 Oct 1998 00:47:21 +0100 (BST)
From: George Foot <george DOT foot AT merton DOT oxford DOT ac DOT uk>
To: djgpp AT delorie DOT com
Subject: Re: newbie
In-Reply-To: <6vr9m6$ss7$1@supernews.com>
Message-ID: <Pine.OSF.4.05.9810120037120.5218-100000@sable.ox.ac.uk>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

On Sun, 11 Oct 1998, jud wrote:

> can someone send me a program that simply prints a message, but in djgpp
> assembly

Try this: (I can't test it at the moment, sorry)

    .text
    .p2align 3
    .global _main
    _main:
        pushl $_string
        call _puts
        addl $4, %esp
        xorl %eax, %eax
        ret
    .data
    _string:
        .string "Hello, world!"

You could have just compiled a Hello World program written in C
using the -S switch, to get assembly language output.

-- 
george DOT foot AT merton DOT oxford DOT ac DOT uk

xu do tavla fo la lojban  --  http://xiron.pc.helsinki.fi/lojban/lojban.html

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019