08c91d97d7e99e16d5363e2221aaa12a311d6550
[fw/sdcc] / sim / ucsim / doc / analyzer.html
1 <html>
2 <head>
3 <title>UCSIM: Code Analyzer</title>
4 </head>
5
6 <body bgcolor="white">
7
8 <h1>Code analyzer</h1>
9
10 This feature is included into both DOS and UNIX versions. Code
11 analyzer analyzes the code of the simulated program and tries to
12 figure out which address contains valid instruction. Analyzer starts
13 analyzing of the code with address 0 which always must contain an
14 instruction because reset of the device sets zero into program
15 counter. So, analyzer marks address 0 that it contains an
16 instruction. Then it marks the address of the next instruction and so
17 on. If the analyzer finds a <i>jump</i> instruction it continues with
18 destination address of the <i>jump</i> instruction. If it finds a
19 <i>call</i> instruction, it recursively analyzes destination address
20 as well as next instruction follows the <i>call</i> one. Analyzator
21 stops if it finds an address which is already marked or if it finds a
22 <i>return</i> instruction or an indirect <i>jump</i> which is
23 impossible to follow. All these mean that it is impossible to discover
24 all instructions of the program.
25
26 <p>This problem is solved in very simple way in UNIX version. If the
27 execution reaches an umarked address, the analyzer is called to
28 analyze the code starting at actual address pointed by the PC. This
29 method is not included into DOS version but this re-analyzation can be
30 requested by pressing Ctrl-F7 at any time.
31
32 <hr>
33
34 </body>
35 </html>