ASM:
section .data ;section declarationmsg db "Hello, world!",0xA ;the stringlen equ $ - msg section .text ;section declaration ;we must export the entry point to the ELF linker or global _start ;loader. They conventionally recognize _start as their ;entry point. Use ld -e foo to override the default._start:;write our string to stdout mov eax,4 ;system call number (sys_write) mov ebx,1 ;first argument: file handle (stdout) mov ecx,msg ;second argument: pointer to message to write mov edx,len ;third argument: message length int 0x80 ;call kernel;and exit mov eax,1 ;system call number (sys_exit) xor ebx,ebx ;first syscall argument: exit code int 0x80 ;call kernel
nasm -f elf hello.asm; ld -s -o hello hello.o;./hello
C++
#include < iostream >int main(int argc, char** argv, char** env) { using namespace std; cout << "Hello World!" << endl; return 0;}
g++ -o hello hello.cpp; ./hello
C
#include < stdlib.h >int main(int argc, char** argv, char** env){ printf("Hello World!\n"); return 0;}
gcc -o hello hello.c; ./hello
Java
public class hello { public static void main(String args[]) { System.out.println("Hello World!"); }}
javac hello.java; java hello
BASIC
10 print "Hello World!"20 end
(BASIC shell)$ run
And this could go on and on and on. I suppose I should have made Hello World in #defines alone, template processing done with the compiler itself, perl, PASCAL, shell commands, etc. I've listed justed a few, and I do mean only a few, of the many, many langauges out there also known as tools for the developer. Get this, some people even make their own languages when no others seem to do. And maybe when you graduate from the language wars you can get into fullfledged API wars! Then, and only after then, you may realize: "CRAP! I should have studied software design methodologies and techniques to further my craft by way of a solid foundation!?!"
To the original creator of this thead: Look at the examples I have posted. See which is easier for you to comprehend with no previous knowledge of programming. To anybody that hasn't stopped to think about it (except you magmai ) Ever wonder why BASIC is a prerequisite for any computer programming course right after an "Introduction to Computers" type class??? Hmm, that's a coincedence. Not enough for you? Ask any competant programmer if they have crossed BASIC early in their pre-programming career.
B eginners A ll-purpose S ymbolic I nstruction C ode
The emphasis on beginner.
This thread is ohhh so close to dying as I am about to close it...
YAP-YFIO
-deadlinegrunt
DOH! stupid HTML tags -- See you have one over me right there.
Edited by - deadlinegrunt on November 6, 2001 9:52:56 PM