home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_07_08 / v7n8048a.txt < prev    next >
Text File  |  1989-09-29  |  811b  |  38 lines

  1.  *****Listing 1*****
  2.  
  3.  
  4. /* These are determined from the debug information */
  5. #define AND_INSTRUCTION_OFFSET 0x10
  6. #define OR_INSTRUCTION_OFFSET 0x15
  7. set_plot_type(type)
  8.      {
  9.      unsigned char *pc;
  10.      void draw_function();
  11.  
  12. /* The function you want to modify */
  13.  
  14.  
  15. pc = (void *) draw_function;
  16.  
  17. switch(type)
  18.      {
  19. case XOR:
  20.      /* Put NOPS for the masking operation */
  21.      *(pc + AND_INSTRUCTION OFFSET) = 0x90; /* NOP */
  22.      *(pc + AND_INSTRUCITON OFFSET + 1) = 0X90;
  23.      *(pc + OR_INSTRUCTION_OFFSET) = 0x03;  /* XOR */
  24.      break;
  25. case OVERWRITE:
  26.      *(pc + AND_INSTRUCTION_OFFSET) = 0x02;  /* AND */
  27.      *(pc + AND_INSTRUCITON_OFFSET + 1) = 0x00
  28.      /* Register */
  29.  
  30.      *(pc + OR_INSTRUCTION_OFFSET) = 0x08;  /* OR */
  31.      break;
  32.      }
  33. return;
  34. {
  35.  
  36.  
  37. *********
  38.