home *** CD-ROM | disk | FTP | other *** search
/ Aminet 10 / aminetcdnumber101996.iso / Aminet / util / misc / fifolib38_1.lha / htag.s < prev    next >
Text File  |  1995-12-09  |  985b  |  60 lines

  1.  
  2. |    FIFO-HANDLER HTAG.S for GCC, including startup code
  3. |    ATTENTION: Beware of pc@(label+2) bug in gas prior to 2.5.2!!!
  4.  
  5. |    Simple startup code, not runnable from WorkBench
  6. |    Just handle _SysBase and _DOSBase
  7.  
  8. .text
  9.     .even
  10. .globl _ENTRY
  11. _ENTRY:
  12.     |  need not save registers (GURU book 20.2.1.1)
  13.     movel sp,___ExitSP
  14.     movel 4:w,a6
  15.     movel a6,_SysBase
  16.     |  OpenLibrary(dos)
  17.     lea  pc@(LDOSname),a1
  18.     moveq #0,d0
  19.     jsr a6@(-0x228)
  20.     movel d0,_DOSBase
  21.     jeq L102    |  0 exit status when no Dos...
  22.     |  call _main(void);
  23.     jbsr pc@(__main)
  24.     movel d0,d2
  25.     jra L101
  26. .globl __exit
  27. __exit:
  28.     movel sp@(4),d2
  29. L101:
  30.     |  CloseLibrary(dos)
  31.     movel _SysBase,a6
  32.     movel _DOSBase,a1
  33.     jsr a6@(-0x19e)
  34.     movel d2,d0
  35. L102:
  36.     movel ___ExitSP,sp
  37.     rts
  38. LDOSname:
  39.     .ascii "dos.library\0"
  40.  
  41. .data
  42.     .even
  43. .comm ___ExitSP,4
  44. .comm _SysBase,4
  45. .comm _DOSBase,4
  46.  
  47.  
  48.  
  49. |    Support for software int to transfer packet from
  50. |    private port to IoSink
  51.  
  52. .text
  53.     .even
  54. .globl _AIntCode
  55. _AIntCode:
  56.     movel a1,sp@-
  57.     jsr pc@(_IntCode)
  58.     movel sp@+,a1
  59.     rts
  60.