comparison doc/internals.txt @ 365:6a98cc90c14f

Added resolve passes
author lost@starbug
date Wed, 14 Apr 2010 20:49:04 -0600
parents d96c30e60ddf
children 34dfc9747f23
comparison
equal deleted inserted replaced
364:0b5a26bedbe1 365:6a98cc90c14f
22 22
23 Pass 3 23 Pass 3
24 ------ 24 ------
25 25
26 This pass resolves all instruction sizes that can be resolved without 26 This pass resolves all instruction sizes that can be resolved without
27 setting addresses for instructions. This process is repeated until no 27 forcing any instruction sizes. This pass will run repeatedly until no
28 further instructions sizes are resolved. 28 no new resolution occurs.
29 29
30 Pass 4 30 Pass 4
31 ------ 31 ------
32 32
33 This pass assigns addresses to all symbols where values are known. It does 33 Work through all un-resolved instructions and force sizes. After each size
34 the same for instructions. Then a repeat of similar algorithms as in the 34 is forced, try re-resolving all other instructions. This is done starting
35 previous pass is used to resolve as many operands as possible. 35 at the beginning of the source and working forward. If any instruction does
36 36 not resolve when forced, an error will be thrown.
37 This pass is repeated multiple times until no further instructions or
38 symbols are resolved.
39
40 Pass 5
41 ------
42
43 Finalization of all instruction sizes by forcing them to the maximum
44 addressing mode. Then all remaining instruction addresses and symbol values
45 are resolved.
46
47 Pass 6
48 ------
49
50 This pass does actual code generation. This is the notional second pass. All
51 other passes are the notional first pass.
52
53
54 Expression Evaluation
55 =====================
56
57 Each expression carries a certainty flag. Any expression in which any term
58 is flagged as uncertain is, itself, uncertain. There are a few specific
59 cases where such uncertainty can cancel out. For instance, X-X where X is
60 uncertain is guaranteed to be 0 and so there is no uncertainty.
61