home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / files / gnu / libsrc87 / straps.cpp < prev    next >
Encoding:
Text File  |  1993-07-30  |  985 b   |  58 lines

  1. |
  2. | TOS  traps for GCC 16 bit lib
  3. |    WARNING: these defns are non-reentrant
  4. |         but then so is TOS (well almost)
  5. |    jrb
  6. |
  7. #ifdef __MSHORT__
  8.     .globl _gemdos
  9.     .globl _bios
  10.     .globl _xbios
  11.  
  12.     .even
  13.     .lcomm gd2,4        | d2, a2 saved
  14.     .lcomm ga2,4
  15.     .lcomm bd2,4
  16.     .lcomm ba2,4
  17.     .lcomm xd2,4
  18.     .lcomm xa2,4
  19.     .lcomm gsave,4        | ret addr saved
  20.     .lcomm bsave,4
  21.     .lcomm xsave,4
  22.  
  23.     .text
  24.     .even
  25. _gemdos:
  26.     movl    d2,gd2        | save d2, a2
  27.     movl    a2,ga2
  28.     movl    sp@+,gsave    | save ret addr
  29.     trap    #1        | call GEMDOS
  30.     movl    gd2,d2        | restore d2, a2
  31.     movl    ga2,a2
  32.     movl    gsave,sp@-    | restore ret addr
  33.     rts
  34.  
  35.     .even
  36. _bios:
  37.     movl    d2,bd2        | save d2, a2
  38.     movl    a2,ba2
  39.     movl    sp@+,bsave    | save ret addr
  40.     trap    #13        | call BIOS
  41.     movl    bd2,d2        | restore d2, a2
  42.     movl    ba2,a2
  43.     movl    bsave,sp@-    | restore ret addr
  44.     rts
  45.  
  46.     .even
  47. _xbios:
  48.     movl    d2,xd2        | save d2, a2
  49.     movl    a2,xa2
  50.     movl    sp@+,xsave    | save ret addr
  51.     trap    #14        | call XBIOS
  52.     movl    xd2,d2        | restore d2, a2
  53.     movl    xa2,a2
  54.     movl    xsave,sp@-    | restore ret addr
  55.     rts
  56.  
  57. #endif /* __MSHORT__ */
  58.