From: Jan-Benedict G. <jb...@us...> - 2005-03-12 12:51:28
|
Update of /cvsroot/linux-vax/toolchain/src/opcodes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9422 Modified Files: vax-dis.c Log Message: - Decode entry mask. Index: vax-dis.c =================================================================== RCS file: /cvsroot/linux-vax/toolchain/src/opcodes/vax-dis.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- vax-dis.c 17 Feb 2003 00:33:08 -0000 1.1.1.1 +++ vax-dis.c 12 Mar 2005 12:51:16 -0000 1.2 @@ -34,6 +34,21 @@ "r8", "r9", "r10", "r11", "ap", "fp", "sp", "pc" }; +/* Definitions for the function entry mask bits. */ +static char *entry_mask_bit[] = +{ + /* Registers 0 and 1 shall not be saved, since they're used to pass back + a function's result to its caller... */ + "~r0~", "~r1~", + /* Registers 2 .. 11 are normal registers. */ + "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", + /* Registers 12 and 13 are argument and frame pointer and must not + be saved by using the entry mask. */ + "~ap~", "~fp~", + /* Bits 14 and 15 control integer and decimal overflow. */ + "IntOvfl", "DecOvfl", +}; + /* Sign-extend an (unsigned char). */ #if __STDC__ == 1 #define COERCE_SIGNED_CHAR(ch) ((signed char)(ch)) @@ -140,6 +155,27 @@ buffer[1] = 0; } + /* Decode function entry mask. */ + if (info->symbols + && info->symbols[0] + && (info->symbols[0]->flags & BSF_FUNCTION) + && memaddr == bfd_asymbol_value (info->symbols[0])) + { + int i = 0; + int register_mask = buffer[1] << 8 | buffer[0]; + + (*info->fprintf_func) (info->stream, ".word = 0x%04x # Entry mask: <", + register_mask); + + for (i = 15; i >= 0; i--) + if (register_mask & (1 << i)) + (*info->fprintf_func) (info->stream, " %s", entry_mask_bit[i]); + + (*info->fprintf_func) (info->stream, " >"); + + return 2; + } + for (votp = &votstrs[0]; votp->name[0]; votp++) { register vax_opcodeT opcode = votp->detail.code; |