Commit | Line | Data |
---|---|---|
b0c9f026 SC |
1 | /* Tail end of H8/300 simulator |
2 | Copyright 1993 Free Software Foundation, Inc. | |
3 | ||
4 | Contributed by Cygnus Support. | |
5 | Written by Steve Chamberlain (sac@cygnus.com). | |
6 | ||
7 | ||
8 | This program is free software; you can redistribute it and/or modify | |
9 | it under the terms of the GNU General Public License as published by | |
10 | the Free Software Foundation; either version 2 of the License, or | |
11 | (at your option) any later version. | |
12 | ||
13 | This program is distributed in the hope that it will be useful, | |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | GNU General Public License for more details. | |
17 | ||
18 | You should have received a copy of the GNU General Public License | |
19 | along with this program; if not, write to the Free Software | |
20 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ | |
21 | ||
19139515 | 22 | movflags8: |
19139515 SC |
23 | n = dst & 0x80; |
24 | z = !(dst & 0xff); | |
25 | v = 0; | |
26 | goto next; | |
27 | movflags16: | |
19139515 SC |
28 | n = dst & 0x8000; |
29 | z = !(dst & 0xffff); | |
30 | v = 0; | |
31 | goto next; | |
32 | aluflags8: | |
19139515 SC |
33 | n = dst & 0x80; |
34 | z = !(dst & 0xff); | |
35 | v = ((srca & 0x80) == (srcb & 0x80)) && ((srca & 0x80) != (dst & 0x80)); | |
36 | c = dst & 0x100; | |
37 | goto next; | |
38 | aluflags16: | |
19139515 SC |
39 | n = dst & 0x8000; |
40 | z = !(dst & 0xffff); | |
41 | v = ((srca & 0x8000) == (srcb & 0x8000)) && ((srca & 0x8000) != (dst & 0x8000)); | |
42 | c = dst & 0x10000; | |
43 | goto next; | |
44 | setflags:; | |
45 | SET_CCR(tmp); | |
62b66d6d | 46 | goto next; |
19139515 SC |
47 | logflags: |
48 | shiftflags: | |
49 | v = 0; | |
50 | incflags: | |
19139515 SC |
51 | z = !(dst & 0xff); |
52 | n = dst & 0x80; | |
53 | goto next; | |
54 | next: ; | |
55 | pc = npc; | |
62b66d6d SC |
56 | if (ni > checkfreq) |
57 | { | |
58 | ni = 0; | |
59 | SAVE_INTERPRETER_STATE(); | |
60 | perifs(); | |
61 | LOAD_INTERPRETER_STATE(); | |
06137fcb | 62 | #ifdef __GO32__ |
62b66d6d SC |
63 | if (kbhit()) |
64 | saved_state.exception = SIGINT; | |
06137fcb | 65 | #endif |
62b66d6d SC |
66 | } |
67 | ni++; | |
68 | } while (!saved_state.exception); | |
69 | ||
19139515 | 70 | |
62b66d6d | 71 | SAVE_INTERPRETER_STATE(); |
19139515 | 72 | } |