“Hello, World!”程序是一个只在计算机屏幕上打印出“Hello, World!”(英语,意为“世界,你好!”)字串的计算机程序。该程序通常是计算机程序设计语言的初学者所要学习编写的第一个程序。它还可以用来确定该语言的编译器、程序开发环境以及运行环境已经正确安装。 Gok8:,
/*g9drwaa
将Hello World程序作为第一个学写的程序,现在已经成为一种传统。该程序最早出现在由Brian Kernighan和Dennis Ritchie写的计算机程序设计教程《C语言程序设计》。 ~Ab nksR
08)X:@ w?
以下是用不同语言写成的Hello World程序的几个例子: mmk]Doy?#
Ada [Xp{ztGE
with Ada.Text_Io; use Ada.Text_Io; HSq.0vYl6
procedure Hello is [$; \1P/
begin z{h#l!Edh
Put_Line ("Hello, world!"); }1]E=!?)&
end Hello; :eaqUW!Y
\QF\Bh
En&bwLu:s
汇编语言 rMDo5Z2
Hya ";'
x86 CPU,DOS,TASM <~aQ_l
MODEL SMALL _@es9
IDEAL K:}~8 P>^
STACK 100H ^/;W;C{4
HI}$Z=C
DATASEG Wtl0qug
HW DB 'Hello, world!$' mNcoR^(VN
cSdkhRAn
CODESEG mHTZ:84
MOV AX, @data 4%l
@
MOV DS, AX f1R&Q
MOV DX, OFFSET HW rNzsc|a:
MOV AH, 09H 1rhsmcE
INT 21H /4 zO
MOV AX, 4C00H j.C)KwelBS
INT 21H *2MM
END e&&;"^@-
Q_}i8p'
cG%ttfq\
x86 CPU,GNU/Linux,NASM eF8!}|*N
;"Hello World" for Linux on Intel 80x86 using nasm (Intel syntax). )9_jr(s
;Enter this into "hello.asm" then type: &cj/8A5-
;"nasm -f elf hello.asm" %9.]
bd|%F
;"ld hello.o -o hello" KX*Hev'K
;"./hello" $`q8-+{
a
}6Fj&hj
section .data ;data section declaration KM$5ZbCF:
msg db 'Hello World!',0AH ?VM# Nf\
len equ $-msg ;string length Dd+ f,$
ciKkazx.
section .text ;code section declaration BoZG^
global _start ;entry point (start of execution) |7IlYy&:
_start: mov edx,len ;string length ibDMhW$n
mov ecx,msg ;string start |&