home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume25 / trash / part01 / i_n.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-03-22  |  1.1 KB  |  82 lines

  1. #include    "register.h"
  2. #include    "symtab.h"
  3. #include    "diblock.h"
  4. #include    "instrn.h"
  5. #include    "process.h"
  6.  
  7. dinstrn    *
  8. i_negfmt(dipc, fmt, ft, fs, fd)
  9. dinstrn    *dipc;
  10. int        fmt;
  11. int        ft;
  12. int        fs;
  13. int        fd;
  14. {
  15.     float    singles;
  16.     float    singled;
  17.     double    doubles;
  18.     double    doubled;
  19.  
  20.     switch (fmt)
  21.     {
  22.     case FMT_SINGLE:
  23.         procsget(CP1G(fs), *(unsigned long *)&singles);
  24.  
  25.         singled = -singles;
  26.  
  27.         procsput(CP1G(fd), *(unsigned long *)&singled);
  28.  
  29.         break;
  30.  
  31.     case FMT_DOUBLE:
  32.         /*
  33.          * Note apparent reversal of words within
  34.          * doubles here -- no idea why.
  35.          */
  36.         procsget(CP1G(fs), *((unsigned long *)&doubles + 1));
  37.  
  38.         procsget(CP1G(fs) + 1, *(unsigned long *)&doubles);
  39.  
  40.         doubled = -doubles;
  41.  
  42.         procsput(CP1G(fd), *((unsigned long *)&doubled + 1));
  43.  
  44.         procsput(CP1G(fd) + 1, *(unsigned long *)&doubled);
  45.         break;
  46.  
  47.     default:
  48.         unrecognised(dipc);
  49.         break;
  50.     }
  51.  
  52.     return dipc;
  53. }
  54.  
  55. dinstrn    *
  56. c_noop(dipc)
  57. dinstrn    *dipc;
  58. {
  59.     return dipc;
  60. }
  61.  
  62. dinstrn    *
  63. i_nor(dipc, rs, rt, rd, shamt, funct)
  64. dinstrn    *dipc;
  65. int        rs;
  66. int        rt;
  67. int        rd;
  68. int        shamt;
  69. int        funct;
  70. {
  71.     unsigned long    s;
  72.     unsigned long    t;
  73.  
  74.     procsget(rs, s);
  75.  
  76.     procsget(rt, t);
  77.  
  78.     procsput(rd, ~(s | t));
  79.  
  80.     return dipc;
  81. }
  82.