Subversion Repositories HelenOS

Rev

Rev 115 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 115 Rev 125
Line 93... Line 93...
93
	movl %esp,%ebp
93
	movl %esp,%ebp
94
	pusha
94
	pusha
95
 
95
 
96
	push %ds
96
	push %ds
97
	push %es
97
	push %es
98
    
98
 
99
	# we must fill the data segment registers
99
	# we must fill the data segment registers
100
	movw $16,%ax
100
	movw $16,%ax
101
	movw %ax,%ds
101
	movw %ax,%ds
102
	movw %ax,%es
102
	movw %ax,%es
103
    
103
 
104
	movl $(\i),%edi
104
	movl $(\i),%edi
105
	pushl %ebp
105
	pushl %ebp
106
	addl $4,(%esp)
106
	addl $4,(%esp)
107
	pushl %edi
107
	pushl %edi
108
	call trap_dispatcher
108
	call trap_dispatcher
Line 111... Line 111...
111
	pop %es
111
	pop %es
112
	pop %ds
112
	pop %ds
113
 
113
 
114
	popa
114
	popa
115
	pop %ebp
115
	pop %ebp
116
    
116
 
117
        iret
117
	iret
118
    
118
 
119
	.if (\n-\i)-1
119
	.if (\n-\i)-1
120
	handler "(\i+1)",\n
120
	handler "(\i+1)",\n
121
	.endif
121
	.endif
122
.endm
122
.endm
123
 
123
 
Line 177... Line 177...
177
#
177
#
178
outb:
178
outb:
179
	push %ebp
179
	push %ebp
180
	movl %esp,%ebp
180
	movl %esp,%ebp
181
	pusha
181
	pusha
182
    
182
 
183
	movl 8(%ebp),%edx
183
	movl 8(%ebp),%edx
184
	movl 12(%ebp),%eax
184
	movl 12(%ebp),%eax
185
	outb %al,%dx
185
	outb %al,%dx
186
    
186
 
187
	popa
187
	popa
188
	pop %ebp
188
	pop %ebp
189
	ret
189
	ret
190
 
190
 
191
 
191
 
Line 195... Line 195...
195
#
195
#
196
outw:
196
outw:
197
	push %ebp
197
	push %ebp
198
	movl %esp,%ebp
198
	movl %esp,%ebp
199
	pusha
199
	pusha
200
    
200
 
201
	movl 8(%ebp),%edx
201
	movl 8(%ebp),%edx
202
	movl 12(%ebp),%eax
202
	movl 12(%ebp),%eax
203
	outw %ax,%dx
203
	outw %ax,%dx
204
    
204
 
205
	popa
205
	popa
206
	pop %ebp
206
	pop %ebp
207
	ret
207
	ret
208
 
208
 
209
 
209
 
Line 213... Line 213...
213
#
213
#
214
outl:
214
outl:
215
	push %ebp
215
	push %ebp
216
	movl %esp,%ebp
216
	movl %esp,%ebp
217
	pusha
217
	pusha
218
    
218
 
219
	movl 8(%ebp),%edx
219
	movl 8(%ebp),%edx
220
	movl 12(%ebp),%eax
220
	movl 12(%ebp),%eax
221
	outl %eax,%dx
221
	outl %eax,%dx
222
    
222
 
223
	popa
223
	popa
224
	pop %ebp
224
	pop %ebp
225
	ret
225
	ret
226
 
226
 
227
 
227
 
Line 237... Line 237...
237
CNT=16
237
CNT=16
238
memcopy:
238
memcopy:
239
	push %ebp
239
	push %ebp
240
	movl %esp,%ebp
240
	movl %esp,%ebp
241
	pusha
241
	pusha
242
    
242
 
243
	cld
243
	cld
244
	movl CNT(%ebp),%ecx
244
	movl CNT(%ebp),%ecx
245
	movl DST(%ebp),%edi
245
	movl DST(%ebp),%edi
246
	movl SRC(%ebp),%esi    
246
	movl SRC(%ebp),%esi
247
    
247
 
248
	rep movsb %ds:(%esi),%es:(%edi)
248
	rep movsb %ds:(%esi),%es:(%edi)
249
    
249
 
250
	popa
250
	popa
251
	pop %ebp
251
	pop %ebp
252
	ret
252
	ret
253
 
253
 
254
 
254
 
Line 263... Line 263...
263
X=16
263
X=16
264
memsetb:
264
memsetb:
265
	push %ebp
265
	push %ebp
266
	movl %esp,%ebp
266
	movl %esp,%ebp
267
	pusha
267
	pusha
268
    
268
 
269
	cld
269
	cld
270
	movl CNT(%ebp),%ecx
270
	movl CNT(%ebp),%ecx
271
	movl DST(%ebp),%edi
271
	movl DST(%ebp),%edi
272
	movl X(%ebp),%eax
272
	movl X(%ebp),%eax
273
    
273
 
274
	rep stosb %al,%es:(%edi)
274
	rep stosb %al,%es:(%edi)
275
    
275
 
276
        popa
276
	popa
277
	pop %ebp
277
	pop %ebp
278
	ret
278
	ret
279
 
279
 
280
 
280
 
281
## Fill memory with words
281
## Fill memory with words
Line 289... Line 289...
289
X=16
289
X=16
290
memsetw:
290
memsetw:
291
	push %ebp
291
	push %ebp
292
	movl %esp,%ebp
292
	movl %esp,%ebp
293
	pusha
293
	pusha
294
    
294
 
295
	cld
295
	cld
296
	movl CNT(%ebp),%ecx
296
	movl CNT(%ebp),%ecx
297
	movl DST(%ebp),%edi
297
	movl DST(%ebp),%edi
298
	movl X(%ebp),%eax
298
	movl X(%ebp),%eax
299
    
299
 
300
	rep stosw %ax,%es:(%edi)
300
	rep stosw %ax,%es:(%edi)
301
    
301
 
302
        popa
302
	popa
303
	pop %ebp
303
	pop %ebp
304
	ret
304
	ret
305
 
305
 
306
 
306
 
307
## Compare memory regions for equality
307
## Compare memory regions for equality
Line 318... Line 318...
318
	push %ebp
318
	push %ebp
319
	subl $4,%esp	
319
	subl $4,%esp	
320
	movl %esp,%ebp
320
	movl %esp,%ebp
321
 
321
 
322
	pusha
322
	pusha
323
    
323
 
324
	cld
324
	cld
325
	movl CNT(%ebp),%ecx
325
	movl CNT(%ebp),%ecx
326
	movl DST(%ebp),%edi
326
	movl DST(%ebp),%edi
327
	movl SRC(%ebp),%esi    
327
	movl SRC(%ebp),%esi
328
    
328
 
329
	repe cmpsb %es:(%edi),%ds:(%esi)
329
	repe cmpsb %es:(%edi),%ds:(%esi)
330
	movl %ecx,(%ebp)
330
	movl %ecx,(%ebp)
331
 
331
 
332
	popa
332
	popa
333
	
333