Social Icons

twitterfacebookgoogle plusrss feedemail

1/01/2010

微處理機(8051)上機考古題文章整理Arithmetic & data move

本文只整理出1到14題的連結

以下題目解答為我打的
程式寫法有很多種的,我的程式碼通常寫得比較長
有些比較複雜的地方我有寫註解
如有看不懂的歡迎留言詢問

另外
如果你從期中考到現在Keil uVision3都不會使用
那麼建議您請先會使用它跑程式之後,再來問
不然會造成許多人困擾
都還不會的,建議你先去Data Movement Practices先把裡面的東西搞懂之後
再來做下面的考古題
不然相信你看了我的程式碼,你也看不懂我在寫什麼

本文章題目版權歸屬於朱老師,另外本文所提供答案並不保證其正確性

如下
一.    資料移動題組DATA-MOVE
  1.    Move data from on-chip SRAM 36H- 73H to external data RAM 20F9H to 2136H. 


         觀看此題解答

2.    Move data from on-chip SRAM 20H-40H to 5AH-7AH in REVERSE order.  That is, (20H) move to (7AH), (21H) move to (70H),…., (3FH) move to (5BH), (40H) move to (5AH).
 

       觀看此題解答

3.    Move data from external data RAM 1234H-1285H to on-chip SRAM 22H -73H.
 

       觀看此題解答

4.    Move data from external code RAM 1234H-1285H to on-chip SRAM 22H -73H.  You can use following instructions to initialize code memory :
ORG 1234H
TABLE: DB 03, 56H, 01H,……
PS:external code RAM=ROM

        觀看此題解答

5.    Move data from external data RAM 1200H -1250H to external data RAM 2200H-2250H. 

       觀看此題解答

6.    Move data from external code RAM 1200H -1250H to external data RAM 2200H-2250H.  You may use hints in 4. to initialize code memory.PS:external code RAM=ROM

       觀看此題解答

7.    Move data from external data RAM 1000H-1FFFH by the following rules
甲、    If it is an even number, move to external data RAM starting from 2000H
乙、    If it is an odd number, move to external data RAM starting from 3000H.


        觀看此題解答

8.    Shuffle the data from external data RAM 1000H-13FFH and 1400H to 17FFH to 2000H-27FFH.  That is, move (1000)H to (2000H), (1400H) to (2001H), (1001H) to (2002H), (1401H) to (2003H), etc.

        觀看此題解答



二.    算術題組(Arithmetic)Use subroutines you prepared to
 

9.    Write a program to change a 2-byte BCD stored in 20H-21H into a 16-bit unsigned number at 30H-31H.  For example, if (20H)=38H, (21H)=59H, then (30H)=0FH, (31H)=13H.

        觀看此題解答


10.    Write a program to change a 16-bit unsigned number stored in 20H-21H into a 2-byte BCD at 30H-31H.  For example, if (20H)=0FH, (21H)=13H, then (30H)=38FH, (31H)=59H.  Assume the number stored in (20H-21H) is less than 10000 in decimal.

          觀看此題解答


11.    Write a program to perform the multiplication of a 2-byte BCD number stored in (20H-21H) and a one-byte BCD stored in 22H.  And put the result in BCD from at 
(30-32H).  For example, if (20H-21H)=7654H, (22H)=34H, then (30-32H)=260236H.

          觀看此題解答

12.    Write a program to perform the multiplication of a 32-bit unsigned number stored at (20-23H) and a 16-bit unsigned number stored at (24-25H) and put the result as a 48-bit unsigned number at (30-35H).  For example, if (20-23H)=98765432H and (24-25H)=1234H, then (30-35H)=0x0AD749F49E28H.


          觀看此題解答

13.    Let F(x)=x^3-2x+1.  Let x be a 16-bit unsigned number stored in (20-21H), use program to calculate this function and store the result in (30-35H).
 

          觀看此題解答

14.    Define a sequence that f(n+2)=f(n+1)+f(n).  Let f(0)=0 and f(1)=1 and n is a BCD number stored in 20H.  Please use program to calculate n from 0 to 30 and stored the result in BCD form at .(30-32H).  
注意此題目n範圍應修改為 0 to 28 。


          觀看此題解答



如果發現文章有錯誤,歡迎留言告知~謝謝指教!

沒有留言:

張貼留言

俗話說
凡走過必留下痕跡,凡住過必留下鄰居
凡爬過必留下樓梯,凡來過必留下IP
看過文章之後歡迎留下您寶貴的意見喔!

 
 
无觅相关文章插件,迅速提升网站流量