_stack.tcl 343 B

123456789101112131415
  1. set_help_text stack \
  2. {Show the <count> top most entries on the CPU stack.
  3. If <count> is not specified, 8 entries are returned.
  4. Usage:
  5. stack [<count>]
  6. }
  7. proc stack {{depth 8}} {
  8. set result ""
  9. for {set i 0; set sp [reg SP]} {$i < $depth} {incr i; incr sp 2} {
  10. append result [format "%04x: %04x\n" $sp [peek16 $sp]]
  11. }
  12. return $result
  13. }