Sponsored Links


Results 1 to 2 of 2

Thread: CS401 Computer Architecture and Assembly Language Programming Last Date 11 Dec 2014

  1. #1
    Administrator Vuhelper's Avatar
    Join Date
    Apr 2011
    Posts
    9,578

    CS401 Computer Architecture and Assembly Language Programming Last Date 11 Dec 2014

    Sponsored Links1




    CS401 Computer Architecture and Assembly Language Programming No-1 Assignment Last Date 11 Dec 2014



    Computer Architecture and Assembly Language Programming (CS401) Assignment # 02 (Graded) December 11, 2014

    1) You should concern recommended books to clarify your concepts as handouts are not sufficient.

    2) You are supposed to submit your assignment in .doc format. Any other formats like scan images, PDF, zip, rar, bmp etc will not be accepted.



    Topic Covered:

    Branching Techniques.
    Bit Manipulation.
    Subroutines.


    Question Statement:



    Write a complete assembly language code having two subroutines:

    One will be named as Fibonacci_series used to generate a Fibonacci series of first 10 elements.
    Second will be named as Fibonacci_sum and will find the sum of all elements in a generated Fibonacci series/array.


    Hint: Make a series/array named as Fibonacci_array and a lable named as fib_sum.

    Fibonacci_array will contain the generated Fibonacci sequence elements, while fib_sum is used to store the sum of an array (Fibonacci array).

    Sponsored Links



    You can define Fibonacci array as:



    Fibonacci_array: DW 0 1

    Fib_sum = Fibonacci (0) + Fibonacci (1) + … + Fibonacci (10).



    Fibonacci function is defined as follows:

    Fibonacci (0) = 0

    Fibonacci (1) = 1

    Fibonacci (n) = Fibonacci (n-1) + Fibonacci (n-2)



    You have to calculate till Fibonacci (10).



    You have to attach a final snapshot of your debugger showing the Fibonacci series and Fibonacci sum in Data segment (DS)

  2. #2
    Administrator Vuhelper's Avatar
    Join Date
    Apr 2011
    Posts
    9,578
    e code given below will print 123456789 this is a loop
    global _start ;must be declared for using gcc
    _start: ;tell linker entry point
    mov ecx,10
    mov eax, '1'

    l1:
    mov [num], eax
    mov eax, 4
    mov ebx, 1
    push ecx
    mov ecx, num
    mov edx, 1
    int 0x80
    mov eax, [num]
    sub eax, '0'
    inc eax
    add eax, '0'
    pop ecx
    loop l1
    mov eax,1 ;system call number (sys_exit)
    int 0x80 ;call kernel
    section .bss
    num resb 1

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 11-27-2014, 03:01 PM
  2. Replies: 1
    Last Post: 11-24-2014, 02:31 PM
  3. Replies: 0
    Last Post: 07-22-2014, 01:32 AM
  4. Replies: 0
    Last Post: 05-27-2014, 04:52 PM
  5. Replies: 2
    Last Post: 05-22-2014, 02:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
-: Vuhelp Disclaimer :-
None of the files shown here are hosted or transmitted by this server. The links are provided solely by this site's users. The administrator's or staff of Vuhelp.net cannot be held responsible for what its users post, or any other actions of its users. You may not use this site to distribute or download any material when you do not have the legal rights to do so. It is your own responsibility to adhere to these terms. If you have any doubts about legality of content or you have any suspicions, feel free to contact us.
Online Education | JhelumSoft