home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / RiscOS / APP / DEVS / LIB / GSTOBJ.ZIP / GstObjects / squash / Example / Adhesive (.txt) next >
RISC OS BBC BASIC V Source  |  1994-09-10  |  1KB  |  50 lines

  1.  Adhesive from BASIC
  2.  Author: George Taylor, george@tardis.ed.ac.uk
  3. _AdhesivePreInit
  4. _AssembleAdhesiveHandlers
  5.  AdhesiveInitHandlers,A%
  6. _AdhesiveInit(n$)
  7.  !AdhesiveHandle<>0 
  8.  a 64
  9.     a!0=0
  10. a!4=a+8
  11. $(a+8)=
  12. n$,52)
  13. ($(a+8))+8)=0
  14.  "Adhesive_Register",a 
  15.  !AdhesiveHandle
  16. _AdhesiveRequest(r)
  17.  !AdhesiveHandle=0 
  18.  "Adhesive_Request",!AdhesiveHandle,r
  19. _AdhesiveClose
  20.  !AdhesiveHandle<>0 
  21.  "Adhesive_Deregister",!AdhesiveHandle
  22. !AdhesiveHandle=0
  23. _AssembleAdhesiveHandlers
  24.  p,b,P%,exit,restore,oldExit,stack
  25.  b 256
  26.  p=0 
  27. [ OPT p
  28. .AdhesiveHandle
  29.   EQUD 0
  30. .AdhesiveInitHandlers
  31.   MOV   R0,#11
  32.   ADR   R1,exit
  33. *"  SWI   "OS_ChangeEnvironment"
  34.   ADR   R0,oldExit
  35.   STMIA R0,{R1,R2,R3}
  36.   MOVS  pc,R14
  37. .    .exit
  38.   ADR   R0,oldExit
  39.   LDMIA R0,{R1,R2,R3}
  40.   MOV   R0,#11
  41. 2"  SWI   "OS_ChangeEnvironment"
  42.   LDR   R0,AdhesiveHandle
  43.   CMP   R0,#0
  44. 5"  SWINE "XAdhesive_Deregister"
  45.   SWI   "OS_Exit"
  46. .oldExit
  47.   EQUD 0
  48.   EQUD 0
  49.   EQUD 0
  50.