Created
October 15, 2016 12:10
-
-
Save expipiplus1/25ca07108478a30bf6b5c28f3c8549c3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I have a function `main` compiled from C with `-mthumb`. | |
This is the entry point to the program | |
```asm | |
.TEXT | |
.GLOBAL _start | |
_start: | |
.ALIGN | |
.CODE 32 | |
b _header_end | |
.fill 188, 1, 0 | |
_header_end: | |
mov r0, #0 | |
ldr lr, =_header_end | |
ldr r5, =main | |
add r5,r5,#1 | |
bx r5 | |
.END | |
``` | |
I'm adding one to `r5` in order for the `bx` instruction to switch to thumb mode. But this doesn't work. Interestingly this code still works when I compile without `-mthumb` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment