Question: NASM Assembly Coding Assignment: Use Bubble Sort to sort 10 user input integers. I have written code to take user input of 10 integers, and

NASM Assembly Coding Assignment:

Use Bubble Sort to sort 10 user input integers.

I have written code to take user input of 10 integers, and then print the 10 integers from the array named numArr.

My assembly code that take user input and prints it:

segment .data

segment .bss

numArr resd 10

segment .text

global asm_main

asm_main:

push ebp

mov ebp, esp

; ********** CODE STARTS HERE **********

mov ecx, 0

top_read_loop:

cmp ecx, 10

JGE end_read_loop

call read_int

mov DWORD [numArr + ecx * 4], eax

inc ecx

JMP top_read_loop

end_read_loop:

mov ecx, 0

top_write_loop:

cmp ecx, 10

jge end_write_loop

mov eax, DWORD [numArr + ecx * 4]

call print_int

call print_nl

inc ecx

jmp top_write_loop

end_write_loop:

; *********** CODE ENDS HERE ***********

mov eax, 0

mov esp, ebp

pop ebp

ret

Output of the program after sorting, it should look like this :

NASM Assembly Coding Assignment: Use Bubble Sort to sort 10 user input

? Input - Inpuft - Inpuft - Input 24 ?Input - Input 90 -Input - Input put 100 ? Input 67_ T 44 In - Output Output - Output - Output Output - Output ? Output ? Output 90 Output 12 ? 100- Output

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!