1 /* OBSOLETE /* Target-machine dependent code for WDC-65816, for GDB. */
2 /* OBSOLETE Copyright 1995, 1996, 2000, 2001 Free Software Foundation, Inc. */
4 /* OBSOLETE This file is part of GDB. */
6 /* OBSOLETE This program is free software; you can redistribute it and/or modify */
7 /* OBSOLETE it under the terms of the GNU General Public License as published by */
8 /* OBSOLETE the Free Software Foundation; either version 2 of the License, or */
9 /* OBSOLETE (at your option) any later version. */
11 /* OBSOLETE This program is distributed in the hope that it will be useful, */
12 /* OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of */
13 /* OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
14 /* OBSOLETE GNU General Public License for more details. */
16 /* OBSOLETE You should have received a copy of the GNU General Public License */
17 /* OBSOLETE along with this program; if not, write to the Free Software */
18 /* OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, */
19 /* OBSOLETE Boston, MA 02111-1307, USA. */ */
22 /* OBSOLETE Contributed by Steve Chamberlain */
23 /* OBSOLETE sac@cygnus.com */
26 /* OBSOLETE #include "defs.h" */
27 /* OBSOLETE #include "frame.h" */
28 /* OBSOLETE #include "obstack.h" */
29 /* OBSOLETE #include "symtab.h" */
30 /* OBSOLETE #include "gdbcmd.h" */
31 /* OBSOLETE #include "gdbtypes.h" */
32 /* OBSOLETE #include "dis-asm.h" */
33 /* OBSOLETE #include "gdbcore.h" */
34 /* OBSOLETE #include "regcache.h" */
36 /* OBSOLETE /* Return the saved PC from this frame. */ */
39 /* OBSOLETE CORE_ADDR */
40 /* OBSOLETE w65_frame_saved_pc (struct frame_info *frame) */
42 /* OBSOLETE return (read_memory_integer (frame->frame + 2, 4) & 0xffffff); */
45 /* OBSOLETE CORE_ADDR */
46 /* OBSOLETE w65_addr_bits_remove (CORE_ADDR addr) */
48 /* OBSOLETE return ((addr) & 0xffffff); */
51 /* OBSOLETE read_memory_pointer (CORE_ADDR x) */
53 /* OBSOLETE return read_memory_integer (ADDR_BITS_REMOVE (x), 4); */
56 /* OBSOLETE init_frame_pc (void) */
58 /* OBSOLETE internal_error (__FILE__, __LINE__, "failed internal consistency check"); */
62 /* OBSOLETE w65_push_dummy_frame (void) */
64 /* OBSOLETE internal_error (__FILE__, __LINE__, "failed internal consistency check"); */
67 /* OBSOLETE /* Put here the code to store, into a struct frame_saved_regs, */
68 /* OBSOLETE the addresses of the saved registers of frame described by FRAME_INFO. */
69 /* OBSOLETE This includes special registers such as pc and fp saved in special */
70 /* OBSOLETE ways in the stack frame. sp is even more special: */
71 /* OBSOLETE the address we return for it IS the sp for the next frame. */
73 /* OBSOLETE We cache the result of doing this in the frame_cache_obstack, since */
74 /* OBSOLETE it is fairly expensive. */ */
77 /* OBSOLETE frame_find_saved_regs (struct frame_info *fip, struct frame_saved_regs *fsrp) */
79 /* OBSOLETE int locals; */
80 /* OBSOLETE CORE_ADDR pc; */
81 /* OBSOLETE CORE_ADDR adr; */
84 /* OBSOLETE memset (fsrp, 0, sizeof *fsrp); */
88 /* OBSOLETE saved_pc_after_call (void) */
90 /* OBSOLETE int sp = read_register (SP_REGNUM); */
91 /* OBSOLETE int val = read_memory_integer (sp + 1, 4); */
92 /* OBSOLETE return ADDR_BITS_REMOVE (val); */
96 /* OBSOLETE extract_return_value (struct type *type, char *regbuf, char *valbuf) */
99 /* OBSOLETE int len = TYPE_LENGTH (type); */
101 /* OBSOLETE for (b = 0; b < len; b += 2) */
103 /* OBSOLETE int todo = len - b; */
104 /* OBSOLETE if (todo > 2) */
105 /* OBSOLETE todo = 2; */
106 /* OBSOLETE memcpy (valbuf + b, regbuf + b, todo); */
111 /* OBSOLETE write_return_value (struct type *type, char *valbuf) */
113 /* OBSOLETE int reg; */
114 /* OBSOLETE int len; */
115 /* OBSOLETE for (len = 0; len < TYPE_LENGTH (type); len += 2) */
117 /* OBSOLETE write_register_bytes (REGISTER_BYTE (len / 2 + 2), valbuf + len, 2); */
122 /* OBSOLETE store_struct_return (CORE_ADDR addr, CORE_ADDR sp) */
124 /* OBSOLETE write_register (2, addr); */
128 /* OBSOLETE w65_pop_frame (void) */
132 /* OBSOLETE init_extra_frame_info (void) */
136 /* OBSOLETE pop_frame (void) */
140 /* OBSOLETE w65_frame_chain (struct frame_info *thisframe) */
142 /* OBSOLETE return 0xffff & read_memory_integer ((thisframe)->frame, 2); */
145 /* OBSOLETE static int */
146 /* OBSOLETE gb (int x) */
148 /* OBSOLETE return read_memory_integer (x, 1) & 0xff; */
151 /* OBSOLETE extern CORE_ADDR */
152 /* OBSOLETE w65_skip_prologue (CORE_ADDR pc) */
154 /* OBSOLETE CORE_ADDR too_far = pc + 20; */
156 /* OBSOLETE /* looking for bits of the prologue, we can expect to */
157 /* OBSOLETE see this in a frameful function: */
159 /* OBSOLETE stack adjust: */
161 /* OBSOLETE 3B tsc */
162 /* OBSOLETE 1A inc a */
163 /* OBSOLETE 18 clc */
164 /* OBSOLETE 69E2FF adc #0xffe2 */
165 /* OBSOLETE 3A dec a */
166 /* OBSOLETE 1B tcs */
167 /* OBSOLETE 1A inc a */
171 /* OBSOLETE A500 lda <r15 */
172 /* OBSOLETE 48 pha */
173 /* OBSOLETE 3B tsc */
174 /* OBSOLETE 1a inc a */
175 /* OBSOLETE 8500 sta <r15 */
179 /* OBSOLETE #define TSC 0x3b */
180 /* OBSOLETE #define TCS 0x1b */
181 /* OBSOLETE #define INCA 0x1a */
182 /* OBSOLETE #define PHA 0x48 */
183 /* OBSOLETE #define LDADIR 0xa5 */
184 /* OBSOLETE #define STADIR 0x85 */
186 /* OBSOLETE /* Skip a stack adjust - any area between a tsc and tcs */ */
187 /* OBSOLETE if (gb (pc) == TSC) */
189 /* OBSOLETE while (pc < too_far && gb (pc) != TCS) */
194 /* OBSOLETE /* Skip a stupid inc a */ */
195 /* OBSOLETE if (gb (pc) == INCA) */
199 /* OBSOLETE /* Stack adjust can also be done with n pha's */ */
200 /* OBSOLETE while (gb (pc) == PHA) */
203 /* OBSOLETE /* Skip a link - that's a ld/ph/tsc/inc/sta */ */
205 /* OBSOLETE if (gb (pc) == LDADIR */
206 /* OBSOLETE && gb (pc + 5) == STADIR */
207 /* OBSOLETE && gb (pc + 1) == gb (pc + 6) */
208 /* OBSOLETE && gb (pc + 2) == PHA */
209 /* OBSOLETE && gb (pc + 3) == TSC */
210 /* OBSOLETE && gb (pc + 4) == INCA) */
212 /* OBSOLETE pc += 7; */
215 /* OBSOLETE return pc; */
219 /* OBSOLETE register_raw_size (int n) */
221 /* OBSOLETE return sim_reg_size (n); */
226 /* OBSOLETE print_register_hook (int regno) */
228 /* OBSOLETE if (regno == P_REGNUM) */
230 /* OBSOLETE /* CCR register */ */
232 /* OBSOLETE int C, Z, N, V, I, D, X, M; */
233 /* OBSOLETE unsigned char b[1]; */
234 /* OBSOLETE unsigned char l; */
236 /* OBSOLETE read_relative_register_raw_bytes (regno, b); */
237 /* OBSOLETE l = b[0]; */
238 /* OBSOLETE printf_unfiltered ("\t"); */
239 /* OBSOLETE C = (l & 0x1) != 0; */
240 /* OBSOLETE Z = (l & 0x2) != 0; */
241 /* OBSOLETE I = (l & 0x4) != 0; */
242 /* OBSOLETE D = (l & 0x8) != 0; */
243 /* OBSOLETE X = (l & 0x10) != 0; */
244 /* OBSOLETE M = (l & 0x20) != 0; */
245 /* OBSOLETE V = (l & 0x40) != 0; */
246 /* OBSOLETE N = (l & 0x80) != 0; */
248 /* OBSOLETE printf_unfiltered ("N-%d ", N); */
249 /* OBSOLETE printf_unfiltered ("V-%d ", V); */
250 /* OBSOLETE printf_unfiltered ("M-%d ", M); */
251 /* OBSOLETE printf_unfiltered ("X-%d ", X); */
252 /* OBSOLETE printf_unfiltered ("D-%d ", D); */
253 /* OBSOLETE printf_unfiltered ("I-%d ", I); */
254 /* OBSOLETE printf_unfiltered ("Z-%d ", Z); */
255 /* OBSOLETE printf_unfiltered ("C-%d ", C); */
256 /* OBSOLETE if ((C | Z) == 0) */
257 /* OBSOLETE printf_unfiltered ("u> "); */
258 /* OBSOLETE if ((C | Z) == 1) */
259 /* OBSOLETE printf_unfiltered ("u<= "); */
260 /* OBSOLETE if ((C == 0)) */
261 /* OBSOLETE printf_unfiltered ("u>= "); */
262 /* OBSOLETE if (C == 1) */
263 /* OBSOLETE printf_unfiltered ("u< "); */
264 /* OBSOLETE if (Z == 0) */
265 /* OBSOLETE printf_unfiltered ("!= "); */
266 /* OBSOLETE if (Z == 1) */
267 /* OBSOLETE printf_unfiltered ("== "); */
268 /* OBSOLETE if ((N ^ V) == 0) */
269 /* OBSOLETE printf_unfiltered (">= "); */
270 /* OBSOLETE if ((N ^ V) == 1) */
271 /* OBSOLETE printf_unfiltered ("< "); */
272 /* OBSOLETE if ((Z | (N ^ V)) == 0) */
273 /* OBSOLETE printf_unfiltered ("> "); */
274 /* OBSOLETE if ((Z | (N ^ V)) == 1) */
275 /* OBSOLETE printf_unfiltered ("<= "); */
280 /* OBSOLETE _initialize_w65_tdep (void) */
282 /* OBSOLETE tm_print_insn = print_insn_w65; */
This page took 0.034792 seconds and 4 git commands to generate.