-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcalc.kdp
89 lines (82 loc) · 1.18 KB
/
calc.kdp
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
einfügen
move.kdp
*einfügen
einfügen
alu.kdp
*einfügen
einfügen
decimal.kdp
*einfügen
methode calcDecimal1
toDecimal1
decimalToInput2
add
resultToInput1
toDecimal1
tr;schritt(4);tl
decimalToInput2
wiederhole 10 mal
add
resultToInput1
*wiederhole
*methode
methode calcDecimal2
toAlu;clear
toDecimal2
decimalToInput2
add
resultToInput1
toDecimal2
tr;schritt(4);tl
decimalToInput2
wiederhole 10 mal
add
resultToInput1
*wiederhole
*methode
{ clear everything }
clearDecimal3
clearBlocks
toAlu
clear
clearCarry
{ load decimals }
calcDecimal1
resultToRegister
calcDecimal2
registerToInput1
resultToRegister
registerToInput2
toDecimal2;f;tr;schritt(11)
wenn istZiegel dann
mul
sonst
f
wenn istZiegel dann
tl
wenn istZiegel dann
add
sonst
div
registerToDecimalRemainder
*wenn
sonst
sub
toResult
tr;schritt(14)
wenn istMarke dann {negative result}
resultToRegister
registerToInput2
invertInput2
toInput1
clear
setCarry
add
resultToRegister
registerToDecimalNegative
beenden
*wenn
*wenn
*wenn
resultToRegister
registerToDecimal