Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Assembly Language Please: fibonacci.asm - computes the following. a. Compute fib

ID: 3668129 • Letter: A

Question

Assembly Language Please:

fibonacci.asm
- computes the following.

a. Computefib(n)forn=2,3,...,6usinganarray.

Storeeachcomputedvalueinanarrayoftheappropriatesizeand

type.

Store fib(3) through fib(6) in consecutive bytes of the ebx register

starting from the lowest byte; that is, fib(3) is stored in the low byte (bl) of ebx, fib(4) is stored in the next byte (bh), fib(5) is stored in the next byte of ebx and fib(6) is stored in the highest byte.

Ifyoudon’tknowwhattheFibonaccisequenceis,thereisalotof information online that you can find.

Notes

1. Assume fib(0)=0, fib(1)=1.
2. You may use any instruction/directive/operator through chapter 4 pg 128, including any of the arithmetic operators +, *, /, -.
3. Your program must use indirect operands in some way as discussed in chapter 4. 4. Your program must make one call to DumpRegs before quitting to display the ebx register.
5. Part of the program will be graded on the basis of program style. I reserve the right to judge style as I deem fit for the assignment.

Explanation / Answer

.MODEL SMALL .STACK 64 .DATA VAL1 DB 01H VAL2 DB 01H LP DB 00H V1 DB 00H V2 DB 00H NL DB 0DH,0AH,'$' .CODE MAIN PROC MOV AX,@DATA MOV DS,AX MOV AH,01H INT 21H MOV CL,AL SUB CL,30H SUB CL,2 MOV AH,02H MOV DL,VAL1 ADD DL,30H INT 21H MOV AH,09H LEA DX,NL INT 21H MOV AH,02H MOV DL,VAL2 ADD DL,30H INT 21H MOV AH,09H LEA DX,NL INT 21H DISP: MOV BL,VAL1 ADD BL,VAL2 MOV AH,00H MOV AL,BL MOV LP,CL MOV CL,10 DIV CL MOV CL,LP MOV V1,AL MOV V2,AH MOV DL,V1 ADD DL,30H MOV AH,02H INT 21H MOV DL,V2 ADD DL,30H MOV AH,02H INT 21H MOV DL,VAL2 MOV VAL1,DL MOV VAL2,BL MOV AH,09H LEA DX,NL INT 21H LOOP DISP MOV AH,4CH INT 21H MAIN ENDP END MAIN OUTPUT *********** Z:SYSTEM~1AS1>ex5 5 1 1 2 3 5

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote