Hello world!

JAVA

class myfirstpost
{
public static void main(String args[])
{
System.out.println(“Hello World!”);
}
}

C
#include <stdio.h>

main()
{
for(;;)
{
printf (“Hello World!\n”);
}
}

PHP
<?php Echo “Hello, World!”; ?>

Python
#!/usr/bin/python
# My first post
print “Hello, World!\n”

Prolog

| ?- write('Hello world!').

Hello world!

Perl

#!/usr/local/bin/perl
print "Content-type: text/html\n\n";
print "<H1>Hello World</H1>\n";
Ruby
 irb(main):001:0>"Hello world"
=>"Hello world"

Assembly

CODE
.syntax unified

@ ——————————–
.global main
main:
@ Stack the return address (lr) in addition to a dummy register (ip) to
@ keep the stack 8-byte aligned.
push {ip, lr}

@ Load the argument and perform the call. This is like ‘printf(“…”)’ in C.
ldr r0, =message
bl printf

@ Exit from ‘main’. This is like ‘return 0’ in C.
mov r0, #0 @ Return 0.
@ Pop the dummy ip to reverse our alignment fix, and pop the original lr
@ value directly into pc — the Program Counter — to return.
pop {ip, pc}

@ ——————————–
@ Data for the printf calls. The GNU assembler’s “.asciz” directive
@ automatically adds a NULL character termination.
message:
.asciz “Hello, world.\n”


Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s