Google, , (Xcode 7.3.1, )
Xcode , ,
.globl _add_in_asm
.align 4
_add_in_asm:
add r0,r0,#1
bx lr
AppDelegate.m
include <stdio.h>
in the application - (BOOL): (UIApplication *) application doneFinishLaunchingWithOptions: (NSDictionary *) launchOptions {// Override the point to configure after the application starts.
extern int add_in_asm(int i);
printf("result:%i\n", add_in_asm(10));
Having said that, and after it was successfully launched, it does not work after I close Xcode and restart it ... well, you need to use a real device and when you restart it will try to use the emulator !!!!
`
/Users/xxx/Documents/myMac-git/testasm/my-testasm.s:18:11: error: invalid operand for instruction
add r0,r0,
^
/Users/xxx/Documents/myMac-git/testasm/my-testasm.s:19:7: error: unrecognized instruction mnemonic
bx lr
^
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
`
If you see the message above, use real devices!
source
share