plugins/elf: Update for aspace.analisys_stack_push() signature change.
[ScratchABit.git] / help.py
blob0bac7fbae790e1e819d6defc856c50853cb09da3
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/>.
17 HELP = """\
18 Global commands ("letter" commands are case-sensitive, e.g. Shift+a
19 is actually "capital A", so make sure Caps Lock is right):
21 g - Goto address
22 Esc - Return to address from previous Enter cmd (as stack)
23 Shift+s - Save database
24 q - Quit
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:
32 u - Undefine
33 c - Make code
34 d - Make/Cycle data
35 a - Make ASCII string
36 f - Make filler (ignored bytes, to avoid leaving them undefined)
37 n - (Re)name address (make label)
38 i - Info
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>"):
54 c - call from <addr>
55 j - jump from <addr>
56 r - read at <addr>
57 w - write at <addr>
58 o - offset/address taken at <addr>
60 Key to memory map (Shift+i):
61 For each byte, type is shown:
62 . - unknown
63 F - first byte of instruction, the instruction belonging
64 to a known function
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)
71 """
73 from picotui.editorext import Viewer
75 L = 5
76 T = 2
77 W = 70
78 H = 20
80 cpu_help = ""
82 def set_cpu_help(txt):
83 global cpu_help
84 cpu_help = "\nCPU-specific information:\n" + txt
87 def help(screen):
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())
91 v.loop()