Dies ist eine alte Version des Dokuments!
Inhaltsverzeichnis
Small Programmes
Test halt on overflow
As it is rather unusual that the machine stops on overflow, here is a small test program:
halt on overflow
;zzz0700'
/zzz0700'
00 b0016' get start
01 a0017' stops if overflow
u0001' loop
variables:
;zzz0716'
,zzz0002'
16 7ww00000' start
17 00002000' increment
go
.zzz0700'
Hello
The follwing program to print Hello on the console is rather untypical:
Print Hello ; 0600' / 0600' xp1600' CR xz0000' sync xp0800' UC xz0000' xp4900' H xz0000' xp0400' LC xz0000' xp3700' e xz0000' xp0600' l = 1 xz0000' xp0600' l xz0000' xp3500' o xz0000' xz0800' pause unless Br8 u0000' repeat . 0600'
Simple Loop
Example looping program that prints a given number of asterisks:
simple loop
; 0900'
/ 0900'
00 xp0800' upper case
xz0000' sync
xp1600' CR
xz0000'
b0022' start value
u0007' avoid data wait
06 b0020' get counter
07 s0021' minus step
t0013' done if negative
h0020' save
xp1000' print *
xz0000'
u0006' repeat
13 xz0000' halt
14 u0000' restart
data:
; 0920'
,000 03'
20 00000000' counter
21 00000010' decrement
22 00000050' initial
start:
. 0900'
Printing all digits
The following example prints all characters in numerical sequence, all digits as an example. It shows how to modify instructions:
simple loop
; 0900'
/ 0900'
00 xp0800' upper case
xz0000' sync
xp1600' CR
xz0000'
b0022' start value
u0007' avoid data wait
06 b0020' get counter
07 s0021' minus step
t0013' done if negative
h0020' save
xp1000' print *
xz0000'
u0006' repeat
13 xz0000' halt
14 u0000' restart
data:
; 0920'
,000 03'
20 00000000' counter
21 00000010' decrement
22 00000050' initial
start:
. 0900'
