| 1 | /* pj-dis.c -- Disassemble picoJava instructions.
|
|---|
| 2 | Copyright 1999, 2000 Free Software Foundation, Inc.
|
|---|
| 3 | Contributed by Steve Chamberlain, of Transmeta ([email protected]).
|
|---|
| 4 |
|
|---|
| 5 | This program is free software; you can redistribute it and/or modify
|
|---|
| 6 | it under the terms of the GNU General Public License as published by
|
|---|
| 7 | the Free Software Foundation; either version 2 of the License, or
|
|---|
| 8 | (at your option) any later version.
|
|---|
| 9 |
|
|---|
| 10 | This program is distributed in the hope that it will be useful,
|
|---|
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 13 | GNU General Public License for more details.
|
|---|
| 14 |
|
|---|
| 15 | You should have received a copy of the GNU General Public License
|
|---|
| 16 | along with this program; if not, write to the Free Software
|
|---|
| 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 | #include <stdio.h>
|
|---|
| 21 | #include "sysdep.h"
|
|---|
| 22 | #include "opcode/pj.h"
|
|---|
| 23 | #include "dis-asm.h"
|
|---|
| 24 |
|
|---|
| 25 | extern const pj_opc_info_t pj_opc_info[512];
|
|---|
| 26 |
|
|---|
| 27 | static int get_int (memaddr, iptr, info)
|
|---|
| 28 | bfd_vma memaddr;
|
|---|
| 29 | int *iptr;
|
|---|
| 30 | struct disassemble_info *info;
|
|---|
| 31 | {
|
|---|
| 32 | unsigned char ival[4];
|
|---|
| 33 |
|
|---|
| 34 | int status = info->read_memory_func (memaddr, ival, 4, info);
|
|---|
| 35 |
|
|---|
| 36 | *iptr = (ival[0] << 24)
|
|---|
| 37 | | (ival[1] << 16)
|
|---|
| 38 | | (ival[2] << 8)
|
|---|
| 39 | | (ival[3] << 0) ;
|
|---|
| 40 |
|
|---|
| 41 | return status;
|
|---|
| 42 | }
|
|---|
| 43 |
|
|---|
| 44 | int
|
|---|
| 45 | print_insn_pj (addr, info)
|
|---|
| 46 | bfd_vma addr;
|
|---|
|
|---|