Coding - A bug in the STS?

Scenergy #02
                A bug in the STS?

 In preparation ZXA library to
publication I have encountered a strange
STS behavior when debugging examples of work
with the library. I can not say for sure:
Is this a bug or just a feature of the STS
work, but everyone should know about it so
not to seek non-existent bugs in its
code.
 Thus, debugging the following piece of code:


        CALL ZXA_DRAW_FRAME
INT_COUNTER EQU $ +1

        LD A, 00

A interrupt hung the following snippet:


        LD HL, INT_COUNTER

        INC (HL)
 And (an important point!) Time
ZXA_DRAW_FRAME procedure was slightly
more interruptions, ie, during her work
interruption occurred necessarily.
 So, if the line CALL ZXA_DRAW_FRAME
is present (it is installed PC) and
if you go into this line of STS SS + T, then
The SP register CHANGE YOUR VALUE! And
its value must be equal to # FBxx
where xx - any number.

 What it is: a bug or not? I do not know ... Know
Only, he spent several hours at
search for bugs in your code (since code
worked, if it is run, and did not work
when debugging in STS).

 Here is an example program for debugging
which can interfere with expression of
this error:

        DI

        LD HL, # 6000

        LD DE, # 6001

        LD BC, # 100

        LD (HL), # 61

        LDIR

        LD A, # C3

        LD (# 6161), A

        LD HL, IM2

        LD (# 6162), HL

        LD A, # 60

        LD I, A

        IM 2

        EI
LOOP HALT

        CALL PROC; ***
INT_CNT LD A, 00

        LD BC, # 7FFE

        IN A, (C)

        AND 1

        JR NZ, LOOP

        IM 1

        RET

; HL = 4000 to the time of the procedure was
; Equals approximately 1.5 interrupt
; Pentagon'e without turbo mode.
PROC LD HL, 4000
L1 DEC HL

        LD A, H

        OR L

        JR NZ, L1

        RET

IM2 PUSH HL

        LD HL, INT_CNT +1

        INC (HL)

        POP HL

        EI

        RET
 Type in this program, compile,
Sign in STS, protrassiruyte to line
marked'***' and her then SS + T.
Then look at the register SP - I
its value after all these actions
becomes # FB00.
 But if after the line CALL PROC
add a few NOP'ov (enough to
JP x command does not cover the variable
INT_CNT), then everything will work fine.
So, in all likelihood, this problem
arises from the fact that the STS when you
SS + T just after the team puts the point
Stop and start it.
 Yes, forgot to say that this was checked
in the STS v4.3, possibly in other versions of all
normal.