Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Need help Asap on . fibonacci loop asm file keep getting an undefined symbol Error for FirstN edit code please also show proof that the
Need help Asap on fibonacci loop asm file keep getting an undefined symbol Error for FirstN edit code please also show proof that the program is working. INCLUDE C:IrvineIrvineinc
data
welcome BYTE
CSC Project : Fibonacci Numbers Again
Author: Jack
Hello, user! Lets Write some Fibonacci Numbers.
tell me when to stop! OK
prompt BYTE "What number you want to stop at
Num BYTE
;hello Byte "HELLO",
n DWORD ; first variable, used in calculations n
n DWORD ; second variable
message BYTE
code
main PROC ; start of the MAIN prodecure
mov edx, OFFSET welcome ; mov address of prompt into edx
call WriteString ; call proc to write out what is pointed to by edx
CALL CRLF ; printout a new line
CALL CRLF ; printout a new line
mov edx, OFFSET prompt ; mov address of prompt into edx
call WriteString ; call proc to write out what is pointed to by edx
call ReadDec ; user vale is put into eax
mov Num, al ; mov lowest bits in to Num BYTE
mov ecx, ; zero out the whole ecx register
mov cl Num ; move lower bits of eax into lower bits of ecx
mov cl al ; store given value in Num
mov al Num ; number of times to go through loop loop loops at ecx DWORD
mov edx, OFFSET FirstN ; mov address of prompt into edx
call WriteString ; call proc to write out what is pointed to by edx
TOPOFLOOP: ; start of loop
mov eax, ecx ; copy loop counter to eax never change ecx in loop
;
mov eax, n ; mov first value into eax
call writeDec ; write out loop value of loop counter
mov eax, n ; eax n
add eax, n ; eax n n n calcuate the rd value new send value
mov ebx n ; save ns value in register
mov n ebx ; save ns value into nnew first value
mov n eax ; new n n
mov n ebx ; new n old n
;
mov edx, OFFSET message ; mov address of prompt into edx
call WriteString ; call proc to write out what is pointed to by edx
loop TOPOFLOOP ; go to topofloop if and only if ecx
; the loop instructionautomatically decrements ecx
CALL CRLF
CALL CRLF
exit ; Exit to the operating system
main ENDP ; end of MAIN procedure
END main ; program tell MASM to execute start the MAIN procedure
EXIT
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started