Hello world/Text: Difference between revisions

m
Fix issues with mastermind language example.
m (Fix issues with mastermind language example.)
(27 intermediate revisions by 19 users not shown)
Line 44:
BR 14 Return
END
</syntaxhighlight>
 
=={{header|IBM Z HL/ASM}}==
Using Modern IBM Z High Level assembler to write 'Hello World' to the Unix System Services 'stdout' file descriptor
<syntaxhighlight lang="360 assembly">
PRINT ON,GEN,DATA
HELLO CSECT
HELLO RMODE ANY
HELLO AMODE 31
*
* Prolog
*
SAVE (14,12)
BASR R12,0
USING *,R12
STORAGE OBTAIN,LENGTH=DYNL,ADDR=(R11)
USING DYNAREA,R11
 
LA R2,DSA
ST R2,8(,R13)
ST R13,DSA+4
LR R13,R2
*
* Body
* Write Hello World to STDOUT
*
 
*
* Store values into parameter list
*
MVC REC(HWL),HW
LA R1,REC
ST R1,RECA
LA R1,HWL
ST R1,RECL
L R1,STDOUT
ST R1,FD
L R1,BPXALET
ST R1,ALET
 
CALL BPX1WRT,(FD, x
RECA, x
ALET, x
RECL, x
RV, x
RC, x
RN),MF=(E,BPXWRTD)
 
L R8,RV
L R9,RC
L R10,RN
*
* Epilog
*
L R13,DSA+4
STORAGE RELEASE,LENGTH=DYNL,ADDR=(R11)
RETURN (14,12),RC=0
 
*
* Statics, Dynamic Storage, Equates follows
*
* Naming convention:
* Suffixes:
* L : length
* S : static
* D : dynamic
* A : address
 
LTORG
*
* Statics (constants)
*
STDIN DC F'0'
STDOUT DC F'1'
STDERR DC F'2'
BPXALET DC F'0'
BPX1WRT DC V(BPX1WRT)
 
BPXWRTS CALL ,(0,0,0,0,0,0,0),MF=L
BPXWRTL EQU *-BPXWRTS
 
HW DC C'Hello World'
NEWLINE DC X'15'
HWL EQU *-HW
 
*
* Dynamic (storage obtain'ed) area
*
DYNAREA DSECT
*
* Dynamic Save Area regs always first
*
DSA DS 18F
 
*
* Working storage
*
FD DS F
 
RECSIZE EQU RECEND-*
REC DS CL80
RECEND EQU *
RECA DS A
BPXWRTD DS CL(BPXWRTL)
ALET DS F
RECL DS F
RV DS F
RC DS F
RN DS F
 
DYNL EQU *-DYNAREA
*
*
* End of working storage
*
 
*
* Equates
*
R0 EQU 0
R1 EQU 1
R2 EQU 2
R3 EQU 3
R4 EQU 4
R5 EQU 5
R6 EQU 6
R7 EQU 7
R8 EQU 8
R9 EQU 9
R10 EQU 10
R11 EQU 11
R12 EQU 12
R13 EQU 13
R14 EQU 14
R15 EQU 15
END
</syntaxhighlight>
 
Line 530 ⟶ 666:
 
<syntaxhighlight lang="babel">"Hello world!" <<</syntaxhighlight>
 
=={{header|BabyCobol}}==
<syntaxhighlight lang="cobol">
* Since no quotes are used, two undeclared fields (variables) are printed.
* Their default values are their own names in uppercase.
IDENTIFICATION DIVISION.
PROGRAM-ID. USER OUTPUT.
PROCEDURE DIVISION.
DISPLAY HELLO WORLD.
</syntaxhighlight>
 
=={{header|Bait}}==
Line 550 ⟶ 696:
{{works with|Chipmunk Basic}}
{{works with|Commodore BASIC}}
{{works with|CZX Spectrum Basic}}
{{works with|GW-BASIC}}
{{works with|IS-BASIC}}
Line 559 ⟶ 704:
{{works with|MSX BASIC}}
{{works with|QBasic}}
{{works with|Quite BASIC}}
{{works with|Run BASIC}}
{{works with|Tiny BASIC}}
{{works with|ZX Spectrum Basic}}
<syntaxhighlight lang="qbasic">10 print "Hello world!"</syntaxhighlight>
 
Line 568 ⟶ 715:
{{works with|BaCon}} [[Category:BaCon]]
{{works with|BASIC256}}
{{works with|FreeBASIC}}
{{works with|IS-BASIC}}
{{works with|M2000 Interpreter}}
{{works with|QBasic}}
{{works with|QB64}}
{{works with|Script Basic}}
{{works with|SmallBASIC}}
{{works with|Yabasic}}
<syntaxhighlight lang="qbasic">PRINT "Hello world!"</syntaxhighlight>
Line 649 ⟶ 800:
=={{header|Binary Lambda Calculus}}==
As explained at https://www.ioccc.org/2012/tromp/hint.html
<syntaxhighlight lang="blc"pre> Hello world!</syntaxhighlightpre>
 
=={{header|Bird}}==
Line 820 ⟶ 971:
<syntaxhighlight lang="brlcad">
echo Hello world!
</syntaxhighlight>
 
=={{header|Bruijn}}==
 
Ignore stdin by not referring to the abstraction:
 
<syntaxhighlight lang="bruijn">
main ["Hello world!"]
</syntaxhighlight>
 
Line 1,350 ⟶ 1,509:
<syntaxhighlight lang="dragon">
showln "Hello world!"
</syntaxhighlight>
 
=={{header|DreamBerd}}==
<syntaxhighlight lang="text">
print "Hello world!"!
</syntaxhighlight>
 
Line 1,560 ⟶ 1,724:
 
=={{header|Elena}}==
ELENA 46.x:
<syntaxhighlight lang="elena">public program()
{
console.writeLine:("Hello world!")
}</syntaxhighlight>
 
Line 1,866 ⟶ 2,030:
=={{header|GLBasic}}==
<syntaxhighlight lang="glbasic">STDOUT "Hello world!"</syntaxhighlight>
 
=={{header|Gleam}}==
<syntaxhighlight lang="gleam">
import gleam/io
 
pub fn main() {
io.println("Hello world!")
}
</syntaxhighlight>
 
=={{header|Glee}}==
Line 1,963 ⟶ 2,136:
=={{header|Hoon}}==
<syntaxhighlight lang="hoon">~& "Hello world!" ~</syntaxhighlight>
 
=={{header|Hopper}}==
<syntaxhighlight lang="csharp">program Hello
{
uses "/Source/Library/Boards/PiPico"
Hopper()
{
WriteLn("Hello world!");
loop
{
LED = !LED;
Delay(500);
}
}
}</syntaxhighlight>
 
{{out}}
In IDE, build hello.hs into hello.hexe, (press F7) and start debug (F5) or hm console monitor.
<pre>!> hello
Hello world!
</pre>
The language and runtime install verification message shows up on the monitor console. In keeping with most MCU introductions, the onboard Light Emitting Diode (LED) will then blink on and off at 1/2 second intervals, forever; ''(until power runs out, or explicit operator intervention)''.
 
=={{header|HPPPL}}==
Line 2,354 ⟶ 2,550:
 
<syntaxhighlight lang="kitten">"Hello world!" say</syntaxhighlight>
 
=={{header|KL1}}==
<syntaxhighlight lang="prolog>
:- module main.
 
main :-
unix:unix([stdio(normal(S))]),
S = [fwrite("Hello world\n")].
</syntaxhighlight>
 
=={{header|Koka}}==
Line 2,408 ⟶ 2,613:
 
=={{header|langur}}==
<syntaxhighlight lang="langur">writeln "yo, peepsHello"</syntaxhighlight>
 
=={{header|Lasso}}==
Line 2,759 ⟶ 2,964:
Hello world!
</syntaxhighlight>
 
=={{header|Mastermind}}==
<syntaxhighlight lang="mastermind">output "Hello world!\n";</syntaxhighlight>
 
=={{header|Mathcad}}==
Line 3,201 ⟶ 3,409:
=={{header|Onyx}}==
<syntaxhighlight lang="onyx">`Hello world!\n' print flush</syntaxhighlight>
 
=={{header|Onyx (wasm)}}==
<syntaxhighlight lang="TS">
use core {printf}
main :: () {
printf("Hello world!");
}
</syntaxhighlight>
{{out}}
<pre>
Hello world!
</pre>
 
=={{header|OOC}}==
Line 3,770 ⟶ 3,990:
=={{header|RED}}==
<syntaxhighlight lang="red">print "Hello world!"</syntaxhighlight>
 
=={{header|Refal}}==
<syntaxhighlight lang="refal">$ENTRY Go {
= <Prout 'Hello, world!'>;
};</syntaxhighlight>
 
=={{header|Relation}}==
Line 3,842 ⟶ 4,067:
=={{header|Rockstar}}==
<syntaxhighlight lang="rockstar">Shout "Hello world!"</syntaxhighlight>
 
=={{header|RPG}}==
<nowiki>**</nowiki>free<br>
dsply 'Hello World!';
 
=={{header|RPL}}==
Line 4,300 ⟶ 4,529:
20 END
</syntaxhighlight>
 
=={{header|Tiny Craft Basic}}==
<syntaxhighlight lang="basic">10 cls
20 print "Hello, World!"
30 shell "pause"</syntaxhighlight>
 
=={{header|TMG}}==
Line 4,412 ⟶ 4,636:
@print-str ( str* -- )
&while
LDAk #18.Console/write DEO
INC2 LDAk ?&while
POP2
Line 4,631 ⟶ 4,855:
 
=={{header|Wren}}==
<syntaxhighlight lang="ecmascriptwren">System.print("Hello world!")</syntaxhighlight>
 
=={{header|X10}}==
Line 4,782 ⟶ 5,006:
This is a good example of various ways to write function calls in YAMLScript.
 
Since function calls must fit into their YAML context, which may be mappings, sequences or scalars;
it is actually useful to support these variants.
 
<syntaxhighlight lang="yaml">
!yamlscript/v0
(println "Hello world!")
</syntaxhighlight>
 
say: "Hello, world!"
<syntaxhighlight lang="yaml">
(say "Hello world!")
</syntaxhighlight>
 
=>: (say "Hello, world!")
<syntaxhighlight lang="yaml">
say("Hello world!")
</syntaxhighlight>
 
=>: say("Hello, world!")
<syntaxhighlight lang="yaml">
say("Hello world!"):
</syntaxhighlight>
 
<syntaxhighlight lang="yaml">
say:
- =>: "Hello, world!"
</syntaxhighlight>
 
say: ("Hello, " + "world!")
<syntaxhighlight lang="yaml">
say: ["Hello world!"]
</syntaxhighlight>
 
say: ."Hello," "world!"
<syntaxhighlight lang="yaml">
say: "Hello world!"
</syntaxhighlight>
 
say "Hello,": "world!"
<syntaxhighlight lang="yaml">
say("Hello"): "world!"
</syntaxhighlight>
 
say "Hello," "world!":
<syntaxhighlight lang="yaml">
say: ["Hello", "world!"]
</syntaxhighlight>
 
<syntaxhighlight lang="yaml">
# The . at the start of a value is way to indicate that the value is a scalar (string).
# Without the . this would be invalid YAML(Script).
say: ."Hello", "world!"
</syntaxhighlight>
 
14

edits