Hello from a libc-free world
blogs.oracle.com
blogs.oracle.com
It should work as 32-bit or 64-bit and compile with clang or gcc. It compiles to about 11 assembly instructions.
To produce a fairly small file:
$ clang -nostdlib -O3 -o helloworld -m32 helloworld.c
$ strip helloworld
$ strip -R .note.gnu.build-id ./helloworld
$ wc -c helloworld
428 helloworld[1] http://blog.reverberate.org/2009/07/giving-up-on-at-style-as...
It's just the syntax. Get over it. You get used to it in a few days, and using Intel syntax over AT&T doesn't make your programs any better.
> I would support an effort to remove it from the GNU toolchain.
That would break a lot of existing applications, removing it from the GNU toolchain would be the easy part.
You can still use .intel_syntax directive with the GNU toolchain or use another assembler like NASM or YASM. But in practice it's often easiest to just avoid hassling with assemblers and toolchains and use the AT&T syntax, despite the fact that you might not like it.
Some personal favorites include:
https://blogs.oracle.com/ksplice/entry/strace_the_sysadmin_s...
https://blogs.oracle.com/ksplice/entry/attack_of_the_cosmic_...
https://blogs.oracle.com/ksplice/entry/much_ado_about_null_e...
EDIT: how do I format links nicely? markdown doesnt seem to work and help doesnt mention links
Here's a "Hello, World" in W:
write := 0x8B55, 0x8BEC, 0x085E, 0x4E8B, 0x8B04, 0x0656, 0x00B8,
0xCD40, 0x7321, 0x3102, 0x8BC0, 0x5DE5, 0x90C3
_() :=
{
write(1, "Hello, World!\r\n", 15)
}
[1] http://www.vttoth.com/CMS/index.php/projects/49[2] ftp://gateway.vttoth.com/pub/w.zip
Luckily, the demo scene has collectively decided to go back and open source much of it's best work recently: http://www.displayhack.org/2012/the-great-demoscene-sourceco...
The most recent 4ks are nothing short of stunning: http://www.youtube.com/watch?feature=player_embedded&v=0...
The demo scene has been around for decades
Wow. That is super-impressive.
int main()
{
char *str = "hello world\n";
int len = 12;
__asm__ ( "int $0x80"
:: "a" (4), "b" (1), "c" (str), "d" (len)
);
return 0;
}From the guidelines:
"What to Submit
On-Topic: Anything that good hackers would find interesting. That includes more than hacking and startups. If you had to reduce it to a sentence, the answer might be: anything that gratifies one's intellectual curiosity."