Answer To: Write code for quick sort in Arm assembly language
David answered on Dec 21 2021
1
.Ltext0:
.cfi_sections .debug_frame
.global intArray
.data
.align 2
intArray:
0000 04000000 .word 4
0004 06000000 .word 6
0008 03000000 .word 3
000c 02000000 .word 2
0010 01000000 .word 1
0014 09000000 .word 9
0018 07000000 .word 7
.section .rodata
.align 2
.LC0:
0000 3D00 .ascii "=\000"
.text
.align 2
.global _Z9printlinei
_Z9printlinei:
.fnstart
.LFB0:
.cfi_startproc
@ args = 0, pretend = 0, frame = 16
2
@ frame_needed = 1, uses_anonymous_args = 0
0000 00482DE9 stmfd sp!, {fp, lr}
.save {fp, lr}
.cfi_def_cfa_offset 8
.cfi_offset 11, -8
.cfi_offset 14, -4
.setfp fp, sp, #4
0004 04B08DE2 add fp, sp, #4
.cfi_def_cfa 11, 4
.pad #16
0008 10D04DE2 sub sp, sp, #16
000c 10000BE5 str r0, [fp, #-16]
0010 0030A0E3 mov r3, #0
0014 08300BE5 str r3, [fp, #-8]
.L3:
0018 10301BE5 ldr r3, [fp, #-16]
001c 012043E2 sub r2, r3, #1
0020 08301BE5 ldr r3, [fp, #-8]
0024 030052E1 cmp r2, r3
0028 050000DA ble .L2
0034 08301BE5 ldr r3, [fp, #-8]
0038 013083E2 add r3, r3, #1
003c 08300BE5 str r3, [fp, #-8]
0040 F4FFFFEA b .L3
002c 3D00A0E3 mov r0, #61
3
0030 FEFFFFEB bl putchar
.L2:
0044 0C009FE5 ldr r0, .L4
0048 FEFFFFEB bl puts
004c 0000A0E1 mov r0, r0 @ nop
0050 04D04BE2 sub sp, fp, #4
.cfi_def_cfa 13, 8
@ sp needed
0054 0088BDE8 ldmfd sp!, {fp, pc}
.L5:
.align 2
.L4:
0058 00000000 .word .LC0
.cfi_endproc
.LFE0:
.fnend
.section .rodata
0002 0000 .align 2
.LC1:
0004 25642000 .ascii "%d \000"
.align 2
.LC2:
0008 5D00 .ascii "]\000"
.text
.align 2
4
.global _Z7displayv
_Z7displayv:
.fnstart
.LFB1:
.cfi_startproc
@ args = 0, pretend = 0, frame = 8
@ frame_needed = 1, uses_anonymous_args = 0
005c 00482DE9 stmfd sp!, {fp, lr}
.save {fp, lr}
.cfi_def_cfa_offset 8
.cfi_offset 11, -8
.cfi_offset 14, -4
.setfp fp, sp, #4
0060 04B08DE2 add fp, sp, #4
.cfi_def_cfa 11, 4
.pad #8
0064 08D04DE2 sub sp, sp, #8
0068 5B00A0E3 mov r0, #91
006c FEFFFFEB bl putchar
0070 0030A0E3 mov r3, #0
0074 08300BE5 str r3, [fp, #-8]
.L8:
0078 08301BE5 ldr r3, [fp, #-8]
007c 060053E3 cmp r3, #6
0080 090000CA bgt .L7
5
009c 08301BE5 ldr r3, [fp, #-8]
00a0 013083E2 add r3, r3, #1
00a4 08300BE5 str r3, [fp, #-8]
00a8 F2FFFFEA b .L8
0084 34209FE5 ldr r2, .L9
0088 08301BE5 ldr r3, [fp, #-8]
008c 033192E7 ldr r3, [r2, r3, asl #2]
0090 0310A0E1 mov r1, r3
0094 28009FE5 ldr r0, .L9+4
0098 FEFFFFEB bl printf
.L7:
00ac 14009FE5 ldr r0, .L9+8
00b0 FEFFFFEB bl puts
00b4 0000A0E1 mov r0, r0 @ nop
00b8 04D04BE2 sub sp, fp, #4
.cfi_def_cfa 13, 8
@ sp needed
00bc 0088BDE8 ldmfd sp!, {fp, pc}
.L10:
.align 2
.L9:
00c0 00000000 .word intArray
00c4 04000000 .word .LC1
00c8 08000000 .word .LC2
.cfi_endproc
6
.LFE1:
.fnend
.align 2
.global _Z4swapii
_Z4swapii:
.fnstart
...