home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 122.lha / Arp_v1.1 / Libraries / Manx_SRC / arpcrt0.s < prev    next >
Encoding:
Text File  |  1986-11-21  |  2.2 KB  |  104 lines

  1. ; Initial startup routine for Aztec 'C' and ARP
  2. ; NB: This should allow access to all Aztec Features, math, etc.
  3. ;     Could be made smaller if only for CLI, only for Workbench,
  4. ;     Could be made smaller if only this or that.
  5. ;
  6. ; Created 11/08/87-88 by -+=SDB+=- from crt0.a68 file provided by Manx
  7. ; Copyright (c) 1987 by Scott Ballantyne, may be freely
  8. ; used by Arp Supporters/users
  9. ;
  10. ; SDB --- 02/18/88, removed icky guru if no arp.
  11. ;
  12.     INCLUDE    "exec/types.i"
  13.     INCLUDE    "exec/exec_lib.i"
  14.     INCLUDE    "exec/alerts.i"
  15.  
  16.     IFND    MANX
  17. MANX    SET    1
  18.     ENDC
  19.     
  20.     INCLUDE    "libraries/arpbase.i"
  21.  
  22.     mc68881
  23.     entry    .begin
  24.     public    .begin
  25. .begin
  26.     bsr    _geta4            ;get A4
  27.     lea    __H1_end,a1
  28.     lea    __H2_org,a2
  29.     cmp.l    a1,a2            ;check if BSS and DATA together
  30.     bne    start            ;no, don't have to clear
  31.     move.w    #((__H2_end-__H2_org)/4)-1,d1
  32.     bmi    start            ;skip if no bss
  33.     move.l    #0,d2
  34. loop
  35.     move.l    d2,(a1)+        ;clear out memory
  36.     dbra    d1,loop
  37.  
  38. start
  39.     move.l    sp,__savsp        ;save stack pointer
  40.     move.l    4,a6            ;get Exec's library base pointer
  41.     move.l    a6,_SysBase        ;put where we can get it
  42.     movem.l    d0/a0,-(sp)        ;save CLI command parameters
  43.  
  44.     btst.b    #4,$129(a6)        ;check for 68881 flag in AttnFlags
  45.     beq    1$            ;skip if not
  46.     lea    2$,a5
  47.     jsr    -30(a6)            ;do it in supervisor mode
  48.     bra    1$
  49. 2$
  50.     clr.l    -(sp)
  51.     frestore (sp)+            ;reset the ffp stuff
  52.     rte                ;and return
  53. 1$
  54.  
  55.     lea    ARPNAME,a1        ;get name of arp_library
  56.     moveq.l    #ArpVersion,d0
  57.     SYSCALL    OpenLibrary
  58.     move.l    d0,_ArpBase        ; set up pointer
  59.     move.l    d0,_DOSBase        ; also as Dos pointer
  60.     beq    AhOhNoARP        ; go away if not ok.
  61.     move.l    d0,a0
  62.     move.l    GfxBase(a0),_GfxBase    ; Give free graphics.library
  63.     move.l    IntuiBase(a0),_IntuitionBase ; and free intuition.library
  64.     jsr    __main            ;call the startup stuff
  65. 4$
  66.     add.w    #8,sp            ;pop args
  67.     rts                ;and return
  68.  
  69. dosname    dc.b    'dos.library',0
  70. alibmsg    dc.b    'you need '
  71. ARPNAME:    ArpName
  72.     dc.b    ' V34+',10
  73.     ds.w    0
  74.     public    _geta4
  75. _geta4:
  76.     far    data
  77.     lea    __H1_org+32766,a4
  78.     rts
  79.     near    data
  80.  
  81. AhOhNoARP:
  82.     lea.l    dosname,a1
  83.     SYSCALL    OpenLibrary
  84.     tst.l    d0
  85.     beq.s    1$
  86.     move.l    d0,a6
  87.     SYSCALL    Output
  88.     move.l    d0,d1
  89.     beq.s    1$
  90.     move.l    #alibmsg,d2
  91.     move.l    #ALIBLNG,d3
  92.     SYSCALL    Write
  93. 1$:    addq    #8,sp
  94.     rts
  95.  
  96.     public    __main,__H0_org
  97.  
  98.     dseg
  99.  
  100.     public    _SysBase,__savsp,_DOSBase
  101.     public    __H1_org,__H1_end,__H2_org,__H2_end
  102.     public    _ArpBase
  103.     public    _IntuitionBase,_GfxBase
  104.