home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / program / compiler / nasm20b / nasm_src / immasm.c < prev    next >
C/C++ Source or Header  |  1993-01-19  |  1KB  |  40 lines

  1. /* ---------------------------------------------------------------------- */
  2. /*                   Copyright (C) 1991 by Natürlich!                     */
  3. /*                      This file is copyrighted!                         */
  4. /*                Refer to the documentation for details.                 */
  5. /* ---------------------------------------------------------------------- */
  6. /*    This Source is ...                                      */
  7. /*    this Source is ...                                      */
  8. /*    this Source is Technotronic                             */
  9. /* ---------------------------------------------------------- */
  10. #include "defines.h"
  11. #include "nasm.h"
  12. #include "debug.h"
  13. #include "imm.h"
  14. #include "op.h"
  15.  
  16. extern imm huge   *cip,
  17.            huge   *hip;
  18. extern seg huge   *sp;
  19.  
  20. static char lossage[] = "Expression must be preceded by '<' or '>'";
  21.  
  22. void  save_patch( where, type, value)
  23. word  where, value;
  24. byte  type;
  25. {
  26.    register imm huge *p = imm_alloc();
  27.  
  28.    ENTER("save_patch");
  29.    if( ! (p->type = ((type &= O_BITS) == O_MSB)))
  30.       if( type != O_LSB)
  31.          nerror( lossage);
  32.    p->offset = where;
  33.    p->block = sp;
  34.    p->val   = value;
  35.    p->next  = (imm huge *) 0;
  36.    cip = hip ? (cip->next = p) : (hip = p);
  37.    LEAVE();
  38. }
  39.  
  40.