assembly - Dumping Registers in PPC -


i'm trying dump value of r5 can see var_a0 data is. trying dump in ppc since i'm using uart debugging on xbox 360 console,
ex): i'm trying figure out value of var_a0

addi      r5, r1, 0x110+var_a0 

code im using ::

printkey:     lis     %r29, -0x8000     ori     %r29, %r29, 0x100     sldi    %r3, %r29, 32     ori     %r3, %r3, 0x247c  # 0x800001000000247c     li      %r4, 0x80     bl      printaddress printaddress:     mr      %r30, %r3     mr      %r11, %r4           # text size     mtctr   %r11 

but print physical code in hv not registers data

there few things you'll need sort out here:

the printaddress function looks takes address in r3, , size in r4, (presumably) prints contents of memory @ address. have no way of telling how printing done, code missing question.

consequently, don't want use printaddress display value of r5. adapt actual printing code (which missing) print contents of register, rather memory.

however: actual thing want find out (the value of var_a0) determined @ compile time (or @ least during final link - binary statically linked?). check disassembled code, and/or check dynamic relocation entries if dynamic executable.

alternatively, use printaddress print contents of memory containing addi instruction, manually decode instruction determine immediate value used in addi.


Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -