Social Icons

twitterfacebookgoogle plusrss feedemail

1/02/2010

微處理機(8051)第一次上機題目第二題 memory-move

沒有留言:
2.Write a program to process data stored in the external code memory from 1000H to 104FH. The rule of the processing is as follows :
甲、 If the data is even, copy it to external data memory started from 2000H.
乙、 If the data is odd, copy it to on-chip memory started from 40H.
丙、 Find out how many odd numbers and how many even numbers during the processing. Stored the number of odd numbers in A and the number of even numbers in B.

這題是老師第一次上機測驗時,發給我們的題目第二題。

老師在上次上課中有把答案寫出來放在BB
不過我用Keil uVision3 跑過一次之後發現出了點問題
下面程式碼是經過我修改之後
內容跟原本差異不大
主要也是指令用錯的問題
大家可以看看