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
178
179
180
181
182
183
184
185
186
|
1 ;--------------------------------------------------------
2 ; File Created by SDCC : free open source ANSI-C Compiler
3 ; Version 3.5.0 #9253 (Mar 24 2016) (Linux)
4 ; This file was generated Wed Aug 23 21:44:59 2017
5 ;--------------------------------------------------------
6 .module memory
7 .optsdcc -mz80
8
9 ;--------------------------------------------------------
10 ; Public variables in this module
11 ;--------------------------------------------------------
12 .globl _pages_table
13 .globl _mmu_write_table
14 .globl _page_map
15 .globl _page_unmap
16 ;--------------------------------------------------------
17 ; special function registers
18 ;--------------------------------------------------------
19 ;--------------------------------------------------------
20 ; ram data
21 ;--------------------------------------------------------
22 .area _DATA
0000 23 _pages_table::
0000 24 .ds 192
25 ;--------------------------------------------------------
26 ; ram data
27 ;--------------------------------------------------------
28 .area _INITIALIZED
29 ;--------------------------------------------------------
30 ; absolute external ram data
31 ;--------------------------------------------------------
32 .area _DABS (ABS)
33 ;--------------------------------------------------------
34 ; global & static initialisations
35 ;--------------------------------------------------------
36 .area _HOME
37 .area _GSINIT
38 .area _GSFINAL
39 .area _GSINIT
40 ;--------------------------------------------------------
41 ; Home
42 ;--------------------------------------------------------
43 .area _HOME
44 .area _HOME
45 ;--------------------------------------------------------
46 ; code
47 ;--------------------------------------------------------
48 .area _CODE
49 ;kernel/memory.c:5: int mmu_write_table(void)
50 ; ---------------------------------
51 ; Function mmu_write_table
52 ; ---------------------------------
0000 53 _mmu_write_table::
54 ;kernel/memory.c:9: for (i = 0; i < PAGES_MAX_COUNT; i++) {
0000 21 00 00 [10] 55 ld hl,#0x0000
0003 56 00102$:
0003 23 [ 6] 57 inc hl
0004 7D [ 4] 58 ld a,l
0005 D6 20 [ 7] 59 sub a, #0x20
0007 7C [ 4] 60 ld a,h
0008 17 [ 4] 61 rla
0009 3F [ 4] 62 ccf
000A 1F [ 4] 63 rra
000B DE 80 [ 7] 64 sbc a, #0x80
000D 38 F4 [12] 65 jr C,00102$
66 ;kernel/memory.c:15: return 0;
000F 21 00 00 [10] 67 ld hl,#0x0000
0012 C9 [10] 68 ret
69 ;kernel/memory.c:18: int page_map(int page, int pid, uint16_t addr)
70 ; ---------------------------------
71 ; Function page_map
72 ; ---------------------------------
0013 73 _page_map::
0013 DD E5 [15] 74 push ix
0015 DD 21 00 00 [14] 75 ld ix,#0
0019 DD 39 [15] 76 add ix,sp
77 ;kernel/memory.c:20: if (page >= PAGES_MAX_COUNT)
001B DD 7E 04 [19] 78 ld a,4 (ix)
001E D6 20 [ 7] 79 sub a, #0x20
0020 DD 7E 05 [19] 80 ld a,5 (ix)
0023 17 [ 4] 81 rla
0024 3F [ 4] 82 ccf
0025 1F [ 4] 83 rra
0026 DE 80 [ 7] 84 sbc a, #0x80
0028 38 05 [12] 85 jr C,00102$
86 ;kernel/memory.c:21: return -1;
002A 21 FF FF [10] 87 ld hl,#0xFFFF
002D 18 38 [12] 88 jr 00105$
002F 89 00102$:
90 ;kernel/memory.c:23: if (pages_table[page].used)
002F 11r00r00 [10] 91 ld de,#_pages_table+0
0032 DD 4E 04 [19] 92 ld c,4 (ix)
0035 DD 46 05 [19] 93 ld b,5 (ix)
0038 69 [ 4] 94 ld l, c
0039 60 [ 4] 95 ld h, b
003A 29 [11] 96 add hl, hl
003B 09 [11] 97 add hl, bc
003C 29 [11] 98 add hl, hl
003D 19 [11] 99 add hl,de
003E 4D [ 4] 100 ld c,l
003F 44 [ 4] 101 ld b,h
0040 7E [ 7] 102 ld a,(hl)
0041 E6 01 [ 7] 103 and a,#0x01
0043 28 05 [12] 104 jr Z,00104$
105 ;kernel/memory.c:24: return -2;
0045 21 FE FF [10] 106 ld hl,#0xFFFE
0048 18 1D [12] 107 jr 00105$
004A 108 00104$:
109 ;kernel/memory.c:26: pages_table[page].addr = addr;
004A 59 [ 4] 110 ld e, c
004B 50 [ 4] 111 ld d, b
004C 13 [ 6] 112 inc de
004D 13 [ 6] 113 inc de
004E C5 [11] 114 push bc
004F 21 0A 00 [10] 115 ld hl, #0x000A
0052 39 [11] 116 add hl, sp
0053 01 04 00 [10] 117 ld bc, #0x0004
0056 ED B0 [21] 118 ldir
0058 C1 [10] 119 pop bc
120 ;kernel/memory.c:27: pages_table[page].pid = pid;
0059 69 [ 4] 121 ld l, c
005A 60 [ 4] 122 ld h, b
005B 23 [ 6] 123 inc hl
005C DD 7E 06 [19] 124 ld a,6 (ix)
005F 77 [ 7] 125 ld (hl),a
126 ;kernel/memory.c:29: pages_table[page].used = 1;
0060 0A [ 7] 127 ld a,(bc)
0061 F6 01 [ 7] 128 or a,#0x01
0063 02 [ 7] 129 ld (bc),a
130 ;kernel/memory.c:30: return 0;
0064 21 00 00 [10] 131 ld hl,#0x0000
0067 132 00105$:
0067 DD E1 [14] 133 pop ix
0069 C9 [10] 134 ret
135 ;kernel/memory.c:33: int page_unmap(int page)
136 ; ---------------------------------
137 ; Function page_unmap
138 ; ---------------------------------
006A 139 _page_unmap::
006A DD E5 [15] 140 push ix
006C DD 21 00 00 [14] 141 ld ix,#0
0070 DD 39 [15] 142 add ix,sp
143 ;kernel/memory.c:35: if (page >= PAGES_MAX_COUNT)
0072 DD 7E 04 [19] 144 ld a,4 (ix)
0075 D6 20 [ 7] 145 sub a, #0x20
0077 DD 7E 05 [19] 146 ld a,5 (ix)
007A 17 [ 4] 147 rla
007B 3F [ 4] 148 ccf
007C 1F [ 4] 149 rra
007D DE 80 [ 7] 150 sbc a, #0x80
007F 38 05 [12] 151 jr C,00102$
152 ;kernel/memory.c:36: return -1;
0081 21 FF FF [10] 153 ld hl,#0xFFFF
0084 18 22 [12] 154 jr 00105$
0086 155 00102$:
156 ;kernel/memory.c:38: if (pages_table[page].used == 0)
0086 11r00r00 [10] 157 ld de,#_pages_table+0
0089 DD 4E 04 [19] 158 ld c,4 (ix)
008C DD 46 05 [19] 159 ld b,5 (ix)
008F 69 [ 4] 160 ld l, c
0090 60 [ 4] 161 ld h, b
0091 29 [11] 162 add hl, hl
0092 09 [11] 163 add hl, bc
0093 29 [11] 164 add hl, hl
0094 19 [11] 165 add hl,de
0095 5D [ 4] 166 ld e,l
0096 54 [ 4] 167 ld d,h
0097 7E [ 7] 168 ld a,(hl)
0098 E6 01 [ 7] 169 and a,#0x01
009A 20 05 [12] 170 jr NZ,00104$
171 ;kernel/memory.c:39: return -2;
009C 21 FE FF [10] 172 ld hl,#0xFFFE
009F 18 07 [12] 173 jr 00105$
00A1 174 00104$:
175 ;kernel/memory.c:41: pages_table[page].used = 0;
00A1 1A [ 7] 176 ld a,(de)
00A2 E6 FE [ 7] 177 and a,#0xFE
00A4 12 [ 7] 178 ld (de),a
179 ;kernel/memory.c:42: return 0;
00A5 21 00 00 [10] 180 ld hl,#0x0000
00A8 181 00105$:
00A8 DD E1 [14] 182 pop ix
00AA C9 [10] 183 ret
184 .area _CODE
185 .area _INITIALIZER
186 .area _CABS (ABS)
|