I am running a disassembly of a firmware image for a Cortex-M4 and the entry point is doing something strange.

00001000         db  0x00 ; '.'
00001001         db  0xff ; '.'
00001002         lsls       r7, r7, #0x3

Why run decrement before on 0x00 and 0xff, what is the reasoning behind it?

  • 4
    Are you sure that that's executable code? db is not a decrement; it means define byte, so those first two lines form a literal 0xFF00. lsls r7,r7,#0x3 also encodes to 0x00FF. Seems to me that it's actually data, not executable code.
    – Jeff
    Commented Jun 14, 2019 at 15:19
  • I am not sure that it is executable code at all, its a firmware file that gets flashed onto a Sphero toy's STM32 cpu. Searching for db in the cpu documentation only yielded "decrement before" and not define byte which makes much more sense. There do seem to be function calls in the disassembly.
    – Bob R
    Commented Jun 14, 2019 at 16:11


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.