On 30 Apr 2012, at 14:05, Marcel Kilgus wrote:

> Bob Spelten wrote:
>>> Nothing to do with BPUT here. The problem is that you're using an
>>> array expression x(0,1) with more than one dimension in the FOR loop.
>>> SBASIC got a bug there.
>> Thanks for the insight.
>> I was puzzled because it had worked before.
>> But I did at one point replace the single var for the array var.
>> This line may have been untested since.
>> I'll check all my FOR loops and add this to my database of potential
>> errors.
> 
> Mind you, it only seems to be a problem for single line loops.
> 
> The fix is fairly trivial (it's just one thrashed register), when we
> can get another SMSQ/E release together it will go in. Apart from that
> it's easy enough to avoid and at least results in a clean error and
> not in a crash or anything.

A new version of SMSQ/E should also have a corrected version of 
smsq_init_exv_asm. The code dealing with address errors for machines other than 
68000/8 contains the following three instructions intended to compress the 
stack.

MOVE.L  (A7),(A7,D0.W)
MOVE.W 4(A7),4(A7,D0.W)
MOVE.L  6(A7),6(A7,D0.W)

If D0 is greater than 0 and less than 6 this will fail. One of the possible 
values of D0 is indeed 4.

The correction is to swap the first and last instructions to prevent the 
premature overwriting.

I commented on this peculiarity some years ago but nobody noticed.


George


_______________________________________________
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm

Reply via email to