- FA29011671FB6E7C802D18C92D4B94C2D32BB54145A929ECE7780830ACE49582A6EA090AD4678B55A403FA5EBEC34AA091C8672CE1D060E18ED6C87D554E87E9
+ C6CE2B2EFEC9BF6172130008C0EA7703D08D07862296A2CA5B1D790352697C3E05D2D233BFCF3F533164E45027A9BFA2815445FDB1E75807F5092335F99B03A4
ffa/ffacalc/ffa_calc.adb
(2 . 7)(2 . 7)
79 ------------------------------------------------------------------------------
80 -- This file is part of 'Finite Field Arithmetic', aka 'FFA'. --
81 -- --
82 -- (C) 2017 Stanislav Datskovskiy ( www.loper-os.org ) --
83 -- (C) 2018 Stanislav Datskovskiy ( www.loper-os.org ) --
84 -- http://wot.deedbot.org/17215D118B7239507FAFED98B98228A001ABFFC7.html --
85 -- --
86 -- You do not have, nor can you ever acquire the right to use, copy or --
(18 . 6)(18 . 7)
88 ------------------------------------------------------------------------------
89
90 -- Basics
91 with Version; use Version;
92 with OS; use OS;
93 with CmdLine; use CmdLine;
94
(33 . 9)(34 . 9)
96
97 procedure FFA_Calc is
98
99 Width : Positive; -- Desired FFA Width
100 Height : Positive; -- Desired Height of Stack
101 RNG : RNG_Device; -- The active RNG device.
102 Width : Positive; -- Desired FFA Width
103 Height : Positive; -- Desired Height of Stack
104 RNG : RNG_Device; -- The active RNG device.
105
106 begin
107 if Arg_Count < 3 or Arg_Count > 4 then
(449 . 13)(450 . 12)
109 when 'W' =>
110 Want(1);
111 declare
112 Measure : Word;
113 begin
114 -- Find the measure ( 0 if no 1s, or 1 .. FZBitness )
115 Measure := FFA_FZ_Measure(Stack(SP));
116 Measure : FZBit_Index := FFA_FZ_Measure(Stack(SP));
117 begin
118 -- Put on top of stack
119 FFA_FZ_Clear(Stack(SP));
120 FFA_FZ_Set_Head(Stack(SP), Measure);
121 FFA_FZ_Set_Head(Stack(SP), Word(Measure));
122 end;
123
124 -- Put the Overflow flag on the stack
(480 . 6)(480 . 18)
126 end loop;
127 Quit(0);
128
129 -- Put the FFACalc Program Version on the stack,
130 -- followed by FFA Program Version.
131 when 'V' =>
132 Push;
133 Push;
134 -- FFACalc Version:
135 FFA_FZ_Clear(Stack(SP - 1));
136 FFA_FZ_Set_Head(Stack(SP - 1), Word(FFACalc_K_Version));
137 -- FFA Version:
138 FFA_FZ_Clear(Stack(SP));
139 FFA_FZ_Set_Head(Stack(SP), Word(FFA_K_Version));
140
141 -- Square, give bottom and top halves
142 when 'S' =>
143 Want(1);
(509 . 7)(521 . 7)
145 ---------------------------------------------------------
146 when '!' | '@' | '$' | ':' | ';' | ',' |
147 'G' | 'H' | 'I' | 'J' | 'K' | 'N' |
148 'P' | 'T' | 'V' | 'X' | 'Y' =>
149 'P' | 'T' | 'X' | 'Y' =>
150
151 E("This Operator is not defined yet: " & C);
152 ---------------------------------------------------------