Write a simple and short MIPS assembly language program that asks the user for 6 numbers, merge-sorts them, and then prints them out in ascending order comment each and every programme .(USING WINDOWS QtSpim)
Note : This question is not giving desired solution may you please try it in a simple manner for six number inputed by the user.
.file "example.c"
.text
.Ltext0:
.comm a,24,16
.comm b,24,16
.globl merging
.type merging, @function
merging:
.LFB0:
.file 1 "/tmp/compiler-explorer-compiler118124-55-14mrxtx.aqq7/example.c"
.loc 1 7 0
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
movl %edx, -28(%rbp)
.loc 1 10 0
movl -20(%rbp), %eax
movl %eax, -4(%rbp)
movl -24(%rbp), %eax
addl $1, %eax
movl %eax, -8(%rbp)
movl -20(%rbp), %eax
movl %eax, -12(%rbp)
jmp .L2
.L6:
.loc 1 11 0
movl -4(%rbp), %eax
cltq
movl a(,%rax,4), %edx
movl -8(%rbp), %eax
cltq
movl a(,%rax,4), %eax
cmpl %eax, %edx
jg .L3
.loc 1 12 0
movl -4(%rbp), %eax
leal 1(%rax), %edx
movl %edx, -4(%rbp)
cltq
movl a(,%rax,4), %edx
movl -12(%rbp), %eax
cltq
movl %edx, b(,%rax,4)
jmp .L4
.L3:
.loc 1 14 0
movl -8(%rbp), %eax
leal 1(%rax), %edx
movl %edx, -8(%rbp)
cltq
movl a(,%rax,4), %edx
movl -12(%rbp), %eax
cltq
movl %edx, b(,%rax,4)
.L4:
.loc 1 10 0 discriminator 2
addl $1, -12(%rbp)
.L2:
.loc 1 10 0 is_stmt 0 discriminator 1
movl -4(%rbp), %eax
cmpl -24(%rbp), %eax
jg .L7
.loc 1 10 0 discriminator 3
movl -8(%rbp), %eax
cmpl -28(%rbp), %eax
jle .L6
.loc 1 17 0 is_stmt 1
jmp .L7
.L8:
.loc 1 18 0
movl -4(%rbp), %edx
leal 1(%rdx), %eax
movl %eax, -4(%rbp)
movl -12(%rbp), %eax
leal 1(%rax), %ecx
movl %ecx, -12(%rbp)
movslq %edx, %rdx
movl a(,%rdx,4), %edx
cltq
movl %edx, b(,%rax,4)
.L7:
.loc 1 17 0
movl -4(%rbp), %eax
cmpl -24(%rbp), %eax
jle .L8
.loc 1 20 0
jmp .L9
.L10:
.loc 1 21 0
movl -8(%rbp), %edx
leal 1(%rdx), %eax
movl %eax, -8(%rbp)
movl -12(%rbp), %eax
leal 1(%rax), %ecx
movl %ecx, -12(%rbp)
movslq %edx, %rdx
movl a(,%rdx,4), %edx
cltq
movl %edx, b(,%rax,4)
.L9:
.loc 1 20 0
movl -8(%rbp), %eax
cmpl -28(%rbp), %eax
jle .L10
.loc 1 23 0
movl -20(%rbp), %eax
movl %eax, -12(%rbp)
jmp .L11
.L12:
.loc 1 24 0 discriminator 3
movl -12(%rbp), %eax
cltq
movl b(,%rax,4), %edx
movl -12(%rbp), %eax
cltq
movl %edx, a(,%rax,4)
.loc 1 23 0 discriminator 3
addl $1, -12(%rbp)
.L11:
.loc 1 23 0 is_stmt 0 discriminator 1
movl -12(%rbp), %eax
cmpl -28(%rbp), %eax
jle .L12
.loc 1 25 0 is_stmt 1
nop
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size merging, .-merging
.globl sort
.type sort, @function
sort:
.LFB1:
.loc 1 27 0
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $32, %rsp
movl %edi, -20(%rbp)
movl %esi, -24(%rbp)
.loc 1 30 0
movl -20(%rbp), %eax
cmpl -24(%rbp), %eax
jge .L16
.loc 1 31 0
movl -20(%rbp), %edx
movl -24(%rbp), %eax
addl %edx, %eax
movl %eax, %edx
shrl $31, %edx
addl %edx, %eax
sarl %eax
movl %eax, -4(%rbp)
.loc 1 32 0
movl -4(%rbp), %edx
movl -20(%rbp), %eax
movl %edx, %esi
movl %eax, %edi
call sort
.loc 1 33 0
movl -4(%rbp), %eax
leal 1(%rax), %edx
movl -24(%rbp), %eax
movl %eax, %esi
movl %edx, %edi
call sort
.loc 1 34 0
movl -24(%rbp), %edx
movl -4(%rbp), %ecx
movl -20(%rbp), %eax
movl %ecx, %esi
movl %eax, %edi
call merging
jmp .L13
.L16:
.loc 1 36 0
nop
.L13:
.loc 1 38 0
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size sort, .-sort
.section .rodata
.LC0:
.string "Please enter 6 numbers "
.LC1:
.string "%d"
.LC2:
.string "%d "
.LC3:
.string "\nList after sorting"
.text
.globl main
.type main, @function
main:
.LFB2:
.loc 1 40 0
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
.loc 1 43 0
movl $.LC0, %edi
call puts
.loc 1 45 0
movl $0, -4(%rbp)
jmp .L18
.L19:
.loc 1 47 0 discriminator 3
movl -4(%rbp), %eax
cltq
salq $2, %rax
addq $a, %rax
movq %rax, %rsi
movl $.LC1, %edi
movl $0, %eax
call __isoc99_scanf
.loc 1 45 0 discriminator 3
addl $1, -4(%rbp)
.L18:
.loc 1 45 0 is_stmt 0 discriminator 1
cmpl $5, -4(%rbp)
jle .L19
.loc 1 50 0 is_stmt 1
movl $0, -4(%rbp)
jmp .L20
.L21:
.loc 1 51 0 discriminator 3
movl -4(%rbp), %eax
cltq
movl a(,%rax,4), %eax
movl %eax, %esi
movl $.LC2, %edi
movl $0, %eax
call printf
.loc 1 50 0 discriminator 3
addl $1, -4(%rbp)
.L20:
.loc 1 50 0 is_stmt 0 discriminator 1
cmpl $5, -4(%rbp)
jle .L21
.loc 1 53 0 is_stmt 1
movl $6, %esi
movl $0, %edi
call sort
.loc 1 55 0
movl $.LC3, %edi
call puts
.loc 1 57 0
movl $0, -4(%rbp)
jmp .L22
.L23:
.loc 1 58 0 discriminator 3
movl -4(%rbp), %eax
cltq
movl a(,%rax,4), %eax
movl %eax, %esi
movl $.LC2, %edi
movl $0, %eax
call printf
.loc 1 57 0 discriminator 3
addl $1, -4(%rbp)
.L22:
.loc 1 57 0 is_stmt 0 discriminator 1
cmpl $5, -4(%rbp)
jle .L23
movl $0, %eax
.loc 1 59 0 is_stmt 1
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE2:
.size main, .-main
.Letext0:
.file 2 "/opt/compiler-explorer/gcc-7.2.0/lib/gcc/x86_64-linux-gnu/7.2.0/include/stddef.h"
.file 3 "/usr/include/x86_64-linux-gnu/bits/types.h"
.file 4 "/usr/include/libio.h"
.file 5 "/usr/include/stdio.h"
.file 6 "/usr/include/x86_64-linux-gnu/bits/sys_errlist.h"
.section .debug_info,"",@progbits
.Ldebug_info0:
.long 0x40f
.value 0x4
.long .Ldebug_abbrev0
.byte 0x8
.uleb128 0x1
.long .LASF56
.byte 0xc
.long .LASF57
.long .LASF58
.quad .Ltext0
.quad .Letext0-.Ltext0
.long .Ldebug_line0
.uleb128 0x2
.long .LASF7
.byte 0x2
.byte 0xd8
.long 0x38
.uleb128 0x3
.byte 0x8
.byte 0x7
.long .LASF0
.uleb128 0x3
.byte 0x1
.byte 0x8
.long .LASF1
.uleb128 0x3
.byte 0x2
.byte 0x7
.long .LASF2
.uleb128 0x3
.byte 0x4
.byte 0x7
.long .LASF3
.uleb128 0x3
.byte 0x1
.byte 0x6
.long .LASF4
.uleb128 0x3
.byte 0x2
.byte 0x5
.long .LASF5
.uleb128 0x4
.byte 0x4
.byte 0x5
.string "int"
.uleb128 0x3
.byte 0x8
.byte 0x5
.long .LASF6
.uleb128 0x2
.long .LASF8
.byte 0x3
.byte 0x83
.long 0x69
.uleb128 0x2
.long .LASF9
.byte 0x3
.byte 0x84
.long 0x69
.uleb128 0x5
.byte 0x8
.uleb128 0x6
.byte 0x8
.long 0x8e
.uleb128 0x3
.byte 0x1
.byte 0x6
.long .LASF10
.uleb128 0x7
.long 0x8e
.uleb128 0x8
.long .LASF40
.byte 0xd8
.byte 0x4
.byte 0xf1
.long 0x217
.uleb128 0x9
.long .LASF11
.byte 0x4
.byte 0xf2
.long 0x62
.byte 0
.uleb128 0x9
.long .LASF12
.byte 0x4
.byte 0xf7
.long 0x88
.byte 0x8
.uleb128 0x9
.long .LASF13
.byte 0x4
.byte 0xf8
.long 0x88
.byte 0x10
.uleb128 0x9
.long .LASF14
.byte 0x4
.byte 0xf9
.long 0x88
.byte 0x18
.uleb128 0x9
.long .LASF15
.byte 0x4
.byte 0xfa
.long 0x88
.byte 0x20
.uleb128 0x9
.long .LASF16
.byte 0x4
.byte 0xfb
.long 0x88
.byte 0x28
.uleb128 0x9
.long .LASF17
.byte 0x4
.byte 0xfc
.long 0x88
.byte 0x30
.uleb128 0x9
.long .LASF18
.byte 0x4
.byte 0xfd
.long 0x88
.byte 0x38
.uleb128 0x9
.long .LASF19
.byte 0x4
.byte 0xfe
.long 0x88
.byte 0x40
.uleb128 0xa
.long .LASF20
.byte 0x4
.value 0x100
.long 0x88
.byte 0x48
.uleb128 0xa
.long .LASF21
.byte 0x4
.value 0x101
.long 0x88
.byte 0x50
.uleb128 0xa
.long .LASF22
.byte 0x4
.value 0x102
.long 0x88
.byte 0x58
.uleb128 0xa
.long .LASF23
.byte 0x4
.value 0x104
.long 0x24f
.byte 0x60
.uleb128 0xa
.long .LASF24
.byte 0x4
.value 0x106
.long 0x255
.byte 0x68
.uleb128 0xa
.long .LASF25
.byte 0x4
.value 0x108
.long 0x62
.byte 0x70
.uleb128 0xa
.long .LASF26
.byte 0x4
.value 0x10c
.long 0x62
.byte 0x74
.uleb128 0xa
.long .LASF27
.byte 0x4
.value 0x10e
.long 0x70
.byte 0x78
.uleb128 0xa
.long .LASF28
.byte 0x4
.value 0x112
.long 0x46
.byte 0x80
.uleb128 0xa
.long .LASF29
.byte 0x4
.value 0x113
.long 0x54
.byte 0x82
.uleb128 0xa
.long .LASF30
.byte 0x4
.value 0x114
.long 0x25b
.byte 0x83
.uleb128 0xa
.long .LASF31
.byte 0x4
.value 0x118
.long 0x26b
.byte 0x88
.uleb128 0xa
.long .LASF32
.byte 0x4
.value 0x121
.long 0x7b
.byte 0x90
.uleb128 0xa
.long .LASF33
.byte 0x4
.value 0x129
.long 0x86
.byte 0x98
.uleb128 0xa
.long .LASF34
.byte 0x4
.value 0x12a
.long 0x86
.byte 0xa0
.uleb128 0xa
.long .LASF35
.byte 0x4
.value 0x12b
.long 0x86
.byte 0xa8
.uleb128 0xa
.long .LASF36
.byte 0x4
.value 0x12c
.long 0x86
.byte 0xb0
.uleb128 0xa
.long .LASF37
.byte 0x4
.value 0x12e
.long 0x2d
.byte 0xb8
.uleb128 0xa
.long .LASF38
.byte 0x4
.value 0x12f
.long 0x62
.byte 0xc0
.uleb128 0xa
.long .LASF39
.byte 0x4
.value 0x131
.long 0x271
.byte 0xc4
.byte 0
.uleb128 0xb
.long .LASF59
.byte 0x4
.byte 0x96
.uleb128 0x8
.long .LASF41
.byte 0x18
.byte 0x4
.byte 0x9c
.long 0x24f
.uleb128 0x9
.long .LASF42
.byte 0x4
.byte 0x9d
.long 0x24f
.byte 0
.uleb128 0x9
.long .LASF43
.byte 0x4
.byte 0x9e
.long 0x255
.byte 0x8
.uleb128 0x9
.long .LASF44
.byte 0x4
.byte 0xa2
.long 0x62
.byte 0x10
.byte 0
.uleb128 0x6
.byte 0x8
.long 0x21e
.uleb128 0x6
.byte 0x8
.long 0x9a
.uleb128 0xc
.long 0x8e
.long 0x26b
.uleb128 0xd
.long 0x38
.byte 0
.byte 0
.uleb128 0x6
.byte 0x8
.long 0x217
.uleb128 0xc
.long 0x8e
.long 0x281
.uleb128 0xd
.long 0x38
.byte 0x13
.byte 0
.uleb128 0xe
.long .LASF60
.uleb128 0xf
.long .LASF45
.byte 0x4
.value 0x13b
.long 0x281
.uleb128 0xf
.long .LASF46
.byte 0x4
.value 0x13c
.long 0x281
.uleb128 0xf
.long .LASF47
.byte 0x4
.value 0x13d
.long 0x281
.uleb128 0x6
.byte 0x8
.long 0x95
.uleb128 0x7
.long 0x2aa
.uleb128 0x10
.long .LASF48
.byte 0x5
.byte 0xa8
.long 0x255
.uleb128 0x10
.long .LASF49
.byte 0x5
.byte 0xa9
.long 0x255
.uleb128 0x10
.long .LASF50
.byte 0x5
.byte 0xaa
.long 0x255
.uleb128 0x10
.long .LASF51
.byte 0x6
.byte 0x1a
.long 0x62
.uleb128 0xc
.long 0x2b0
.long 0x2ec
.uleb128 0x11
.byte 0
.uleb128 0x7
.long 0x2e1
.uleb128 0x10
.long .LASF52
.byte 0x6
.byte 0x1b
.long 0x2ec
.uleb128 0xc
.long 0x62
.long 0x30c
.uleb128 0xd
.long 0x38
.byte 0x5
.byte 0
.uleb128 0x12
.string "a"
.byte 0x1
.byte 0x4
.long 0x2fc
.uleb128 0x9
.byte 0x3
.quad a
.uleb128 0x12
.string "b"
.byte 0x1
.byte 0x5
.long 0x2fc
.uleb128 0x9
.byte 0x3
.quad b
.uleb128 0x13
.long .LASF53
.byte 0x1
.byte 0x28
.long 0x62
.quad .LFB2
.quad .LFE2-.LFB2
.uleb128 0x1
.byte 0x9c
.long 0x360
.uleb128 0x14
.string "i"
.byte 0x1
.byte 0x29
.long 0x62
.uleb128 0x2
.byte 0x91
.sleb128 -20
.byte 0
.uleb128 0x15
.long .LASF54
.byte 0x1
.byte 0x1b
.quad .LFB1
.quad .LFE1-.LFB1
.uleb128 0x1
.byte 0x9c
.long 0x3a8
.uleb128 0x16
.string "low"
.byte 0x1
.byte 0x1b
.long 0x62
.uleb128 0x2
.byte 0x91
.sleb128 -36
.uleb128 0x17
.long .LASF55
.byte 0x1
.byte 0x1b
.long 0x62
.uleb128 0x2
.byte 0x91
.sleb128 -40
.uleb128 0x14
.string "mid"
.byte 0x1
.byte 0x1c
.long 0x62
.uleb128 0x2
.byte 0x91
.sleb128 -20
.byte 0
.uleb128 0x18
.long .LASF61
.byte 0x1
.byte 0x7
.quad .LFB0
.quad .LFE0-.LFB0
.uleb128 0x1
.byte 0x9c
.uleb128 0x16
.string "low"
.byte 0x1
.byte 0x7
.long 0x62
.uleb128 0x2
.byte 0x91
.sleb128 -36
.uleb128 0x16
.string "mid"
.byte 0x1
.byte 0x7
.long 0x62
.uleb128 0x2
.byte 0x91
.sleb128 -40
.uleb128 0x17
.long .LASF55
.byte 0x1
.byte 0x7
.long 0x62
.uleb128 0x2
.byte 0x91
.sleb128 -44
.uleb128 0x14
.string "l1"
.byte 0x1
.byte 0x8
.long 0x62
.uleb128 0x2
.byte 0x91
.sleb128 -20
.uleb128 0x14
.string "l2"
.byte 0x1
.byte 0x8
.long 0x62
.uleb128 0x2
.byte 0x91
.sleb128 -24
.uleb128 0x14
.string "i"
.byte 0x1
.byte 0x8
.long 0x62
.uleb128 0x2
.byte 0x91
.sleb128 -28
.byte 0
.byte 0
.section .debug_abbrev,"",@progbits
.Ldebug_abbrev0:
.uleb128 0x1
.uleb128 0x11
.byte 0x1
.uleb128 0x25
.uleb128 0xe
.uleb128 0x13
.uleb128 0xb
.uleb128 0x3
.uleb128 0xe
.uleb128 0x1b
.uleb128 0xe
.uleb128 0x11
.uleb128 0x1
.uleb128 0x12
.uleb128 0x7
.uleb128 0x10
.uleb128 0x17
.byte 0
.byte 0
.uleb128 0x2
.uleb128 0x16
.byte 0
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0x3
.uleb128 0x24
.byte 0
.uleb128 0xb
.uleb128 0xb
.uleb128 0x3e
.uleb128 0xb
.uleb128 0x3
.uleb128 0xe
.byte 0
.byte 0
.uleb128 0x4
.uleb128 0x24
.byte 0
.uleb128 0xb
.uleb128 0xb
.uleb128 0x3e
.uleb128 0xb
.uleb128 0x3
.uleb128 0x8
.byte 0
.byte 0
.uleb128 0x5
.uleb128 0xf
.byte 0
.uleb128 0xb
.uleb128 0xb
.byte 0
.byte 0
.uleb128 0x6
.uleb128 0xf
.byte 0
.uleb128 0xb
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0x7
.uleb128 0x26
.byte 0
.uleb128 0x49
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0x8
.uleb128 0x13
.byte 0x1
.uleb128 0x3
.uleb128 0xe
.uleb128 0xb
.uleb128 0xb
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x1
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0x9
.uleb128 0xd
.byte 0
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x38
.uleb128 0xb
.byte 0
.byte 0
.uleb128 0xa
.uleb128 0xd
.byte 0
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0x5
.uleb128 0x49
.uleb128 0x13
.uleb128 0x38
.uleb128 0xb
.byte 0
.byte 0
.uleb128 0xb
.uleb128 0x16
.byte 0
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.byte 0
.byte 0
.uleb128 0xc
.uleb128 0x1
.byte 0x1
.uleb128 0x49
.uleb128 0x13
.uleb128 0x1
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0xd
.uleb128 0x21
.byte 0
.uleb128 0x49
.uleb128 0x13
.uleb128 0x2f
.uleb128 0xb
.byte 0
.byte 0
.uleb128 0xe
.uleb128 0x13
.byte 0
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3c
.uleb128 0x19
.byte 0
.byte 0
.uleb128 0xf
.uleb128 0x34
.byte 0
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0x5
.uleb128 0x49
.uleb128 0x13
.uleb128 0x3f
.uleb128 0x19
.uleb128 0x3c
.uleb128 0x19
.byte 0
.byte 0
.uleb128 0x10
.uleb128 0x34
.byte 0
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x3f
.uleb128 0x19
.uleb128 0x3c
.uleb128 0x19
.byte 0
.byte 0
.uleb128 0x11
.uleb128 0x21
.byte 0
.byte 0
.byte 0
.uleb128 0x12
.uleb128 0x34
.byte 0
.uleb128 0x3
.uleb128 0x8
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x3f
.uleb128 0x19
.uleb128 0x2
.uleb128 0x18
.byte 0
.byte 0
.uleb128 0x13
.uleb128 0x2e
.byte 0x1
.uleb128 0x3f
.uleb128 0x19
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x11
.uleb128 0x1
.uleb128 0x12
.uleb128 0x7
.uleb128 0x40
.uleb128 0x18
.uleb128 0x2116
.uleb128 0x19
.uleb128 0x1
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0x14
.uleb128 0x34
.byte 0
.uleb128 0x3
.uleb128 0x8
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x2
.uleb128 0x18
.byte 0
.byte 0
.uleb128 0x15
.uleb128 0x2e
.byte 0x1
.uleb128 0x3f
.uleb128 0x19
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x27
.uleb128 0x19
.uleb128 0x11
.uleb128 0x1
.uleb128 0x12
.uleb128 0x7
.uleb128 0x40
.uleb128 0x18
.uleb128 0x2116
.uleb128 0x19
.uleb128 0x1
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0x16
.uleb128 0x5
.byte 0
.uleb128 0x3
.uleb128 0x8
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x2
.uleb128 0x18
.byte 0
.byte 0
.uleb128 0x17
.uleb128 0x5
.byte 0
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x2
.uleb128 0x18
.byte 0
.byte 0
.uleb128 0x18
.uleb128 0x2e
.byte 0x1
.uleb128 0x3f
.uleb128 0x19
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x27
.uleb128 0x19
.uleb128 0x11
.uleb128 0x1
.uleb128 0x12
.uleb128 0x7
.uleb128 0x40
.uleb128 0x18
.uleb128 0x2117
.uleb128 0x19
.byte 0
.byte 0
.byte 0
.section .debug_aranges,"",@progbits
.long 0x2c
.value 0x2
.long .Ldebug_info0
.byte 0x8
.byte 0
.value 0
.value 0
.quad .Ltext0
.quad .Letext0-.Ltext0
.quad 0
.quad 0
.section .debug_line,"",@progbits
.Ldebug_line0:
.section .debug_str,"MS",@progbits,1
.LASF19:
.string "_IO_buf_end"
.LASF27:
.string "_old_offset"
.LASF54:
.string "sort"
.LASF51:
.string "sys_nerr"
.LASF22:
.string "_IO_save_end"
.LASF5:
.string "short int"
.LASF7:
.string "size_t"
.LASF32:
.string "_offset"
.LASF16:
.string "_IO_write_ptr"
.LASF11:
.string "_flags"
.LASF18:
.string "_IO_buf_base"
.LASF23:
.string "_markers"
.LASF13:
.string "_IO_read_end"
.LASF61:
.string "merging"
.LASF57:
.string "/tmp/compiler-explorer-compiler118124-55-14mrxtx.aqq7/example.c"
.LASF56:
.string "GNU C11 7.2.0 -mtune=generic -march=x86-64 -g"
.LASF31:
.string "_lock"
.LASF6:
.string "long int"
.LASF55:
.string "high"
.LASF28:
.string "_cur_column"
.LASF47:
.string "_IO_2_1_stderr_"
.LASF60:
.string "_IO_FILE_plus"
.LASF44:
.string "_pos"
.LASF43:
.string "_sbuf"
.LASF40:
.string "_IO_FILE"
.LASF1:
.string "unsigned char"
.LASF4:
.string "signed char"
.LASF45:
.string "_IO_2_1_stdin_"
.LASF3:
.string "unsigned int"
.LASF41:
.string "_IO_marker"
.LASF30:
.string "_shortbuf"
.LASF58:
.string "/compiler-explorer"
.LASF15:
.string "_IO_write_base"
.LASF39:
.string "_unused2"
.LASF12:
.string "_IO_read_ptr"
.LASF2:
.string "short unsigned int"
.LASF10:
.string "char"
.LASF53:
.string "main"
.LASF42:
.string "_next"
.LASF33:
.string "__pad1"
.LASF34:
.string "__pad2"
.LASF35:
.string "__pad3"
.LASF36:
.string "__pad4"
.LASF37:
.string "__pad5"
.LASF50:
.string "stderr"
.LASF0:
.string "long unsigned int"
.LASF17:
.string "_IO_write_end"
.LASF9:
.string "__off64_t"
.LASF8:
.string "__off_t"
.LASF24:
.string "_chain"
.LASF21:
.string "_IO_backup_base"
.LASF48:
.string "stdin"
.LASF26:
.string "_flags2"
.LASF38:
.string "_mode"
.LASF14:
.string "_IO_read_base"
.LASF29:
.string "_vtable_offset"
.LASF20:
.string "_IO_save_base"
.LASF52:
.string "sys_errlist"
.LASF25:
.string "_fileno"
.LASF49:
.string "stdout"
.LASF46:
.string "_IO_2_1_stdout_"
.LASF59:
.string "_IO_lock_t"
.ident "GCC: (GCC-Explorer-Build) 7.2.0"
.section .note.GNU-stack,"",@progbits
Write a simple and short MIPS assembly language program that asks the user for 6 numbers,...
LANGUAGE: JAVA Sorting an array: 2. Write a program that asks the user for 5 numbers and stores them in an array called data. Then call a method that accepts the array as an argument, sorts the array in ascending order and prints out the original AND sorted array (Hint: The method does not return anything in this case, so it should be set to void).
Linear Search: Write a MIPS assembly language program that can search for a number that entered by user in an array with 20 integer numbers and prints the index of the number in the array if it is found and -1 if not found
MIPS Assembly Language * Write a simple program to count the number of non overlapping repetitions of a character pattern in a character string. For example " the pattern "aa" appears twice in the in the string "aabbaaa". Provide a user interface to read the character pattern and the string.
Write a MIPS Assembly language program to request a file name from the user, open the file, read the contents, and write it out to the console.
IN SPARC ASSEMBLY ONLY, write a program that prompts the user for two numbers and prints the sum. THIS MUST BE IN SPARC ASSEMBLY. DO NOT WRITE IT IN NORMAL ASSEMBLY LANGUAGE. Sample: Enter Number 1: 2 Enter Number 2: 3 The sum of 2 and 3 is 5 Note: -Your program should contain .data, .bss, and .text sections -DO NOT try to optimize your code (i.e remove nops) -DO NOT write this in regular assembly, it must be in...
PLEASE WRITE IN 80X86 ASSEMBLY LANGUAGE Write a program that asks the user to enter their monthly costs for each of the following housing-related expenses: rent or mortgage payment utilities phones cable The program should then display the total monthly cost of these expenses and the total annual cost of these expenses.
Write a MIPS Assembly program to accept two numbers A and B from the user. Print all the prime numbers between A and B. Also, check if A and B are prime. If no prime number exits print the string "No prime number between numbers A and B"
using mips for assembly language WPte a program that asks the user for 2 numbers. the program should then add the 2 numbers bit by bit, using boolean operators no arithmetic operations ex: add, addi, sub, mult, div or arrays are permitted in this project. forming a new variable (in a register) with the solution. That solution is to be output bit by bit using the function that was written in class do not use syscall with a value 10...
Write a program that asks a user to enter a number to echo it out For example : Enter a number : "write the number here" You entered : "the number you wrote up their^ Also make sure to write comments, Use the MIPS assembly language
Name B. (7 pts) MIPS short answer 1. (3pt) For the following MIPS assembly language program: loop: addi Sto, $to,-1 bne $to, $zero, loop Translate the second instruction into MIPS machine language and write it in hex. 2. (2 pt) Which best describes the reason that we maintain the stack pointer in a register? (circle one) i. The hardware forces use of a stack pointer. ii. We need a local pointer because we are often limited to relative addressing. ili....