From: Anant Narayanan <anant@kix.in>
To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu>
Subject: Re: [9fans] Hello Assembly
Date: Sun, 10 Feb 2008 02:45:51 +0530 [thread overview]
Message-ID: <566BA6DE-1CF7-40EE-B0E7-399EB2585F1B@kix.in> (raw)
In-Reply-To: <ead6208b996760a9eb2eeccb8c431b12@plan9.bell-labs.com>
Thanks everybody (especially Jim and Charles), I got this to work.
Here's the final program:
DATA string<>+0(SB)/8, $"Hello\n\z\z"
GLOBL string<>+0(SB), $8
TEXT _main+0(SB), 1, $0
MOVL $1, 4(SP)
MOVL $string<>+0(SB), 8(SP)
MOVL $7, 12(SP)
MOVL $-1, 16(SP)
MOVL $-1, 20(SP)
MOVL $51, AX
INT $64
MOVL $string<>+0(SB), 4(SP)
MOVL $8, AX
INT $64
Jim pointed out that using RET was incorrect as the instruction
wouldn't know where to get back to. Calling exits() instead, works.
Plan 9 gets more and more exciting for me, everyday :)
Thanks again!
Cheers,
Anant
next parent reply other threads:[~2008-02-09 21:15 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <ead6208b996760a9eb2eeccb8c431b12@plan9.bell-labs.com>
2008-02-09 21:15 ` Anant Narayanan [this message]
2008-02-09 21:27 ` Pietro Gagliardi
2008-02-10 8:30 ` Anant Narayanan
2008-02-11 16:36 ` john
2008-02-11 16:43 ` erik quanstrom
2008-02-11 16:45 ` john
2008-02-11 19:41 ` Jon Snader
2008-02-11 19:49 ` Pietro Gagliardi
2008-02-09 9:44 Anant Narayanan
2008-02-09 9:58 ` Charles Forsyth
2008-02-09 10:09 ` Anant Narayanan
2008-02-09 10:15 ` erik quanstrom
2008-02-09 10:32 ` Charles Forsyth
2008-02-09 10:34 ` erik quanstrom
2008-02-09 10:36 ` erik quanstrom
2008-02-09 20:15 ` Anant Narayanan
2008-02-09 20:17 ` Anant Narayanan
2008-02-09 14:37 ` Eris Discordia
2008-02-09 16:17 ` Brantley Coile
2008-02-09 16:27 ` ron minnich
2008-02-09 16:38 ` erik quanstrom
2008-02-09 16:51 ` Brantley Coile
2008-02-10 8:04 ` maht
2008-02-11 16:39 ` john
2008-02-09 17:32 ` Charles Forsyth
2008-02-10 8:18 ` Eris Discordia
2008-02-10 8:56 ` Martin Neubauer
2008-02-10 14:38 ` Pietro Gagliardi
2008-02-10 16:55 ` Anant Narayanan
2008-02-10 18:01 ` erik quanstrom
2008-02-10 18:11 ` Pietro Gagliardi
2008-02-11 2:36 ` Adrian Tritschler
2008-02-11 2:36 ` Pietro Gagliardi
2008-02-11 2:39 ` Pietro Gagliardi
2008-02-11 6:26 ` maht
2008-02-11 2:40 ` Pietro Gagliardi
2008-02-11 2:55 ` erik quanstrom
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=566BA6DE-1CF7-40EE-B0E7-399EB2585F1B@kix.in \
--to=anant@kix.in \
--cc=9fans@cse.psu.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).