1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
.EQU status_reg=252
.EQU in_dev=253
.EQU out_dev=255
.EQU zero_bit=0
.EQU carry_bit=2
COPYLR tape dp
start_program:
COPYIR dp out_dev
COPYRI in_dev dp
COPYRI in_dev dp
COPYIR dp out_dev
COPYLR 29 handle_dv_i
CALL handle_dv_i
COPYLR 29 handle_dv_i
CALL handle_dv_i
COPYIR dp out_dev
COPYRI in_dev dp
COPYIR dp out_dev
COPYLR 30 handle_dv_i
CALL handle_dv_i
COPYIR dp out_dev
COPYIA dp
CBR carry_bit status_reg
ADDLA 2
COPYAI dp
INCR dp
COPYIA dp
CBR carry_bit status_reg
ADDLA 3
COPYAI dp
label_943925932591:
COPYIA dp
BCRSC zero_bit status_reg
JUMP label_continue_943925932591
COPYLR 29 handle_dv_i
CALL handle_dv_i
DECR dp
COPYLR 30 handle_dv_i
CALL handle_dv_i
INCR dp

JUMP label_943925932591
label_continue_943925932591:
DECR dp
COPYIR dp out_dev
HALT
HALT
handle_dv_i:
.DB 0
dp:
.DB 0
RETURN
tape: