重庆分公司,新征程启航

为企业提供网站建设、域名注册、服务器等服务

AndroidARM汇编学习(一)

    给自己挖了个坑,一切都得从“Hello World”开始。

我们提供的服务有:成都网站设计、成都做网站、微信公众号开发、网站优化、网站认证、吉首ssl等。为数千家企事业单位解决了网站和推广的问题。提供周到的售前咨询和贴心的售后服务,是有科学管理、有技术的吉首网站制作公司

    hello.S

.data

msg:
    .ascii      "Hello, World!\n"
len = . - msg


.text

.globl _start
_start:
    /* syscall write(int fd, const void *buf, size_t count) */
    mov     %r0, $1     /* fd -> stdout */
    ldr     %r1, =msg   /* buf -> msg */
    ldr     %r2, =len   /* count -> len(msg) */
    mov     %r7, $4     /* write is syscall #4 */
    swi     $0          /* invoke syscall */
   
    /* syscall exit(int status) */
    mov     %r0, $0     /* status -> 0 */
    mov     %r7, $1     /* exit is syscall #1 */
    swi     $0          /* invoke syscall */

    arm-linux-androideabi-as -o hello.o hello.S

    arm-linux-androideabi-ld -s -o hello hello.o

    adb push hello /data/local/tmp/hello
    adb shell /data/local/tmp/hello


文章标题:AndroidARM汇编学习(一)
URL分享:http://cqcxhl.cn/article/gooihe.html

其他资讯

在线咨询
服务热线
服务热线:028-86922220
TOP