Hello world/Text: Difference between revisions

m
Fix issues with mastermind language example.
m (Fix issues with mastermind language example.)
(40 intermediate revisions by 28 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 359 ⟶ 495:
swi 0</syntaxhighlight>
 
Alternative versions
=={{header|ARM Assembly}}==
 
<pre>
Developed on an Acorn A5000 with RISC OS 3.10 (30 Apr 1992)
Using the assembler contained in ARM BBC BASIC V version 1.05 (c) Acorn 1989
 
The Acorn A5000 is the individual computer used to develop the code,
the code is applicable to all the Acorn Risc Machines (ARM)
produced by Acorn and the StrongARM produced by digital.
 
In the BBC BASIC part of the program I have included:
Line 423 ⟶ 564:
EQUB &00 \ a terminating null (0)
ALIGN \ tell the assembler to ensure that the next item is on a word boundary
</pre>
 
=={{header|ArnoldC}}==
Line 524 ⟶ 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 544 ⟶ 696:
{{works with|Chipmunk Basic}}
{{works with|Commodore BASIC}}
{{works with|CZX Spectrum Basic}}
{{works with|GW-BASIC}}
{{works with|IS-BASIC}}
Line 553 ⟶ 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 562 ⟶ 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 643 ⟶ 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 814 ⟶ 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,344 ⟶ 1,509:
<syntaxhighlight lang="dragon">
showln "Hello world!"
</syntaxhighlight>
 
=={{header|DreamBerd}}==
<syntaxhighlight lang="text">
print "Hello world!"!
</syntaxhighlight>
 
Line 1,554 ⟶ 1,724:
 
=={{header|Elena}}==
ELENA 46.x:
<syntaxhighlight lang="elena">public program()
{
console.writeLine:("Hello world!")
}</syntaxhighlight>
 
Line 1,860 ⟶ 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,957 ⟶ 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,348 ⟶ 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,402 ⟶ 2,613:
 
=={{header|langur}}==
<syntaxhighlight lang="langur">writeln "yo, peepsHello"</syntaxhighlight>
 
=={{header|Lasso}}==
Line 2,753 ⟶ 2,964:
Hello world!
</syntaxhighlight>
 
=={{header|Mastermind}}==
<syntaxhighlight lang="mastermind">output "Hello world!\n";</syntaxhighlight>
 
=={{header|Mathcad}}==
Line 3,051 ⟶ 3,265:
Using <code>PRINT</code>:
<syntaxhighlight lang="ns-hubasic">10 PRINT "HELLO WORLD!"</syntaxhighlight>
 
=={{header|Nu}}==
<syntaxhighlight lang="nu">
print "Hello world!"
</syntaxhighlight>
 
=={{header|Nutt}}==
Line 3,190 ⟶ 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,234 ⟶ 3,465:
<pre>$ ol hello-Owl.scm
Hello world!</pre>
 
 
=={{header|Oxygene}}==
From [[wp:Oxygene (programming language)]]
<syntaxhighlight lang="oxygenepascal">
namespace HelloWorld;
Line 3,257 ⟶ 3,489:
end.
</syntaxhighlight>
{{out}}
<pre>
>HelloWorld.exe
Hello world!
</pre>
Line 3,758 ⟶ 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,795 ⟶ 4,032:
 
call lineout ,"Hello world!"</syntaxhighlight>
 
=={{header|Rhovas}}==
 
<syntaxhighlight lang="360 assembly">
print("Hello world!");
</syntaxhighlight>
 
=={{header|Ring}}==
Line 3,824 ⟶ 4,067:
=={{header|Rockstar}}==
<syntaxhighlight lang="rockstar">Shout "Hello world!"</syntaxhighlight>
 
=={{header|RPG}}==
<nowiki>**</nowiki>free<br>
dsply 'Hello World!';
 
=={{header|RPL}}==
≪ "Hello world!" 1 DISP
In RPL, the standard output console is the stack itself.
1 FREEZE <span style="color:grey">@ remove this line on HP-28 models</span>
≪ "Hello world!" ≫
≫ '<span style="color:blue">TASK</span>' STO
 
=={{header|RTL/2}}==
Line 4,062 ⟶ 4,310:
=={{header|Slope}}==
<syntaxhighlight lang="slope">(write "Hello, world!")</syntaxhighlight>
 
=={{header|SmallBASIC}}==
<syntaxhighlight lang="smallbasic">PRINT "Hello world!"</syntaxhighlight>
 
=={{header|Smalltalk}}==
Line 4,278 ⟶ 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,390 ⟶ 4,636:
@print-str ( str* -- )
&while
LDAk #18.Console/write DEO
INC2 LDAk ?&while
POP2
Line 4,609 ⟶ 4,855:
 
=={{header|Wren}}==
<syntaxhighlight lang="ecmascriptwren">System.print("Hello world!")</syntaxhighlight>
 
=={{header|X10}}==
Line 4,760 ⟶ 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>
 
Line 4,837 ⟶ 5,061:
 
=={{header|Zig}}==
 
'''Works with:''' 0.10.x, 0.11.x, 0.12.0-dev.1389+42d4d07ef
 
<syntaxhighlight lang="zig">const std = @import("std");
 
pub fn main() !void {
pub fn main() std.fs.File.WriteError!void {
try std.io.getStdOut().writer().writeAll("Hello world!\n");
const stdout = std.io.getStdOut();
 
try stdout.writeAll("Hello world!\n");
}</syntaxhighlight>
 
14

edits