- 216 -
8. Set a task that is activated at MR100 system startup in the configuration file
7.2.2
Writing Kernel Interrupt Handler
When describing the kernel interrupt handler in assembly language, observe the following precautions
1. At the beginning of file, be sure to include "mr100.inc" which is in the system directory.
2. For the symbol indicating the interrupt handler start address, make the external declara-
tion(Global declaration).
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 mr100.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 7.8 Example of kernel(OS-depend) interrupt handler
7.2.3
Writing Non-kernel Interrupt Handler
1. For the symbol indicating the interrupt handler start address, make the external declaration
(public declaration).
2. Make sure that the registers used in a handler are saved at the entry and are restored after
use.
3. Be sure to end the handler by REIT instruction.
4. No service calls can be issued from a non-kernel interrupt handler.
NOTE: If this restriction is not observed, the software may malfunction.
5. If you want multiple interrupts to be enabled in a non-kernel interrupt handler, always make
sure that the non-kernel interrupt handler is assigned a priority level higher than other
non-kernel interrupt handlers.
.GLB
inthand
-----
(1)
inthand:
; Registers used are saved to a stack
----- (2)
; interrupt process
; Registers used are restored
----- (2)
REIT
-----
(3)
Figure 7.9 Example of Non-kernel Interrupt Handler of Specific Level
7.2.4
Writing Cyclic Handler/Alarm Handler
When describing the cyclic or alarm handler in Assembly Language, observe the following precautions.
48
The relationship between task ID numbers and tasks(program) is defined in the configuration file.
49
Use the .GLB peudo-directive.
50
If you want the non-kernel interrupt handler to be assigned a priority level lower than kernel interrupt handlers, change the description of
the non-kernel interrupt handler to that of the kernel interrupt handler.
Содержание Emulator System M3T-MR100
Страница 3: ...M3T MR100 4 V 1 00 User s Manual User s Manual Rev 1 00 2007 09 Real time OS for R32C 100 Series...
Страница 6: ......
Страница 14: ......
Страница 16: ...xii...
Страница 18: ......
Страница 78: ......
Страница 242: ......
Страница 269: ...253 235 entry_address alm2 236 name ID_alm2 237 exinf 0x12345678 238 239 240 241 242 End of Configuration 243...
Страница 279: ...263...
Страница 290: ......
Страница 294: ......
Страница 304: ...288...
Страница 306: ...1753 Shimonumabe Nakahara ku Kawasaki shi Kanagawa 211 8668 Japan M3T MR100 4 V 1 00 REJ10J1523 0100 User s Manual...