Assembly Programming Language using Visual Studio May be co

Assembly Programming Language using Visual Studio - May be completed in either 32-bit mode or 64-bit mode

Fibonacci Numbers

Write a program that uses a loop to calculate the first seven values of the Fibonacci number sequence described by the following formula:

Fib(1) = 1, Fib(2) = 1, Fib(n) = Fib(n-1) + Fib(n-2)

Solution

.file 1 \"\" .section .mdebug.abi32 .previous .gnu_attribute 4, 1 .abicalls .text .align 2 .globl _Z3fibi $LFB12 = . .set nomips16 .ent _Z3fibi .type _Z3fibi, @function _Z3fibi: .frame $sp,40,$31 # vars= 0, regs= 4/0, args= 16, gp= 8 .mask 0x80070000,-4 .fmask 0x00000000,0 .set noreorder .cpload $25 .set nomacro addiu $sp,$sp,-40 $LCFI0: sw $31,36($sp) $LCFI1: sw $18,32($sp) movz $31,$31,$0 $LCFI2: sw $17,28($sp) $LCFI3: sw $16,24($sp) $LCFI4: .cprestore 16 bne $4,$0,$L2 move $17,$4 b $L3 move $2,$0 $L2: li $2,1 # 0x1 beq $4,$2,$L3 nop lw $18,%got(_Z3fibi)($28) nop move $25,$18 jalr $25 addiu $4,$4,-1 move $16,$2 move $25,$18 jalr $25 addiu $4,$17,-2 addu $2,$2,$16 $L3: lw $31,36($sp) lw $18,32($sp) lw $17,28($sp) lw $16,24($sp) j $31 addiu $sp,$sp,40 .set macro .set reorder .end _Z3fibi $LFE12: .size _Z3fibi, .-_Z3fibi .align 2 .globl main $LFB13 = . .set nomips16 .ent main .type main, @function main: .frame $sp,0,$31 # vars= 0, regs= 0/0, args= 0, gp= 0 .mask 0x00000000,0 .fmask 0x00000000,0 .set noreorder .set nomacro j $31 move $2,$0 .set macro .set reorder .end main $LFE13: .size main, .-main .section .eh_frame,\"aw\",@progbits $Lframe1: .4byte $LECIE1-$LSCIE1 $LSCIE1: .4byte 0x0 .byte 0x1 .globl __gxx_personality_v0 .ascii \"zP\\000\" .uleb128 0x1 .sleb128 -4 .byte 0x1f .uleb128 0x5 .byte 0x0 .4byte __gxx_personality_v0 .byte 0xc .uleb128 0x1d .uleb128 0x0 .align 2 $LECIE1: $LSFDE1: .4byte $LEFDE1-$LASFDE1 $LASFDE1: .4byte $LASFDE1-$Lframe1 .4byte $LFB12 .4byte $LFE12-$LFB12 .uleb128 0x0 .byte 0x4 .4byte $LCFI0-$LFB12 .byte 0xe .uleb128 0x28 .byte 0x4 .4byte $LCFI4-$LCFI0 .byte 0x11 .uleb128 0x10 .sleb128 4 .byte 0x11 .uleb128 0x11 .sleb128 3 .byte 0x11 .uleb128 0x12 .sleb128 2 .byte 0x11 .uleb128 0x1f .sleb128 1 .align 2
Assembly Programming Language using Visual Studio - May be completed in either 32-bit mode or 64-bit mode Fibonacci Numbers Write a program that uses a loop to

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site