; PROGSTART - version 04.04.88

               XDEF    ProgStart
               XDEF    VarStart
               XDEF    NameStart

               XDEF    LinkTop

               include 'ram:package.i' ; Include standard definitions

; Initialisation section
               MOVE.L  D0,A0           ; Address of package structure
               MOVE.L  #LinkTop,12(A0) ; Set address of top-link
               CLR.W   D0              ; No error
               RTS

; Program start
;
ProgStart:     MOVE.L  -30(A4),A0      ; Get argument from Comal stack
               ADDQ.L  #4,A0
               ADD.W   (A0),A0
               MOVE.L  A0,D2
               CLR.L   D3
               RTS

; Variable start
;
VarStart:      MOVE.L  A4,D2           ; Get argument from Comal stack
               ADDQ.L  #4,D2
               CLR.L   D3              ; Return value of bit zero
               RTS

; Name start
;
NameStart:     MOVE.L  -30(A4),A0
               ADD.L   (A0),A0
               MOVE.L  A0,D2
               CLR.L   D3
               RTS

               SECTION ProgStartData,DATA

ProgLink:      DC.L    0               ; Last name
               DC.L    ProgName
               DC.W    longcode        ; Long integer function
               DC.W    0               ; No argument
               DC.L    ProgStart       ; Rutine address
ProgName:      DC.B    'PROGSTART',0

               CNOP    0,2
VarLink:       DC.L    ProgLink
               DC.L    VarName
               DC.W    longcode        ; Long integer function
               DC.W    0               ; No argument
               DC.L    VarStart        ; Rutine address
VarName:       DC.B    'VARSTART',0

               CNOP    0,2
NameLink:      DC.L    VarLink
               DC.L    NameName
               DC.W    longcode        ; Long integer function
               DC.W    0               ; No argument
               DC.L    NameStart       ; Rutine address
NameName:      DC.B    'NAMESTART',0

               CNOP    0,2
LinkTop:       DC.L    NameLink

               END 
