|
From: Stephen M. <sm...@CS...> - 2006-01-11 22:29:46
|
>>>>> "CA-B" == Cerion Armour-Brown <ce...@op...> writes: CA-B> On Wednesday 11 January 2006 19:24, Uttam Pawar wrote: UP> This is little off-topic question but, how did you decode UP> 0x7c0048ce into lvx v0,r0,r9? Is there any general receipe for UP> doing this for ppc platform? CA-B> I don't know how others do it, but i did this: CA-B> create xyz.s: CA-B> gcc -c xyz.s CA-B> hexedit xyz.o CA-B> objdump -d zzz.o CA-B> Anyone else out there got an easier way? Along the same lines, but more automated: % ./dump-insn-ppc.zsh 7c0048ce 0: 7c 00 48 ce lvx v0,r0,r9 % cat dump-insn-ppc.zsh #!/bin/zsh objdump -b binary -m powerpc -EB -D \ =(perl -e 'print pack "N", hex $ARGV[0]' $1) | tail +7 The version of objdump I'm using doesn't like to read from a pipe for some reason, but =(...) is a handy zsh feature that automatically creates and removes a temporary file. The "-EB" (big endian) is needed because I'm actually running this on an x86 (using the Debian "binutils-multiarch" package, a version compiled with support for a whole bunch of architectures besides your native one). -- Stephen |