*
.   display stack pointer at entry
.
regs:      proc
eot        equ     etx
           leax    =(" - SP=",eot),pc
           bsr     pdata
           tfr     u,d                 system stack pointer at interrupt
           bsr     hexword
*
.   display contents of user stack register
.
           leax    =("  US=",eot),pc
           bsr     pdata
           ldd     8,u                 user stack pointer
           bsr     hexword
*
.   display contents of direct page register
.
           leax    =("  DP=",eot),pc
           bsr     pdata
           lda     3,u                 direct page register
           bsr     hexbyte
*
.   display contents of X index register
.
           leax    =("  IX=",eot),pc
           bsr     pdata
           ldd     4,u                 X index register
           bsr     hexword
*
.   display contents of Y index register
.
           leax    =("  IY=",eot),pc
           bsr     pdata
           ldd     6,u                 Y index register
           bsr     hexword
*
.   display program counter from stack
.
           leax    =(cr,"    - PC=",eot),pc
           bsr     pdata
           ldd     10,u                program counter at interrupt
           bsr     hexword
*
.   display contents of A accumulator
.
           leax    =("  A=",eot),pc
           bsr     pdata
           lda     1,u                 A accumulator register
           bsr     hexbyte
*
.   display contents of B accumulator
.
           leax    =("  B=",eot),pc
           bsr     pdata
           lda     2,u                 B accumulator register
           bsr     hexbyte
*
.   set up to display condition flag register
.
           leax    =("  CC:",eot),pc
           bsr     pdata
           lda     0,u                 Get Condition Flag Byte
           ldb     #8
           leax    ="EFHINZVC",pc
*
.   dump out the condition flag bits one bit at a time
.
           pshs    d
dobit      bsr     outsp               output a leading space char
           lda     0,x+                get next condition letter
           lsl     0,s                 shift data byte left by one
           bcs     bitout              if carry set, bit is correct
           lda     #"-"                else load a hyphen char
bitout     bsr     outch               output the data byte
           dec     1,s                 decrement the bit counter
           bne     dobit               loop if not done
           ret     d

           end
