Home > Uncategorized > Hello World! in Assembly, C, C++, Java, LISP, Pascal, VHDL

Hello World! in Assembly, C, C++, Java, LISP, Pascal, VHDL

Wew, Hello World! in many programming languages.

Assembly

MIPS Assembly- RISC Processor

       .data
msg:     .asciiz "Hello, world!"
         .align 2
         .text
         .globl main
main:
         la $a0,msg
         li $v0,4
         syscall
         jr $ra

Intel x86,DOS, TASM

MODEL SMALL
IDEAL
STACK 100H

DATASEG
MSG DB 'Hello, World!', 13, '$'

CODESEG
Start:
MOV AX, @data
MOV DS, AX
MOV DX, OFFSET MSG
MOV AH, 09H ; output ascii string
INT 21H
MOV AX, 4C00H
INT 21H
END Start

C

#include <stdio.h>
int main(void){
	printf("Hello, world!\n");
	return 0;
}

C++

#include <iostream>

int main(){
	std::cout << "Hello, World!\n";
}

Java

public class HelloWorld
   {
        public static void main(String[] args)
        {
             System.out.println("Hello, world!");
        }
   }

LISP

(format t "Hello World!~%")
(write-line "Hello World!")
 "Hello World!"

VHDL

use std.textio.all;

ENTITY hello IS
END ENTITY hello;

ARCHITECTURE Scriptol OF hello IS
 CONSTANT message : string := "hello world";
BEGIN
 PROCESS
 variable L: line;
 BEGIN
 write(L, message);
 writeline(output, L);
 wait;
 END PROCESS;
END ARCHITECTURE Scriptol;

source: http://www.mycplus.com/featured-articles/hello-world-programs-in-300-programming-languages/

  1. April 7, 2009 at 8:55 pm

    wah, udah lama ga liat lisp, jadi kangen…

    ngga juga sih😛

  1. No trackbacks yet.

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

%d bloggers like this: