first of all the program code from the sr-52 in condensed form:

000 LBL D

002 CMS

003 LBL E

005 CLR

006 RCL 99

009 HLT

010 STO 98

013 STO 99

016 LBL A

018 INV STF 1

021 RCL 98

024 HLT

025 -

026 4

027 )

028 IF+

029 A

030 +

031 3

032 )

033 INV IF+

035 A

036 +

037 1

038 )

039 +/-

040 SUM 98

043 RCL 98

046 IFZ

047 9'

048 .2

050 IND SUM 98

054 LBL B

056 STF 1

058 RCL 98

061 STO 00

064 E'

065 E'

066 E'

067 STO 19

070 RCL 98

073 STO 00

076 RCL 97

079 INV D/R

081 -

082 C'

083 +

084 .5

086 )

087 STO 97

090 *

091 RCL 19

094 )

095 +/-

096 LBL LST

098 DSZ

099 0

100 +

101 IND RCL 00

105 INV LNX

107 )

108 INV IF+

110 LST

111 RCL 00

114 IFZ

115 9'

116 .1

118 IND SUM 00

122 RCL 00

125 STO 98

128 GTO A

130 LBL C'

132 FIX 0

134 EE

135 INV EE

137 INV FIX

139 RTN

140 LBL E'

142 DSZ

143 0

144 IND RCL 00

148 INV LNX

150 +

151 RTN

152 LBL 9'

154 RCL 99

157 STO 00

160 LBL GTO

162 1

163 STO 19

166 IND RCL 00

170 -

171 C'

172 IND STO 00

176 -

177 .1

179 )

180 INV IF+

182 DSZ

183 INV IFZ

185 1'

186 1

187 +/-

188 PRD 19

191 LBL 1'

193 RCL 19

196 IFF 1

198 2'

199 +/-

200 LBL 2'

202 IND SUM 00

206 LBL DSZ

208 DSZ

209 GTO

210 IFF 1

212 E

213 PI

214 C

215 HLT

i am still interested in the conversion of this program to a 15c program.

in line 64, 65, 66 the subroutine E' is three times consecutive requested. in E' the DSZ (line 142) performs decrement and skips branching, according to some fellow members of the forum.

with the multiple decrement, the register reaches zero, and, that is the question, goes into the negative realm ...

the 15c performs allways a decrement, so if nullified branching with, for example, a LBL .0 (the poor man's NOP ;) ), the program continues.

this is part one. the other question is, which register content is returned in line 144, if the pointer register contains a negative number. the 15c takes the absolute value and returns it or if out of range, error 3.

additional short interpretation:

- r[97] is ran#

- line 76 performs kind of random number ...

- C' performs an INT(x + 0.5)

*Edited: 23 May 2012, 4:49 p.m. *