1 # ScratchABit - interactive disassembler
3 # Copyright (c) 2015 Paul Sokolovsky
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 Global commands ("letter" commands are case-sensitive, e.g. Shift+a
19 is actually "capital A", so make sure Caps Lock is right):
22 Esc - Return to address from previous Enter cmd (as stack)
23 Shift+s - Save database
26 Shift+i - Show memory map (see key below)
27 Shift+w - Write complete disassembly listing to file 'out.lst'
28 Ctrl+q - Show problems list
30 Current address commands:
36 f - Make filler (ignored bytes, to avoid leaving them undefined)
37 n - (Re)name address (make label)
39 Ctrl+w - Write current function to a file
40 / - Search thru listing starting from current addr
41 Shift+/ - Continue search
42 Ctrl+u - Search next undefined
44 Current selected argument commands (require cursor to be on this
45 argument, but if an instruction has only one argument, will work
46 with cursor anywhere in the line):
48 Enter - Goto address in operand
49 h - Decimal/hex number
50 o - Make an offset/address
52 Key to cross-reference types as appears in the listing
53 ("xref: <addr> <type>"):
58 o - offset/address taken at <addr>
60 Key to memory map (Shift+i):
61 For each byte, type is shown:
63 F - first byte of instruction, the instruction belonging
65 f - continuation byte of function's instruction
66 C - first byte of instruction, not belonging to a function.
67 c - continuation byte of non-function instruction
68 D - first byte of a data item
69 d - continuation byte of a data item
70 X - conflicting flags (e.g. both code and data)
73 from picotui
.editorext
import Viewer
82 def set_cpu_help(txt
):
84 cpu_help
= "\nCPU-specific information:\n" + txt
88 screen
.dialog_box(L
, T
, W
, H
)
89 v
= Viewer(L
+ 1, T
+ 1, W
- 2, H
- 2)
90 v
.set_lines((HELP
+ cpu_help
).splitlines())