home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / l / l200 / 6.ddi / LIB / SEG.C < prev    next >
Encoding:
C/C++ Source or Header  |  1986-08-21  |  496 b   |  26 lines

  1. /*    SEG(addr) - define current 'segment' of storage
  2.  
  3.     Copyright (c) 1984 by JMI Software Consultants, Inc.
  4. */
  5. #include "acom.h"
  6. #include "host.h"
  7. /* base_seg should be initialized by bfinit.
  8.    It's value is used by CALL, PEEK, POKE, and USR.
  9. */
  10. VOID SEG(addr)
  11.     DOUBLE addr;
  12.     {
  13.     IMPORT BYTES base_seg;
  14.     SEGREG r;
  15.  
  16.     if (addr == -1.0)
  17.         {
  18.         segread(&r);
  19.         base_seg = r.s_ds;
  20.         }
  21.     else if (addr < -32768.0 || addr > 65535.0)
  22.         xerror(32, "SEG");
  23.     else
  24.         base_seg = addr;
  25.     }
  26.