我有一个程序可以读取第一个参数(在程序名称之后)并打印它。但是如何访问列表中的下一个参数以及后续参数?
main:
push {r4,r9, ip, lr}
ldr r4, [r1, #4] // comes in as r1, need to save the location into R4
mov r1, r4
ldr r0, =stringS
bl printf
mov r0, #0
// Tried various combinations trying to find how to move argv[x] to next location #4 bytes along
//mov r1, r4
//str r1, [r4, #8]
ldr r1, [r4], #8
ldr r0, =stringS
bl printf
mov r0, #0 // return 0
pop {r4, ip, pc}
一个看似微不足道的程序似乎让我大吃一惊!