Please fill out the code in the blanks of the following C code int main() { int a[10]; int i; for { } } so that it gener
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Please fill out the code in the blanks of the following C code int main() { int a[10]; int i; for { } } so that it gener
Please fill out the code in the blanks of the following C code int main() { int a[10]; int i; for { } } so that it generates the following assembly code. main: pushl %ebp movl %esp,%ebp subl $44,%esp //hint: allocate space for a andi pushl%esi movl $10,-44%ebp) //hint: try to identify what is stored at -44%ebp) first. .L2: cmpl $0,-441%ebp) jle.L3 movl -44%ebp),%esi movl%esi,%eax decl %eax movl %eax,-40%ebp,%esi,4) decl -44%ebp) jmp.L2 .L3: leal -48%ebp),%esp popl%esi leave ret
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!