-
Notifications
You must be signed in to change notification settings - Fork 5
/
TODO
86 lines (63 loc) · 2.67 KB
/
TODO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
DONE Add outraw outrab and use them so that we can generate relocations
DONE Check error cases (seg +seg , unknown + seg etc)
DONE Automatic symbols __code __data __bss __endcode __enddata __endbss
DONE - Need to add .code .equ and all the other .byte type stuff that is nice to have
- .include for asm hacking (or parse cpp #line)
DONE Check that JR works with symbols properly (require they are in the same .o maybe)
DONE
Rules for segment v absolute
seg - seg = absolute if same seg
seg - seg = error if not
seg + abs = seg
seg - abs = seg
abs any abs = abs
multiply/divide of segs -> disallow ? and require things like
x / 2 - y / 2 is done as (x - y) / 2 ?
DONE Proper error messages needed
DONE Error checking
later:
need a syntax/operator for high/low byte of seg
output is then segbyteh or segbytel and follows same rules as segment
(what about mixing them ?)
DONE PC relative 8 and 16bit addressing (including dealing with processors
using .+2 etc as the base).
DONE - Proper output logic
DONE - write an invalid header
DONE - for each segment
DONE - write segment (counting relocs)
DONE - write reloc tab (or fold it in ?)
DONE - write symbol table
DONE - write debug table
DONE - rewind and fix header
Relocation types
DONE versus our segment base for this object module (usual)
DONE versus other segment base for this module
DONE versus unresolved symbol
DONE PC relative (not so much Z80)
Need to support relocations for 16bit and also 8bit ZP. Do we need to extend
the assembler to support relocations for high 8 / low 8 ? Probably not for Z80
and means more reloc info in syms/addrs but would do for other processors like
6502. Ugly because if we do then we need not just a segment for an address
but also to know if its address high/address low/address/absolute - add to
a_type somehow ?
link
DONE read each module header that we include
DONE load its symbols
DONE compute base of each versus segment
DONE compute base of segments (split I/D differs a bit etc)
DONE resolve all symbols we can
DONE write out segments relocating and resolving
DONE Unresolved symbols allowed for -r
For debug scan each module header again and then
copy all the debug symbols (relocating as we go)
DONE Libraries
XXX Ranlib (sorted instead)
Idea
.module
Assembler would flush all locals across the .module boundary
Would get relocations for each thing across boundary if done right
(test on globals and module id)
Could we even just make it a .o file having multiple obj headers etc ?
Basically we need a multiple object module format for objects too
for banked stuff etc and nice packing for segments or rolling 8K
and so on. Could use ar format and pull in each module for .o