home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / magazine / drdobbs / 1991 / 05 / bittman / startup.s < prev   
Text File  |  1991-02-10  |  2KB  |  44 lines

  1. /*******************************************************************
  2.  *                                                                 *
  3.  *          FILE: startup.s                                        *
  4.  *                                                                 *
  5.  *          DESCRIPTION: for several DSP32c boards                 *
  6.  *                                                                 *
  7.  *******************************************************************/
  8.  
  9. #define   sp   r14e                               /* stack pointer */
  10. #define   rp   r18                               /* return pointer */
  11. #define   rpe  r18e                              /* return pointer */
  12. #define   ir   r19                           /* increment register */
  13.  
  14. #define   STACK_INC 4                           /* stack increment */
  15.  
  16.      .rsect    ".text"
  17.      .global   __start
  18.      .global   __end
  19.      .global   errno
  20.  
  21.      .align    4
  22.  
  23. __start:
  24.      nop
  25.      dauc = 0                                  /* Set round to int */
  26.      r1 = 0
  27.      pcw = r1
  28.      ioc = 0x30cc0       /* Disable serial DMA's, setup 32-bit I/O */
  29.      sp = _stack                       /* Stack is empty at bottom */
  30.      ir = STACK_INC                             /* stack increment */
  31.      call main (rp)                      /* Nothing else to do now */
  32.      rpe = . + 4                  /* to get around call bug in 32c */
  33.  
  34.      r1 = 0
  35.      pdr = r1                                          /* exit (0) */
  36. __end:    goto __end
  37.      nop
  38.  
  39.      .rsect    ".data"
  40. errno:    int
  41.  
  42.      .rsect    ".bss"
  43. _stack:   byte
  44.