Hello World! on modern processors.

From: Eric J. Korpela <korpela_at_ssl.berkeley.edu>
Date: Tue Aug 21 20:45:15 2001

> It's still annoying that 36 bytes of code and data end up in a 404 byte
> file. I suppose that's the price of a code loader that supports dynamic
> linking. Even if no files are linked, you need to tell it that no files
> are linked.

SPARC/Solaris does a bit better in file size by fitting 46 bytes of code
into a 316 byte file, using the same trick in replacing syscall with its
trap representation.

.section ".text"
        .global start
start:
        mov 4,%o0
        sethi %hi(message),%o2
        mov 1,%o1
        or %o2,%lo(message),%o2
        mov 14,%o3
        ta 8
        mov 1,%o0
        ta 8
message:
        .asciz "Hello World!\n"

Eric
Received on Tue Aug 21 2001 - 20:45:15 BST

This archive was generated by hypermail 2.3.0 : Fri Oct 10 2014 - 23:33:34 BST