Renesas 70 Manual De Usuario

Descargar
Página de 162
Chapter 5 Detailed Applications 
   
- 75 - 
5.2.2 
Writing Kernel(OS-dependent) Interrupt Handler 
When describing the kernel(OS-dependent) interrupt handler in assembly language, observe the following pre-
cautions 
1.  At the beginning of file, be sure to include "mr308.inc" which is in the system directory. 
2.  For the symbol indicating the interrupt handler start address, make the external declara-
tion(Global declaration).
53
3.  Make sure that the registers used in a handler are saved at the entry and are restored after 
use. 
4.  Return to the task by ret_int service call. 
 
.INCLUDE mr308.inc 
 
------(1) 
.GLB 
inth 
  ------(2) 
 
 inth: 
;  Registers used are saved to a stack 
------(3) 
iwup_tsk  #ID_task1 

process 
 
;  Registers used are restored 
------(3) 
 
ret_int 
   ------(4) 
 
 
Figure 5.8 Example of kernel(OS-depend) interrupt handler 
                                                      
53
  Use the .GLB peudo-directive.