[dll dl++ sl%.= llls 1+>>] s>[q] s1[.* dss]s [pl%1 -s%]s< 23s%3 d1-p s+p[d dvss 3sll> x_<1l-x ]ds-x
is equivalent to
[dlldl++sl%.=/llls1+>>]s>[q]s1[.*dss]s/[pl%1-s%]s<23s%3d1-ps+p[ddvss3sll>x_<1l-x]ds-x
Check the "/" character!
#---------------------------------------------------------#
## 2020-11-02 EG Giessmann (CC-BY) ##
## remove the comments for a clean POSIX input ##
#---------------------------------------------------------#
# if you prefer the output in one long line then replace #
# the command "p" everywhere by "dn32P" (it's non-POSIX) #
# [dlldl++sl%.=/llls1+>>]s>[q]s1[.*dss]s/[dn32Pl%1-s%]s< #
# 23s%3d1-dn32Ps+dn32P[ddvss3sll>x_<1l-x]ds-x AP #
#---------------------------------------------------------#
[ # the factor lookup macro ">"
dll # double top of the stack, load the factor register 'l' for testing
dl++ # double the factor value, add 2 from the "+" register
sl # and store the next factor "l+2" in the factor register 'l'
%.=/ # if the top is equal to "." (aka zero!) modulo factor, call the composite found macro "/"
llls1+ # load the the next factor "l" and load the square root "s", add 1 to "s"
>> # as long as "s+1" is still greater than factor "l", call the factor lookup macro ">" again
]s>
[ # the quit macro "1"
q # leave dc if all the primes are printed out
]s1
[ # the composite found macro "/"
.*dss # multiply the top with zero (aka "."), double and store it in register "s" (zeroize it)
]s/
[ # the prime printing macro "<"
p # print the prime on the top of the stack
l%1-s% # load the counter register "%", subtract 1 and store it again
]s<
23s% # store 23 in the counter register "%" (23 primes are in [5..99] and 1227 in [5..9999])
3d1- # push 3 on the stack, double it and subtract 1 ("2ds+p1+p" works here as well)
ps+p # print the top (it is 2), store it in register "+" to be used later, print the top (now 3)
[ # main macro "-"
ddvss # triple the top, store the square root of the top in register "s"
3sl # store the initial factor 3 in the factor register "l"
l>x # load and execute the factor lookup macro ">", it stops if the top has a factor or is a prime
_<< # call the printing macro "<" if "_" (also zero) is less than the top, i.e. it's a prime
l++ # add 2 (aka register "+") to the top
l%1>1 # load the counter register "%", if it is less than 1 then execute the quit macro "1"
l-x # if not yet finished load the main macro "-" and execute it again
]ds-x # double the main macro, store and run it