

                                roll the DICE...

                        Some changes to the DICE program

                                written by TAD



        Here is a brief description of the changes to DICE
        (well, all the ones I can remember. #;o)



1) Re-coded the Debug/User page switching routine.

        It now uses the CRTC Screen-start registers instead of the normal
        Int21h, func:05 method which seemed to have problems on my new PC.
        (I don't know if it's Windows98, my bios or the video-card.. #:o(

        Anyway this method is shorter, quicker and works!! (grin).


2) Detection of Ruud's "ShowThis" routine in the [F8]-step function

        Before the [F8]-Step function would simply place a breakpoint
        after a GOSUB instruction and run the SPEW program, but because
        Ruud's "ShowThis" routine modified the return-address (to print
        the ASCII string after the GOSUB) the breakpoint was never found.

        The new method solves this return-address modification by looking
        at the first opcode at the GOSUB routine address. If this first
        opcode is "POPB [xxx]" then it assumes that the routine modifies
        the return-address and so executes the program until it encounters 
        the correct RETURN instruction. DICE then triggers a breakpoint.

        E.g.
                4F0     GOSUB   ShowThis
                4F2     db 'An message here',13,10
                503     LDA     [1E8]
                505     ... etc ...

        ShowThis:
                800     POPB    [927]           ;#
                802     POPB    [926]           ;#  Pop return-address
                        ... print string ...
                830     PUSHB   [926]           ;#
                832     PUSHB   [927]           ;# push NEW return-address
                834     RETURN                  ;  return back to 503 hex

        So the new [F8]-step will detect the "POPB [xxx]" at the start
        of the "ShowThis" routine and will trace until it encounters
        the final RETURN. The routine changes the return-address in
        order to print the ASCII string, the old [F8]-Step function
        (like TurboDebug, CodeView etc...) wouldn't have stopped because
        NO instructions are executed at 4F2 hex (the return-address).

        
3) Added the [SHIFT-T] and [SHIFT-P] functions

        These move the mem-window to begin at the STK or PC register
        address. So you can quickly see/edit the stack or instructions.


4) Added the [ALT-A] ASCII-toggle function

        This enables or disables the ASCII characters in the cpu
        window after the opcode word. You can now see the messages
        after the ShowThis or other routines more easily.


5) Added [ALT-F9] run until function

        This allows a break-point address to be entered before the
        program is run (just like TurboDebug's ALT-F9).


6) Added memory-edit & [BACKSPACE] functions

        This [BS] backspace key now moves the mem-editing cursor
        left by 1 nibble, but doesn't clear the nibble (same as
        the [LEFT] key).


7) Some internal code re-ordering

        Added some more comments and made the OSCALL emulation
        much better. It now has far less flicker and is much
        faster, especially when running a spew program.


8) Shortened the info-bar descriptions

        Needed some more space to add the new function keys, so
        I made the descriptions much shorter.


9) Post-mortem

        You can now view the cpu registers/memory and user screen
        AFTER a SPEW program has terminated (very handy for seeing
        what went wrong..)

        Of course you can't step, trace, run the program after it
        has terminated (yes, I have put a test in).


regards
        TAD     #:o)
