#177754 - Jim - Thu Feb 07, 2013 8:00 pm
Hi,
I've worked on a project a while ago, where I dissassembled some ARM-Code and had some problems with bl-commands. Here is a copy of the description on what I worked.
I've searched for an automatic way to get the current address (so that I don't have to set "y"), but found nothing that worked. Maybe someone here knows how to do it. Although my code works, it will only work as long as I don't change the code too much.
I've worked on a project a while ago, where I dissassembled some ARM-Code and had some problems with bl-commands. Here is a copy of the description on what I worked.
Code: |
/* "blown" is my own bl-command, because the most bls go to an adress that isn't already dissassembled, so I had to write a function that makes a command that goes to an address that isn't already included. blown 0x3710, 0x2CC Here we're at address 0x2CC and want to jump to 0x3710 y = current adress, where the command is x = address where the jump goes to */ .macro blown x=0, y=0 .hword 0b1111000000000000 | ((((\x-\y)>>12)&0b11111111111)) .hword 0b1111100000000000 | ((((\x-(\y+2))>>1)&0b11111111111)-1) .endm |
I've searched for an automatic way to get the current address (so that I don't have to set "y"), but found nothing that worked. Maybe someone here knows how to do it. Although my code works, it will only work as long as I don't change the code too much.