home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0010 - 0019 / ibm0010-0019 / ibm0010.tar / ibm0010 / CLIPB52.ZIP / SPENCE.ZIP / REGS.CH < prev    next >
Encoding:
Text File  |  1990-06-04  |  905 b   |  29 lines

  1.     * The source code provided herein remains the property of Rick
  2.     * Spence and Software Design Consultants. You are, however, free to
  3.     * use it, but please do not republish.
  4.  
  5.     * REGS.CH
  6.     *
  7.     * Rick Spence's Clipper header file from the Advnced C presentation,
  8.     * 1900 Devcon
  9.  
  10.     #define NUM_REGS 7
  11.  
  12.     * Array index of each register. These values are important
  13.     * and must not be changed
  14.  
  15.     #define AX 1
  16.     #define BX 2
  17.     #define CX 3
  18.     #define DX 4
  19.     #define SI 5
  20.     #define DI 6
  21.  
  22.     #define GET_HREG(regs, reg_num) (int(regs[reg_num] / 256))
  23.     #define GET_LREG(regs, reg_num) (int(regs[reg_num] % 256))
  24.  
  25.     #define SET_HREG(regs, reg_num, value) regs[reg_num] = ((value) * 256 + GET_LREG(regs, reg_num))
  26.  
  27.     * Same goes for this one
  28.     #define SET_LREG(regs, reg_num, value) regs[reg_num] = ((value) + GET_HREG(regs, reg_num) * 256)
  29.