home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / gdb-4.9 / sim / h8300 / p3.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-05-12  |  1.4 KB  |  72 lines

  1. /* Interpreter fragment for the Hitachi H8/300 architecture simulator.
  2.  
  3.    Written by Steve Chamberlain of Cygnus Support.
  4.    sac@cygnus.com
  5.  
  6.    This file is part of H8/300 sim
  7.  
  8.  
  9.         THIS SOFTWARE IS NOT COPYRIGHTED
  10.  
  11.    Cygnus offers the following for use in the public domain.  Cygnus
  12.    makes no warranty with regard to the software or it's performance
  13.    and the user accepts the software "AS IS" with all faults.
  14.  
  15.    CYGNUS DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD TO
  16.    THIS SOFTWARE INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  17.    MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  18.  
  19. */
  20.  
  21.  movflags8:
  22.  n = dst & 0x80;
  23.  z = !(dst & 0xff);
  24.  v = 0;
  25. goto next;
  26.  movflags16:
  27.  n = dst & 0x8000;
  28.  z = !(dst & 0xffff);
  29.  v = 0;
  30. goto next;
  31.  aluflags8:
  32.  n = dst & 0x80;
  33.  z = !(dst & 0xff);
  34.  v = ((srca & 0x80) == (srcb & 0x80)) && ((srca & 0x80) != (dst & 0x80));
  35.  c = dst & 0x100;
  36.  goto next;
  37.  aluflags16:
  38.  n = dst & 0x8000;
  39.  z = !(dst & 0xffff);
  40.  v = ((srca & 0x8000) == (srcb & 0x8000)) && ((srca & 0x8000) != (dst & 0x8000));
  41.  c = dst & 0x10000;
  42.  goto next;
  43.  setflags:;
  44. SET_CCR(tmp);
  45.  goto next;
  46.  logflags:
  47.  shiftflags:
  48.  v = 0;
  49.  incflags:
  50.  z = !(dst & 0xff);
  51.  n =  dst & 0x80; 
  52. goto next;
  53.  next: ;
  54. pc = npc;
  55. if (ni > checkfreq) 
  56. {
  57.   ni = 0;
  58.   SAVE_INTERPRETER_STATE();
  59.   perifs();
  60.   LOAD_INTERPRETER_STATE();
  61. #ifdef __GO32__
  62.   if (kbhit())
  63.    saved_state.exception = SIGINT;
  64. #endif
  65. }
  66. ni++;
  67. } while (!saved_state.exception);
  68.  
  69.  
  70. SAVE_INTERPRETER_STATE();
  71. }
  72.