新聞中心

        EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計應(yīng)用 > arm匯編學(xué)習(xí)(五)

        arm匯編學(xué)習(xí)(五)

        作者: 時間:2016-11-09 來源:網(wǎng)絡(luò) 收藏
        新增個手寫GNU語法arm的方法,以后可以狂逆狂寫

        hello.S文件

        本文引用地址:http://www.104case.com/article/201611/317583.htm
        .datamsg:.ascii "Hello, ARM!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 */

        記得最后加個空格或者回車,不然會報hello.S:21: Warning: partial line at end of file ignored


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


        也是個學(xué)習(xí)ARM匯編的方法



        關(guān)鍵詞: ARM匯編學(xué)

        評論


        技術(shù)專區(qū)

        關(guān)閉
        主站蜘蛛池模板: 大新县| 台前县| 德安县| 宜宾县| 乐至县| 渝中区| 县级市| 金溪县| 西安市| 井陉县| 遂川县| 福海县| 澎湖县| 绥棱县| 集贤县| 浦县| 将乐县| 禹州市| 明水县| 长阳| 隆昌县| 和田市| 东兰县| 镶黄旗| 阳曲县| 太保市| 兰州市| 应城市| 青神县| 西青区| 资阳市| 乐亭县| 五河县| 玉龙| 中阳县| 荆州市| 苗栗市| 佛坪县| 红桥区| 襄垣县| 平顺县|