Develop a program for the C expression by using MIPS assembl
Solution
Answer:
MIPS Assembly Language Code :
.zero 1
main:
push rbp
mov rbp, rsp
sub rsp, 184
mov eax, DWORD PTR [rbp-4]
cmp eax, DWORD PTR [rbp-8]
jne .L2
mov edx, DWORD PTR [rbp-48]
mov eax, DWORD PTR [rbp-12]
add eax, edx
mov DWORD PTR [rbp-240], eax
jmp .L3
.L2:
mov edx, DWORD PTR [rbp-48]
mov eax, DWORD PTR [rbp-12]
add eax, edx
mov DWORD PTR [rbp-32], eax
.L3:
mov eax, 0
leave
ret
__static_initialization_and_destruction_0(int, int):
push rbp
mov rbp, rsp
sub rsp, 16
mov DWORD PTR [rbp-4], edi
mov DWORD PTR [rbp-8], esi
cmp DWORD PTR [rbp-4], 1
jne .L7
cmp DWORD PTR [rbp-8], 65535
jne .L7
mov edi, OFFSET FLAT:std::__ioinit
call std::ios_base::Init::Init()
mov edx, OFFSET FLAT:__dso_handle
mov esi, OFFSET FLAT:std::__ioinit
mov edi, OFFSET FLAT:std::ios_base::Init::~Init()
call __cxa_atexit
.L7:
nop
leave
ret
push rbp
mov rbp, rsp
mov esi, 65535
mov edi, 1
call __static_initialization_and_destruction_0(int, int)
pop rbp
ret
![Develop a program for the C expression by using MIPS assembly utility: if(i==j)B[16]=g+A[12]; else A[16]= g+ A[12]; Assume that g is in $S0, A is in $s1, B is Develop a program for the C expression by using MIPS assembly utility: if(i==j)B[16]=g+A[12]; else A[16]= g+ A[12]; Assume that g is in $S0, A is in $s1, B is](/WebImages/3/develop-a-program-for-the-c-expression-by-using-mips-assembl-976107-1761500713-0.webp)