-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdiv.mr
More file actions
104 lines (94 loc) · 833 Bytes
/
div.mr
File metadata and controls
104 lines (94 loc) · 833 Bytes
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
GET
SWAP b
GET
SWAP c
RESET g
SWAP b
JZERO 75(end code)
SWAP b
SWAP c
JZERO 72(end code)
SWAP c
(fix sign mark h)
RESET h
SWAP c
JNEG 2
JUMP 5
SWAP c
RESET a
SUB c
INC h
SWAP c
SWAP b
JNEG 2
JUMP 5
SWAP b
RESET a
SUB b
DEC h
SWAP b
RESET d (shifted)
RESET e (shifted 1)
RESET g (shift count)
RESET f (1)
INC f
INC e (from 1 or 0?)
SWAP d
ADD c
SWAP d
(beg_pre)
RESET a
ADD b
SUB d
JNEG 9 (end_pre)
SWAP e
SHIFT f
SWAP e
SWAP d
SHIFT f
SWAP d
INC g
JUMP -11 (beg_pre)
(end_pre)
DEC f
DEC f (-1)
DEC g
SWAP e
SHIFT f
SWAP e
SWAP d
RESET a
ADD c
SHIFT g
SWAP d
RESET g
SWAP e
(beg_div)
JZERO 16(end_div)
SWAP e
RESET a
ADD b
SUB d
JNEG 5(skip)
SWAP b
SWAP g
ADD e
SWAP g
(skip)
SWAP d
SHIFT f
SWAP d
SWAP e
SHIFT f
JUMP -15(beg_div)
(end_div)
SWAP h
JZERO 5 (end fix)
INC g
RESET a
SUB g
SWAP g
(end fix)
SWAP g (div)
PUT
HALT