2016 Update

This commit is contained in:
Tina Müller 2016-12-05 22:15:40 +01:00
parent 948b86eafa
commit dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions

View file

@ -1,10 +1,13 @@
{{selection|Short Circuit|Console Program Basics}}
[[Category:Simple]]
In this User Output task, the goal is to display the string "Hello world!" [sic] on a text console.
'''See also'''
* [[Hello world/Graphical]]
* [[Hello world/Line Printer]]
* [[Hello world/Newline omission]]
* [[Hello world/Standard error]]
* [[Hello world/Web server]]
;Task:
Display the string '''Hello world!''' on a text console.
;Related tasks:
*   [[Hello world/Graphical]]
*   [[Hello world/Line Printer]]
*   [[Hello world/Newline omission]]
*   [[Hello world/Standard error]]
*   [[Hello world/Web server]]
<br><br>

View file

@ -0,0 +1 @@
'Hello world!'

View file

@ -1 +1 @@
((main { "Hello world!" << }))
"Hello world!" <<

View file

@ -1,2 +1,2 @@
open monad io
do putStrLn "Googbye, World!" ::: IO
do putStrLn "Hello world!" ::: IO

View file

@ -1,4 +1,4 @@
#symbol Program =
#symbol program =
[
system'console writeLine:"Hello world!".
].

View file

@ -1,5 +1,5 @@
[[
#define start ::= "?" < system'console.eval&writeLine( > $literal < ) >;
]]
#import system.
#import system'dynamic.
? "Hello world!"
#symbol program
= Tape("Hello world!",system'console,%"writeLine[1]").

View file

@ -0,0 +1,5 @@
\documentclass{scrartcl}
\begin{document}
Hello World!
\end{document}

View file

@ -1,10 +1,11 @@
.data
hello: .asciiz "Hello world!"
.data #section for declaring variables
hello: .asciiz "Hello world!" #asciiz automatically adds the null terminator. If it's .ascii it doesn't have it.
.text
main:
la $a0, hello
li $v0, 4
syscall
li $v0, 10
syscall
.text # beginning of code
main: # a label, which can be used with jump and branching instructions.
la $a0, hello # load the address of hello into $a0
li $v0, 4 # set the syscall to print the string at the address $a0
syscall # make the system call
li $v0, 10 # set the syscall to exit
syscall # make the system call

View file

@ -1 +1 @@
`Hello world!\n' print
`Hello world!\n' print flush

View file

@ -1 +1,3 @@
echo("Hello world!");
echo("Hello world!"); // writes to the console
text("Hello world!"); // creates 2D text in the object space
linear_extrude(height=10) text("Hello world!"); // creates 3D text in the object space

View file

@ -1 +1,5 @@
(Hello world!) ==
%!PS
/Helvetica 20 selectfont
70 700 moveto
(Hello world!) show
showpage

View file

@ -1 +1 @@
(Hello world!) =
(Hello world!) ==

View file

@ -1 +1 @@
(Hello world!) print
(Hello world!) =

View file

@ -0,0 +1 @@
(Hello world!) print

View file

@ -0,0 +1,8 @@
%!PS
/Helvetica 20 selectfont
70 700 moveto
(Hello world!) dup dup dup
= print == % prints three times to the console
show % prints to document
1 0 div % provokes error message
showpage

View file

@ -0,0 +1 @@
println("Hello world!");

View file

@ -0,0 +1 @@
import __hello__

View file

@ -0,0 +1 @@
import __phello__

View file

@ -0,0 +1 @@
import __phello__.spam

View file

@ -0,0 +1 @@
$>.puts "Hello world!"

View file

@ -0,0 +1 @@
$>.write "Hello world!\n"

View file

@ -0,0 +1,23 @@
// No "main" used
// compile with `gcc -nostdlib`
#define SYS_WRITE $1
#define STDOUT $1
#define SYS_EXIT $60
#define MSGLEN $14
.global _start
.text
_start:
movq $message, %rsi // char *
movq SYS_WRITE, %rax
movq STDOUT, %rdi
movq MSGLEN, %rdx
syscall // sys_write(message, stdout, 0x14);
movq SYS_EXIT, %rax
xorq %rdi, %rdi // The exit code.
syscall // exit(0)
.data
message: .ascii "Hello, world!\n"