XXXXXXXXXX : 0: lea 0x4(%esp),%ecx 4: and $0xfffffff0,%esp 7: pushl -0x4(%ecx) a: push %ebp b: mov %esp,%ebp d: push %ebx e: push %ecx f: sub $0x10,%esp 12: mov %ecx,%ebx 14: movl $0x0,-0xc(%ebp) 1b:...



00000000
:
   0:   lea    0x4(%esp),%ecx
   4:   and    $0xfffffff0,%esp
   7:   pushl  -0x4(%ecx)
   a:   push   %ebp
   b:   mov    %esp,%ebp
   d:   push   %ebx
   e:   push   %ecx
   f:   sub    $0x10,%esp
  12:   mov    %ecx,%ebx
  14:   movl   $0x0,-0xc(%ebp)
  1b:   movl   $0x1,-0x10(%ebp)
  22:   jmp    48
  24:   mov    -0x10(%ebp),%eax
  27:   lea    0x0(,%eax,4),%edx
  2e:   mov    0x4(%ebx),%eax
  31:   add    %edx,%eax
  33:   mov    (%eax),%eax
  35:   sub    $0xc,%esp
  38:   push   %eax
  39:   call   3a
  3e:   add    $0x10,%esp
  41:   add    %eax,-0xc(%ebp)
  44:   addl   $0x1,-0x10(%ebp)
  48:   mov    -0x10(%ebp),%eax
  4b:   cmp    (%ebx),%eax
  4d:   jl     24
  4f:   mov    -0xc(%ebp),%eax
  52:   lea    -0x8(%ebp),%esp
  55:   pop    %ecx
  56:   pop    %ebx
  57:   pop    %ebp
  58:   lea    -0x4(%ecx),%esp
  5b:   ret

Command line arguments are passed toint main(int argc, char** argv) as argumentsargc andargv. You should assume thatargc is at ebp+8 andargv is at ebp+12.


This code returns the following value frommain (in registereax):





Question options:






































1)


product of the command line arguments




















2)


sum of the command line arguments




















3)


number of characters in the command line arguments




















4)


how many command line arguments were provided







Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here