Jason@Jason-Notebook ~/cs47/subfac $ objdump -d subfac.o subfac.o: file format pe-i386 Disassembly of section .text: 00000000 <_subfac>: 0: 55 push %ebp 1: 89 e5 mov %esp,%ebp 3: 31 d2 xor %edx,%edx 5: 4a dec %edx 6: 31 c9 xor %ecx,%ecx 8: 31 c0 xor %eax,%eax 0000000a <.start>: a: f7 da neg %edx c: 0f af c1 imul %ecx,%eax f: 01 d0 add %edx,%eax 11: 41 inc %ecx 12: 3b 4d 08 cmp 0x8(%ebp),%ecx 15: 7e f3 jle a <.start> 17: 5d pop %ebp 18: c3 ret 19: 90 nop 1a: 90 nop 1b: 90 nop
Are the hex numbers to the left the size of the program thus size is 1b bytes? Also... this is a question I should ask in the ASM forum but I am guessing a few of you might be able to answer... how the heck can I get rid of those no operation instructions? Here is my ASM:
.file "subfac.c" .globl _subfac .def _mull; .scl 2; .type 32; .endef _subfac: push %ebp movl %esp, %ebp xorl %edx, %edx # (-1)^n decl %edx xorl %ecx, %ecx # iterator xorl %eax, %eax # zero out the total .start: negl %edx # (-1)^n imul %ecx, %eax # n * subfac(n-1) addl %edx, %eax # [ (-1)^n + n*subfac(n-1)] incl %ecx # increment ecx cmp 8(%ebp), %ecx # i < n? jle .start pop %ebp ret


Sign In
Create Account


Back to top










