-
Notifications
You must be signed in to change notification settings - Fork 0
/
mon1750.M
executable file
·177 lines (168 loc) · 4.91 KB
/
mon1750.M
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
OUTPUT_FORMAT("coff-m1750")
OUTPUT_ARCH(m1750a)
SEARCH_DIR(/opt/m1750-ada/m1750-coff/lib);
STARTUP(art0.o);
ENTRY(start)
/*
* Set _STACK_SIZE to the size in bytes of the main stack. The main stack
* is used by the function 'main' and any other functions it calls. The
* minimum size is the size is 2 bytes (assuming trivial main and no
* interrupts). Subprograms that require a stack frame use >= 4 bytes.
*/
_STACK_SIZE = 1K;
/*
* The interrupt stack is used by asynchronous stack-switching interrupt
* handlers and anything that can interrupt such a handler. The minimum
* size, assuming all 16 levels can interrupt, is 21 words per level i.e.
* 21 * 15 = 315. The size is application dependent. See the file
* /opt/<product>/m1750/include/intrrpt.h.
*/
_ISTACK_SIZE = 1K;
/*
* Set _PROM_SIZE to the size of the PROM in 8-bit bytes. If you have no
* PROM then use the value zero.
*/
_PROM_SIZE = 64K;
/*
* Set _RAM_SIZE to the size of the RAM in 8-bit bytes.
*/
_RAM_SIZE = 48K; /* f000 for data buffer */
/*
* Set _RAM_START to the address of the first location in RAM.
*/
_RAM_START = 0x00010000;
/*
* Set _PROM_START to the address of the first location in PROM.
*/
_PROM_START = 0x00000000;
/*
* This is the default memory layout. You may change this as necessary by
* editing the SECTIONS statements that follow:
*
* +--------------------+
* 0x00000000 | .init | Entry point and
* | *(.init) | interrupt vectors and
* | | startup code
* +--------------------+
* +--------------------+
* | .text |
* | _stext |
* | *(.text) | Program instructions for
* | _etext | address state 0
* | _endtext |
* +--------------------+
* +--------------------+
* | .rdata |
* | _srdata |
* | *(.rdata) | Read only data sections
* | -erdata |
* | .idata |
* | _sidata |
* | *(.data) | Data sections initial values
* | -eidata |
* +--------------------+
* +--------------------+
* 0x0001b000 | .data |
* | _sdata |
* | *(.data) | Initialized data sections
* | _edata |
* +--------------------+
* | .bss |
* | __bss_start | Start of bss, cleared by crt0
* | *(.bss) | Unitialized data sections
* +--------------------+
* | _end | Start of heap, used by sbrk()
* | _sheap | The heap grows upward (down
* | heap space | the page) from _sheap.
* / /
* / /
* 0x0001b7fe | _eheap |
* +--------------------+
* 0x0001b800 | main stack |
* | _sstack | The stack grows downward, from
* | (1K) | _estack.
* | |
* 0x0001bbfe | _estack |
* +--------------------+
* 0x0001bc00 | interrupt stack |
* | _sistack |
* | (1K) | The interrupt stack grows downward
* | | from _eistack.
* 0x0001bffe | _eistack |
* +--------------------+
* 0x0001fffe +--------------------+
*
*/
_RAM_END = _RAM_START + _RAM_SIZE;
/*
* start and end of interrupt stack
*/
_eistack = _RAM_END - 2;
_sistack = _RAM_END - _ISTACK_SIZE;
/*
* Start and end of main stack
*/
_estack = _sistack - 2;
_sstack = _sistack - _STACK_SIZE;
/*
* End of heap
*/
_eheap = _sstack - 2;
SECTIONS
{
.init 0x00000000 : {
*(.init)
FILL(0x7400);
. = 0x00000040;
}
.ivec 0x00000040 : {
*(.ivec)
FILL(0x7400);
. += 0x00000080;
}
.text 0x00000100 : {
_stext = .;
*(.text0)
*(.text)
_etext = .;
}
.rdata : {
. = ALIGN(2);
_srdata = .;
*(.rdata)
__CTOR_LIST__ = .;
LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
*(.ctors)
LONG(0)
__CTOR_END__ = .;
__DTOR_LIST__ = .;
LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
*(.dtors)
LONG(0)
__DTOR_END__ = .;
_erdata = .;
. = ALIGN(2);
_sidata = .;
}
.data 0x0001b000 : AT (_sidata) {
. = ALIGN(2);
_sdata = .;
*(.data)
. = ALIGN(2);
_edata = .;
}
.bss : {
. = ALIGN(2);
__bss_start = .;
*(.bss)
*(COMMON)
_end = .;
_sheap = .;
}
.stab 0 (NOLOAD) : {
[ .stab ]
}
.stabstr 0 (NOLOAD) : {
[ .stabstr ]
}
}