Convert the following Ccode to MIPS code The base memory add
Convert the following C-code to MIPS code. [The base memory address of the array is 0xA0000040, which must be loaded in the base register $s0.] Register assignments: i: $s1, j: $s2 int i, j; int array (100]; for (i = 0; i
Solution
.Ltext0: .globl main main: .LFB0: .cfi_startproc 0000 55 pushq %rbp .cfi_def_cfa_offset 16 .cfi_offset 6, -16 0001 4889E5 movq %rsp, %rbp .cfi_def_cfa_register 6 0004 4881EC28 subq $296, %rsp 010000 000b C78568FE movl $0, -408(%rbp) FFFF0000 0000 0015 EB49 jmp .L2 .L5: 0017 C7856CFE movl $0, -404(%rbp) FFFF0000 0000 0021 EB2D jmp .L3 .L4: 0049 83856CFE addl $1, -404(%rbp) FFFF01 0023 8B8568FE movl -408(%rbp), %eax FFFF 0029 4898 cltq 002b 8B948570 movl -400(%rbp,%rax,4), %edx FEFFFF 0032 8B856CFE movl -404(%rbp), %eax FFFF 0038 01C2 addl %eax, %edx 003a 8B8568FE movl -408(%rbp), %eax FFFF 0040 4898 cltq 0042 89948570 movl %edx, -400(%rbp,%rax,4) FEFFFF .L3: 0059 838568FE addl $1, -408(%rbp) FFFF01 0050 83BD68FE cmpl $1, -408(%rbp) FFFF01 0057 7ECA jle .L4 .L2: 0060 83BD68FE cmpl $99, -408(%rbp) FFFF63 0067 7EAE jle .L5 0069 B8000000 movl $0, %eax 00 006e C9 leave .cfi_def_cfa 7, 8 006f C3 ret .cfi_endproc .LFE0: .Letext0:![Convert the following C-code to MIPS code. [The base memory address of the array is 0xA0000040, which must be loaded in the base register $s0.] Register assign Convert the following C-code to MIPS code. [The base memory address of the array is 0xA0000040, which must be loaded in the base register $s0.] Register assign](/WebImages/5/convert-the-following-ccode-to-mips-code-the-base-memory-add-982482-1761504450-0.webp)