OXYGENHUB
◆ main openmsx / share / scripts / _stack.tcl
343 B · Tcl · last changed chore(): initial commit 1 month ago source blame history raw
1
set_help_text stack \
2
{Show the <count> top most entries on the CPU stack.
3
4
If <count> is not specified, 8 entries are returned.
5
Usage:
6
   stack [<count>]
7
}
8
proc stack {{depth 8}} {
9
	set result ""
10
	for {set i 0; set sp [reg SP]} {$i < $depth} {incr i; incr sp 2} {
11
		append result [format "%04x: %04x\n" $sp [peek16 $sp]]
12
	}
13
	return $result
14
}