.module sys_time.c .area text 0000 _sys_time:: 0000 34 pshx 0001 B775 tfr s,x 0003 1B9C leas -4,sp 0005 ; // sys_time.c 0005 ; #include 0005 ; #include <912d60.h> 0005 ; #include "kernel.h" 0005 ; 0005 ; 0005 ; // GLOBAL VARIABLES 0005 ; static unsigned char abort; 0005 ; 0005 ; 0005 ; void sys_time(void) { 0005 ; 0005 ; abort = 0; 0005 790000 clr _abort 0008 ; set_task_priority(get_task_id(), 1); 0008 160000 jsr _get_task_id 000B 6C1E std -2,x 000D CC0001 ldd #1 0010 6C80 std 0,sp 0012 EC1E ldd -2,x 0014 87 clra 0015 160000 jsr _set_task_priority 0018 ; //spawn(sys_time_abort()); 0018 ; INTR_ON(); 0018 10EF cli 001A 001A L4: 001A L5: 001A ; 001A ; while (!abort) { 001A F70000 tst _abort 001D 27FB beq L4 001F ; 001F ; // DISPLAY TIME: hh:mm:ss 001F ; 001F ; } 001F ; 001F ; INTR_OFF(); 001F 1410 sei 0021 0021 ; 0021 ; } 0021 L3: 0021 B757 tfr x,s 0023 30 pulx 0024 .dbline 0 ; func end 0024 3D rts 0025 _sys_time_abort:: 0025 ; 0025 ; 0025 ; 0025 ; void sys_time_abort(void) { 0025 ; 0025 ; INTR_ON(); 0025 10EF cli 0027 0027 ; getchar(); 0027 160000 jsr _getchar 002A ; abort = 1; 002A C601 ldab #1 002C 7B0000 stab _abort 002F ; INTR_OFF(); 002F 1410 sei 0031 0031 ; 0031 ; 0031 ; } 0031 L7: 0031 .dbline 0 ; func end 0031 3D rts .area bss 0000 _abort: 0000 .blkb 1