Shortest possible GAS ARM (linux) program?

前端 未结 2 1897
盖世英雄少女心
盖世英雄少女心 2021-01-23 12:57

I\'ve toyed with the idea of learning an assembly language, and have decided to give ARM a try. I\'ve decided to go with the GNU assembler, mostly because it\'s available in my

相关标签:
2条回答
  • 2021-01-23 13:55

    There is some information on system calls at http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=3105/4. You can also look at page 5 of http://isec.pl/papers/into_my_arms_dsls.pdf.

    0 讨论(0)
  • 2021-01-23 14:01

    teensy.s

    .global _start
    .thumb_func
    _start:
        mov r0, #42
        mov r7, #1
        svc #0
    

    Makefile

    CROSS_COMPILE?=arm-linux-gnueabihf-
    
    teensy:
        $(CROSS_COMPILE)as teensy.s -o teensy.o
        $(CROSS_COMPILE)ld teensy.o -o teensy
        ls -l teensy
        $(CROSS_COMPILE)objdump -d teensy.o
        $(CROSS_COMPILE)readelf -W -a teensy
    
    clean:
        rm teensy teensy.o
    
    0 讨论(0)
提交回复
热议问题