======================================================= /* C++ hello world */ #include using namespace std; int main() { cout << "Hello World" << endl; return 0; } ======================================================= /* C Hello World */ #include int main() { printf("Hello World\n"); exit(0); } ======================================================= ;ASM [NASM] Hello World ;Linux on an Intel x86 section .text global _start _start: ;write our string to stdout mov edx,len mov ecx,msg mov ebx,1 mov eax,4 int 0x80 ;and exit mov ebx,0 mov eax,1 int 0x80 section .data msg db "Hello, world!",0xa len equ $ - msg ======================================================= ;ASM [MASM] Hello World ;DOS on an Intel x86 .model small .stack 100h .data message db "Hello World", 13, 10, "$" .code start: mov ax, @data mov ds, ax mov dx, offset message ; copy address of message to dx mov ah, 9h ; subprogram for string output int 21h ; call ms-dos to display string mov ax, 4c00h int 21h end start