commit ea3a9860c43a39c9dade61ce8d871594ecdec420
parent 691f818fea79d93e15a328bba33920262d98830b
Author: Alexander Burger <abu@software-lab.de>
Date: Mon, 4 Jul 2011 18:02:04 +0200
Improved 'seed' for pil64
Diffstat:
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/lib/tags b/lib/tags
@@ -275,7 +275,7 @@ pwd (2675 . "@src64/main.l")
queue (1918 . "@src64/sym.l")
quit (1090 . "@src64/main.l")
quote (139 . "@src64/flow.l")
-rand (2976 . "@src64/big.l")
+rand (2975 . "@src64/big.l")
range (997 . "@src64/subr.l")
rank (3033 . "@src64/subr.l")
raw (450 . "@src64/main.l")
@@ -289,7 +289,7 @@ rollback (1889 . "@src64/db.l")
rot (848 . "@src64/subr.l")
run (311 . "@src64/flow.l")
sect (2541 . "@src64/subr.l")
-seed (2958 . "@src64/big.l")
+seed (2959 . "@src64/big.l")
seek (1275 . "@src64/apply.l")
send (1128 . "@src64/flow.l")
seq (1081 . "@src64/db.l")
diff --git a/src64/big.l b/src64/big.l
@@ -1,4 +1,4 @@
-# 20jun11abu
+# 04jul11abu
# (c) Software Lab. Alexander Burger
### Destructive primitives ###
@@ -2948,6 +2948,7 @@
add C (E DIG) # Add next digit
ld E (E BIG)
loop
+ shr E 3 # Keep sign
add C E # Add final short
end
ld E C # Return counter
@@ -2964,9 +2965,7 @@
mul E # times 'Seed'
add D 1 # plus 1
ld (Seed) D # Save
- shl C 32 # Get middle 64 bits
- shr A 32
- or A C
+ shr A (- 32 3) # Get higher 32 bits
ld E A
off E 7 # Keep sign
or E CNT # Make short number