Tracing Makefile bug
[fw/sdcc] / doc / choices.txt
1 Some of the implementation choices
2 ----------------------------------
3
4 gbz80:
5
6 Load from direct space:
7   Alternatives:
8   1.  Via HL
9         ld hl,#dir
10         ld x,(hl)
11         inc hl
12         ld y,(hl)
13   2.  Via a
14         ld a,(dir)
15         ld x,a
16         ld a,(dir+1)
17         ld x,a
18   1 is bad when x or y involve HL (1b)
19                                         8       16      32
20      1 = 12 + n*(8+8) - 8               20      36      68
21      1b = n*(12+12+8)                   32      64      128
22      2 = n*(16+4)                       20      40      80
23   So choose 2.
24
25   Hmm.  (2) is too hard to support in the current model.
26
27 On stack word push
28    1.    lda  hl,x(sp)
29          ld   a,(hl+)
30          ld   h,(hl)
31          ld   l,a
32          push hl
33    2.    lda  hl,x(sp)
34          ld   e,(hl)
35          inc  hl
36          ld   d,(hl)
37    1 = d + 8 + 8 + 4
38    2 = d + 8 + 8 + 8