217/317
7 - Debugger and PROM Programmer Tutorial for ST72251
7.6.4.3 Kernel source file
(Littlk.asm)
The multitasking kernel is contained in the following file:
ST7/
;==============================================================
;=
Simple real time kernel
=
;==============================================================
PUBLIC StartTasks, Yield
EXTERN wdgr.b, AddrTasks
; Constants
; ==========
org1.b
EQU $7F
; addresses of the top
org2.b
EQU $6F
; of each of the stacks
org3.b
EQU $5F
org4.b
EQU $4F
watch.b
EQU $FF
; Value to reload into the watchdog timer
; Variables that drive the kernel
; ===============================
Segment 'ram0'
; in page zero
ImStack1.b
DS.B
; Position of the stack pointer for task 1
ImStack2.b
DS.B
; Position of the stack pointer for task 2
ImStack3.b
DS.B
; Position of the stack pointer for task 3
ImStack4.b
DS.B
; Position of the stack pointer for task 4
Permut.b
DS.B
; Number of the current task (0 to 3)
Segment 'rom'
Words
; StartTask
; =========
; This routine creates and initializes the stack for all four tasks.
StartTasks:
; This macro initializes the stack for one task which numer is passe
; as an argument
ld A, #org4
; Top of stack for task 4
ld S, A
ld X, {Ad7}
; LSB address Task
push X
ld X, {Ad6}
; MSB address Task
push X
; Written at top of stack
ld A, S
ld ImStack4, A
; Remember position of stack pointer
ld A, #org3
; Top of stack for task 3
ld S, A
ld X, {Ad5}
; LSB address Task
push X
Содержание ST7 Series
Страница 1: ...ST7 8 BIT MCU FAMILY USER GUIDE JANUARY 1999 1 ...
Страница 238: ...238 317 8 C Language and the C Compiler 08 Burn bmp Then use the EPROMer programmer software as described in Chapter 7 ...
Страница 289: ...289 317 10 Second Application a Sailing Computer 10 befor Bs Rw Vw VMG AlphaR AlphaV Before the wind ...