Current location: Hot Scripts Forums » Programming Languages » Other Languages » How do I write a program in Assembly Language that displays four tables, n, 3n, 7n, and Fn?


How do I write a program in Assembly Language that displays four tables, n, 3n, 7n, and Fn?

Reply
  #1 (permalink)  
Old 03-28-10, 10:14 PM
Thesel Thesel is offline
New Member
 
Join Date: Mar 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
How do I write a program in Assembly Language that displays four tables, n, 3n, 7n, and Fn?

I've never really used Assembly language before and I have to write this program using emacs and to be tested with the LC-3. It has to more or less look like this:

************************************
***Welcome to the Program!***
************************************
n 3*n 7*n Fn
--- ----- ----- -----
0 0 0 0
1 3 7 1
2 6 14 1
3 9 21 2
4 12 28 3
... ... ... ...

and n needs to go all the way to 11 and so does the rest of the table. Fn is Fibonacci numbers that is F0=0, F1=1, and Fk = Fk-1 + Fk-2 for k>=2. The calculations must use previous results instead of just adding n+n+n+n so on and so forth. The program needs to be algorithmic on n. The only allowed check is to see if n exceeds 11. Do not use any variables at all.

I have no idea where to start, go from, or finish this thing, help on anything or even writing if for me would be greatly appreciated. Even if you don't write it for me maybe something similar to it that I can go off of. Thanks all
Reply With Quote
  #2 (permalink)  
Old 03-29-10, 06:18 AM
wirehopper's Avatar
wirehopper wirehopper is offline
-
 
Join Date: Feb 2006
Posts: 2,515
Thanks: 20
Thanked 109 Times in 106 Posts
You might want to talk with your instructor.
Reply With Quote
Reply

Bookmarks

Tags
assembly language, fibonacci, lc-3, table


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 03:47 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.