Question
I need help creating this code.

Write an assembly program (MASM and Irvines libraries) that calculates and prints out the first five Fibonacci numbers FO=0;
0 0
Add a comment Improve this question Transcribed image text
Answer #1

org 100h
.stack 100h
.data
Fab DB 2 DUP(1), 4 DUP(0)
.code
mov ah,(fab +0)
mov al,(fab+1)
add al,ah
mov (fab+2),al
;================================================
mov ah,(fab +1)
mov al,(fab+2)
add al,ah
mov (fab+3),al
;================================================
mov ah,(fab +2)
mov al,(fab+3)
add al,ah
mov (fab+4),al
;==============================================
mov ah,(fab +3)
mov al,(fab+4)
add al,ah
mov (fab+5),al
;==============================================
ret

Add a comment
Know the answer?
Add Answer to:
I need help creating this code. Write an assembly program (MASM and Irvine's libraries) that calculates...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • X86 Assembly Language Help to implement the CipherChar Procedure at the end of the given code...

    X86 Assembly Language Help to implement the CipherChar Procedure at the end of the given code INCLUDE Irvine32.inc         .data       KeyPrompt BYTE "Enter the passphrase: ",0       TextPrompt BYTE "Enter the plaintest: ",0           str1 BYTE "The passphrase has length:",0           str2 BYTE "The plaintest has length:",0       KeyIs BYTE "The passphrase: ",0       PlainTextIs BYTE "The plaintext: ",0       CipherTextIs BYTE "The ciphertext: ",0       KMAX = 64                        ; passphrase buffer maximum size       BMAX = 128                       ; test...

  • 1. Assume that you are given values in eax, ebx, ecx. Write an assembly code that...

    1. Assume that you are given values in eax, ebx, ecx. Write an assembly code that does the following: eax = (ecx + edx ) - (eax + ebx) 2. Write a piece of code that copies the number inside al to ch. Example: Assume that Initially eax = 0x15DBCB19. At the end of your code ecx = 0x00001900. Your code must be as efficient as possible. 3. You are given eax = 0x5. Write one line of code in...

  • I need help finding the input that wont result in explode_bomb in this assembly 08048cd3 <phase_4>:...

    I need help finding the input that wont result in explode_bomb in this assembly 08048cd3 <phase_4>: 8048cd3: 57 push %edi 8048cd4: 56 push %esi 8048cd5: 53 push %ebx 8048cd6: 83 ec 10 sub $0x10,%esp 8048cd9: 8b 74 24 20 mov 0x20(%esp),%esi 8048cdd: 89 34 24 mov %esi,(%esp) 8048ce0: e8 f6 03 00 00 call 80490db <string_length> 8048ce5: 83 c0 01 add $0x1,%eax 8048ce8: 89 04 24 mov %eax,(%esp) 8048ceb: e8 10 fb ff ff call 8048800 <malloc@plt> 8048cf0: 89 c7...

  • NOTE: explain the lines in comments for better understanding Write an assembly program (for x86 processors...

    NOTE: explain the lines in comments for better understanding Write an assembly program (for x86 processors - Irvine) that has two procedures, a main procedure and a procedure called Fib. The fib procedure is to uses a loop to calculate and printout the first N Fibonacci numbers. Fibonacci sequence is described by the following formula: Fib(1) = 1, Fib(2) = 1, Fib(n) = Fib(n – 1) + Fib(n – 2). The value of N is to be communicated to this...

  • MASM Assembly Language programming question. I'm having serious issues. I am attempting to scan through a...

    MASM Assembly Language programming question. I'm having serious issues. I am attempting to scan through a string and replace all the "o" characters with an exclamation mark (!). However my program does not work and no change seems to occur to the string. Also the loop breaks once the first "o" character is encountered.Is there anyone in this Universe that can help me???Please main PROC    ;mov edi,OFFSET string    mov ecx, LENGTHOF string    mov edi,OFFSET string    L1:...

  • In Nasm: In the following code what it's needed to sort the array in ascending order:...

    In Nasm: In the following code what it's needed to sort the array in ascending order: ;;;;;;;;;;;;;;;;;;;;   MACRO DEFINITIONS   ;;;;;;;;;;;;;;;;;;;; ; A macro with two parameters ; Implements the write system call    %macro writestring 2        mov eax, 4 ;sys_write system call number        mov ebx, 1 ;file descriptor std_out        mov ecx, %1 ;message to write from parameter 1        mov edx, %2 ;message length from parameter 2        int 0x80    %endmacro...

  • Assembly language. You can see the question in blue box. Loop Instruction Problem 4: Write and...

    Assembly language. You can see the question in blue box. Loop Instruction Problem 4: Write and run a program and answer the questions in the box. .data temp dword? First, build and run the program .code - Trace ECX value mov eax,0 ECX=? mov ecx, 10 ; outer loop counter - EAX =? L1: Second: If we removed mov ecx, temp mov eax, 3 What will happen? mov temp.ecx mov ecx,5 ; inner loop counter - build and run the...

  • Question#1 Write a short program demonstrating that the INC and DEC instructions do not affect the...

    Question#1 Write a short program demonstrating that the INC and DEC instructions do not affect the Carry flag. Question#2 Write a program that uses addition and subtraction to set and clear the Overflow flag. After each addition or subtraction, insert the call DumpRegs statement to display the registers and flags. Make sure to include an ADD instruction that sets both the Carry and Overflow flags. Using comments, explain how and why the Overflow flag was affected by each instruction. Question#3...

  • Write a program that turns a 32-bit numeric value (e.g., 0xFFFFh) and converts it to a...

    Write a program that turns a 32-bit numeric value (e.g., 0xFFFFh) and converts it to a byte array such that it can be printed to the screen using a system call method. A loop is necessary for converting the numeric value to ASCII for output. Again, use a system call (e.g., int 80h) to print the value to the console. Calling external functions (e.g. printf) is not allowed. You may use the starter file attached to this assignment. PLEASE WRITE...

  • I need help with a code in assembly language MASM (x86)

    write an assembly language (x86) program to input in a string 10 multi-digit integers and displays them in ascending order. Modify the code below to comply with the requirement..model small.stack 100h.datastrg1 DB 'Insert numbers: $'strg2 DB 'Sorted numbers: $'Arr Db 10 dup(?)v dw ?.codemain procmov ax,@datamov ds,axmov ah,9lea dx,strg1int 21hmov dl,0ahmov ah,2int 21h;inputsmov di,0mov cx,10Input_loop:mov ah,1int 21hmov arr[di],almov dl,0ahmov ah,2int 21hinc diloop Input_loopmov v,0sort:mov di,0mov cx,10sub cx,vB:mov al,Arr[di]cmp al,Arr[di+1]jng Cmov al,Arr[di]xchg al,Arr[di+1]mov Arr[di],alc:inc diloop Binc vcmp v,10jne sort;Outputmov ah,9lea dx,strg2int...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT