Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

{Convert this to Y86 please} bubbleSort: pushl %ebp movl %esp, %ebp pushl %edi pushl %esi pushl %ebx movl 8(%ebp), %edi movl 12(%ebp), %eax leal -1(%eax),

{Convert this to Y86 please}

bubbleSort:

pushl %ebp

movl %esp, %ebp

pushl %edi

pushl %esi

pushl %ebx

movl 8(%ebp), %edi

movl 12(%ebp), %eax

leal -1(%eax), %esi

testl %esi, %esi

jle .L1

leal -4(%edi,%eax,4), %ebx

jmp .L3

.L5:

movl (%eax), %ecx

movl 4(%eax), %edx

cmpl %edx, %ecx

jle .L4

movl %ecx, 4(%eax)

movl %edx, (%eax)

.L4:

addl $4, %eax

cmpl %ebx, %eax

jne .L5

.L6:

subl $4, %ebx

subl $1, %esi

je .L1

.L3:

testl %esi, %esi

jle .L6

movl %edi, %eax

jmp .L5

.L1:

popl %ebx

popl %esi

popl %edi

popl %ebp

ret

.size bubbleSort, .-bubbleSort

.globl main

.type main, @function

main:

pushl %ebp

movl %esp, %ebp

pushl $10

pushl $array

call bubbleSort

addl $8, %esp

leave

ret

.size main, .-main

.globl array

.data

.align 32

.type array, @object

.size array, 40

array:

.long 10

.long 9

.long 8

.long 7

.long 6

.long 5

.long 4

.long 3

.long 2

.long 1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications Dexa 2023 Workshops 34th International Conference Dexa 2023 Penang Malaysia August 28 30 2023 Proceedings

Authors: Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil ,Bernhard Moser ,Atif Mashkoor ,Johannes Sametinger ,Maqbool Khan

1st Edition

303139688X, 978-3031396885

More Books

Students also viewed these Databases questions