assembly - Is the binutils(arm-linux-as) able to specify imm offset with b,bl,blx...? -


i use arm-linux-as assembly arm instructions machine-code this:

// arm.txt .code 32 mov r0, sp  // command line e:\armgen>arm-linux-as -ahlm -k -mthumb-interwork -march=armv7-a c:\arm.txt arm gas  c:\arm.txt                     page 1    1                    .code 32    2 0000 0d00a0e1      mov r0, sp 

for b,bl,blx..., can write this:

//arm.txt .code 16 blx .sub_xxx .code 32 add  r0, pc add  r0, pc .sub_xxx: add  r0, pc  // command line e:\armgen>arm-linux-as -ahlm -k -mthumb-interwork -march=armv7-a c:\arm.txt arm gas  c:\arm.txt                     page 1    1                    .code 16    3 0000 00f004e8      blx .sub_xxx    5    6                    .code 32    8 0004 0f0080e0      add  r0, pc   10 0008 0f0080e0      add  r0, pc   12 000c 0f0080e0      .sub_xxx: add  r0, pc 

however, tool calculate offset of jump instruction automatically tag, and, if jump's offset large number, how can this? padding many instructions between src , dst? failed test write offset this:

.code 16 blx #0xce0 

can give me directions...


Comments