home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c329 / 2.img / EXAMPLES / RB.BAS < prev    next >
Encoding:
BASIC Source File  |  1990-01-23  |  1.1 KB  |  36 lines

  1. REM RB.BAS.  The code in this program is compatible
  2. REM with Microsoft QuickBASIC, Microsoft BASIC, or
  3. REM IBM BASIC.  To use it, compile with the /O option
  4. REM and link with M2.OBJ.
  5.         REM $STATIC
  6.         DIM ARRAY%(3)
  7.  
  8. REM Get the value on the command line.
  9.  
  10.          A$ = COMMAND$
  11.          ADDR% = VAL(A$)
  12.  
  13. REM Call install, passing the addresses of the array
  14. REM and the buffer passed on the command line.
  15. REM install places the address of the array and the
  16. REM address of a return instruction into the buffer
  17. REM and executes a request to DOS to terminate and
  18. REM stay resident.
  19.  
  20.           CALL INSTALL(ADDR%, ARRAY%(0))
  21.  
  22. REM Calls to the return instruction eventually wind up
  23. REM at this point. The array has been defined by the
  24. REM calling program.
  25.           ARRAY%(0) = ARRAY%(1) + ARRAY%(2)
  26.  
  27. REM GOBACK, which could be called at any point, any
  28. REM level, exits the BASIC program to the protected
  29. REM mode program.  Subsequent calls to the BASIC
  30. REM program will continue to start at the instruction
  31. REM following the call to INSTALL.
  32.  
  33.          CALL GOBACK
  34.          END
  35.  
  36.