;***************************************************************************;
;                                                                           ;
;                                  DEF.M68                                  ;
;                        Define Command Abbreviation                        ;
;                                                                           ;
;                             David F. Pallmann                             ;
;                                                                           ;
;***************************************************************************;

       SEARCH  SYS
       SEARCH  SYSSYM

START:  PHDR    -1,0,PH$REE!PH$REU      ;program header
       BYP

MAKMEM: GETIMP  <C.END-C.STRT>,A5
       ALF
       JNE     USAGE
       LEA     A1,-6(A5)
       PACK
       PACK
       MOVW    #[LIT],-2(A5)
       MOVW    #FIL,-10(A5)

BYPASS: BYP
       CMMB    (A2)+,#'=
       JNE     USAGE
       BYP

CPYCOD: LEA     A0,C.STRT
       MOV     A5,A1
       MOV     #<C.END-C.STRT>,D0
10$:    MOVB    (A0)+,(A1)+
       SOB     D0,10$

CPYCMD: LEA     A0,<C.BUFF-C.STRT>(A5)
10$:    MOVB    (A2)+,(A0)+
       BNE     10$
       BR      EXIT

USAGE:  TYPECR  ? command error - usage is  .DEF command = command_line
       CRLF

EXIT:   EXIT

C.STRT: PHDR    -1,0,0
       LEA     A0,SPSAVE
       MOV     SP,@A0
       LEA     A2,C.BUFF
       AMOS
       LEA     A0,SPSAVE
       MOV     @A0,SP
       EXIT

C.BUFF: BLKB    100.

SPSAVE: BLKL    1

C.END:

       END