September 2017 Update

This commit is contained in:
Ingy döt Net 2017-09-23 10:01:46 +02:00
parent bba7bfd280
commit ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions

View file

@ -0,0 +1,8 @@
' Hello, printer
READ msg$
DATA "Hello World!\n"
' Assume printer is on /dev/lp0
OPEN "/dev/lp0" FOR DEVICE AS printer
PUTBYTE msg$ TO printer SIZE LEN(msg$)
CLOSE DEVICE printer

View file

@ -0,0 +1,7 @@
(defun main ()
(with-open-file (stream "/dev/lp0"
:direction :output
:if-exists :append)
(format stream "Hello World~%")))
(main)

View file

@ -0,0 +1,61 @@
[ Hello world
===========
A program for the EDSAC
Can be used to print any character string:
the string (including necessary *F and #F
characters) should be stored in sequential
memory addresses beginning at @+17.
The last character of the string should be
marked with a 1 in the least significant
bit. This can be coded by using D in place
of F, e.g. AD would be an 'A' as the last
character
Works with Initial Orders 2 ]
T56K
GK
[ 0 ] O17@ [ Print character ]
[ 1 ] H17@ [ AND character with 1: ]
C15@ [ if the result is 1, we ]
S15@ [ have reached the end ]
E13@ [ of the string ]
T14@ [ Modify the orders in ]
A@ [ addresses @+0 and @+1 ]
A16@ [ to point to the next ]
T@ [ character ]
A1@
A16@
T1@
E@
[ 13 ] ZF
[ 14 ] PF
[ 15 ] PD
[ 16 ] P1F [ NB Least significant bit
is not part of address,
so add 2 not 1 ]
[ 17 ] *F [ Letter shift ]
HF
EF
LF
LF
OF
!F [ Blank ]
WF
OF
RF
LF
DF
@F [ Carriage return ]
&D [ Line feed + 1 ]
EZPF

View file

@ -0,0 +1,6 @@
import java.io.File
fun main(args: Array<String>) {
val text = "Hello World!\n"
File("/dev/lp0").writeText(text)
}

View file

@ -1,3 +1,3 @@
Sys.open(\var fh, '>', '/dev/lp0')
&& fh.println("Hello World!")
&& fh.close;
Sys.open(\var fh, '>', '/dev/lp0') \
&& fh.say("Hello World!") \
&& fh.close