Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .text
- .global main
- main:
- push {lr}
- mov r0, #0
- mov r1, #0
- solve:
- ldr r3, =stdin
- ldr r3, [r3]
- add r1, #4
- push {r0, r1}
- mov r0, r3
- bl fgetc
- mov r3, r0
- pop {r0, r1}
- push {r1, r3}
- bl realloc
- pop {r1, r3}
- sub r1, #4
- str r3, [r0, r1]
- add r1, #4
- cmp r3, #-1
- beq continue
- b solve
- continue:
- sub r1, #4
- ldr r2, [r0, r1]
- add r1, #4
- push {r0, r1}
- mov r0, r2
- ldr r3, =stdout
- ldr r3, [r3]
- mov r1, r3
- cmp r0, #-1
- blne fputc
- pop {r0, r1}
- subs r1, #4
- bne continue
- end_of_solve:
- bl free
- mov r0, #0
- pop {lr}
- bx lr
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement