taskstart.asm:
.title "Task startup routine"
; This is a task's entry point from the loader.
; It never returns.
; A4 is the task argument
; B3 = K_die
; SP has been set up already.
.length 90
DP .set b14
.sect "_3L_BSS"
DEF __task_dp
LAB __task_dp ; define our own to fix linker problem
.word 0
.text
DEF c_int00
REF _rtl_startup, startup
ALIAS __task_dp, tdp
LAB c_int00 ; this is called from thread_start in the loader.
mvkl startup, b0
mvkh startup, b0
b b0 ; b3 aready set to K_die for return
mvkl tdp, DP
mvkh tdp, DP
nop 3
.sect "_3L_TASK" ; we have been linked properly
.word 0
$(FILES)\asm.h:
.if ELF==0
LAB .macro x, y
_:x::
.if ":y:" != ""
.asg "_:x:", :y:
.endif
.endm
DEF .macro x
.def _:x:
.endm
REF .macro x, y
.ref _:x:
.if ":y:" != ""
.asg "_:x:", :y:
.endif
.endm
ALIAS .macro s, a
.asg "_:s:", :a:
.endm
GOTO .macro lab
b _:lab:
.endm
ADDR .macro v
.if ":v:"=="0"
.word 0
.else
.word _:v:
.endif
.endm
.else
LAB .macro x, y
:x::
.if ":y:" != ""
.asg ":x:", :y:
.endif
.endm
DEF .macro x
.def :x:
.endm
REF .macro x, y
.ref :x:
.if ":y:" != ""
.asg ":x:", :y:
.endif
.endm
ALIAS .macro s, a
.asg ":s:", :a:
.endm
ADDR .macro v
.word :v:
.endm
GOTO .macro lab
b :lab:
.endm
.endif
DEFLAB .macro x, y
DEF x
LAB x, y
.endm
Build (from nmake, a little complicated to extract, as is machine-generated):
ELF = -DELF=1 --abi=eabi
COMPILER = cl6x -qq --obj_directory=Obj
ASSEMBLE_E = $(COMPILER) --include_file=$(FILES)\asm.h $(ELF) -DTRACING=0
{.\}.asm{Obj\}.66:
$(ASSEMBLE_E) -mv=6600 -eo=.66 $< -ad=DEMO=0