A clearer example:
C++ code for "Hello, World!"
Quote:
#include <iostream.h>
#include
int main()
{
std::cout << "Hello, world!\n";
}
|
x86 Assembly code for "Hello, World!"
Quote:
title Hello World Program (hello.asm)
; This program displays "Hello, World!"
dosseg
.model small
.stack 100h
.data
hello_message db 'Hello, World!',0dh,0ah,'$'
.code
main proc
mov ax,@data
mov ds,ax
mov ah,9
mov dx,offset hello_message
int 21h
mov ax,4C00h
int 21h
main endp
end main
|
Note that I indicated x86 assembly because assembly, unlike C++, is not portable. C++ code can run on Macintosh computers as well as IBM PCs, therefore it is portable, x86 assembly code, in contrast, normally won't run on Mac PPCs because they use a different instruction set. If you wish, you can go to the Hello, World! page (where I got the source codes) and see for yourself the differences of assembly language, from system to system, where as, although there are dialects of C++, the example will run on any system.
__________________
"You know, every time a soldier is killed in Iraq it is YOUR FAULT for things like this!!!!" ~Spaztic
"I fake so many people that I don't know what my own name is any more." ~Overlord
"Well... UR MOMS FAT" ~CrimiClown®
"Why is baking soda so magically delicious?" ~Doubble Dutch
"Hypodise." ~Link
Last edited by Lama; Jan 15, 2002 at 02:34 AM.
|