Hi
HSE is right.
The following code works for me.
I added a seed value (initial state), so that on each run it generates a different value.
PCG32_STATE = @CatStr(@SubStr(%@Time, 1, 2), @SubStr(%@Time, 4, 2), @SubStr(%@Time, 7, 2))
__randa macro
local r, t, x
PCG32_STATE = PCG32_STATE * 6364136223846793005 + 0xda3e39cb94b95bdb
t = PCG32_STATE
r = ( ( ( t shr 18 ) xor t ) shr 27 )
; r = ( ( ( t sar 18 ) xor t ) sar 27 )
x = t shr 59
t = r shr x
r = r shl ( -x and 31 )
r = r or t
r = r and 0x7F
exitm <r>
endm
__randc macro
local a
a = __randa()
while a gt 'z' or \
a lt '0' or \
a ge ':' and a le '>' or \
a ge '[' and a le '`' and a ne '_'
a = __randa()
endm
exitm <a>
endm
__rands macro n
local string
.data
string label byte
repeat n
db __randc()
endm
db 0
.code
exitm <string>
endm
Note: it appears that the calculations are performed using 64 bits, but that is not the case. The values are truncated internally to 32 bits!
Biterider