File: _stack.tcl

package info (click to toggle)
openmsx 21.0%2Bdfsg-3
  • links: PTS
  • area: main
  • in suites: sid
  • size: 28,132 kB
  • sloc: cpp: 244,928; xml: 54,344; tcl: 15,603; python: 5,335; perl: 281; sh: 78; makefile: 57
file content (14 lines) | stat: -rw-r--r-- 343 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
set_help_text stack \
{Show the <count> top most entries on the CPU stack.

If <count> is not specified, 8 entries are returned.
Usage:
   stack [<count>]
}
proc stack {{depth 8}} {
	set result ""
	for {set i 0; set sp [reg SP]} {$i < $depth} {incr i; incr sp 2} {
		append result [format "%04x: %04x\n" $sp [peek16 $sp]]
	}
	return $result
}