【正文】
棧:堆棧是一個(gè)區(qū)域 是用來存放數(shù)據(jù)的 這個(gè)區(qū)域本身沒有任何特殊之處 就是內(nèi)部RAM 的一部份 特殊的是它存放和取用數(shù)據(jù)的方式 即所謂的‘先進(jìn)后出 后進(jìn)先出’ 并且堆棧有特殊的數(shù)據(jù)傳輸指令 即‘PUSH’和‘POP’ 有一個(gè)特殊的專為其服務(wù)的單元 即堆棧指針 SP 每當(dāng)執(zhí)一次 PUSH 指令時(shí) SP 就 在原來值的基礎(chǔ)上 自動(dòng)加 1 每當(dāng)執(zhí)行一次 POP指令 SP 就 在原來值的基礎(chǔ)上自動(dòng)減 1。一般程序的開頭總有這么一條設(shè)置堆棧指針的指令 因?yàn)殚_機(jī)時(shí) SP 的初始值為 07H 這樣就使堆棧從 08H 單元開始往后 而 08H 到 1FH 這個(gè)區(qū)域正是 8031 的第二、三、四工作寄存器區(qū)經(jīng)常要被使用 這會(huì)造成數(shù)據(jù)的混亂。當(dāng)設(shè)置好堆棧區(qū)后 并不意味著該區(qū)域成為一種專用內(nèi)存它還是可以象普通內(nèi)存區(qū)域一樣使用只是一般情況下編程者不會(huì)把它當(dāng)成普通內(nèi)存用了中原工學(xué)院信息商務(wù)學(xué)院7MicroprocessorAre 8bit microcontroller early or4 bits. One of the most successful is the INTEL 8031, for a simple, reliable and good performance was a lot of praise. Then developed in 8031 out of MCS51 MCU Systems. A SCM system based on this system until now is still widely used. With the increased requirements of industrial control field, began a 16bit microcontroller, because the cost is not satisfactory but have not been very widely used. After 90 years with the great development of consumer electronics, microcontroller technology has been a huge increase. With INTEL i960 series, especially the later series of widely used ARM, 32bit microcontroller quickly replace highend 16bit MCU status and enter the mainstream market. The traditional 8bit microcontroller performance has been the rapid increase capacity increase pared to 80 the number of times. Currently, highend 32bit microcontroller clocked over 300MHz, the performance catching the mid9039。sZ80 is the first designed in accordance with this idea processor, then on the development of microcontroller and dedicated processors have parted ways. SCM is more suitable than the specific processor used in embedded systems, so it was up to the application. In fact the number of SCM is the world39。s with the United States developed 74 series, or the 6039。s with a series of successful SCM market, the result will be a drastic change! Just because you are prepared by microputer programs can achieve high intelligence, high efficiency and high reliability! As the microcontroller on the costsensitive, so now the dominant software or the lowest level assembly language, which is the lowest level in addition to more than binary machine code language, and as so low why is the use? Many highlevel language has reached the level of visual programming Why is not it? The reason is simply that there is no home puter as a single chip CPU, not as hard as a mass storage visualization of small highlevel language program which even if only one button, will reach tens of K of size! For the home PC39。s responsibility inevitably falls on electrical, electronics manufacturers. From this point of view, Intel faded MCU development has its objective factors. In the development of MCU, the most famous manufacturers as the number of Philips Corporation. Philips pany in embedded applications, its great advantage, the MCS51 singlechip microputer from the rapid development of the microcontroller. Therefore, when we look back at 中原工學(xué)院信息商務(wù)學(xué)院10the path of development of embedded systems, do not fet Intel and Philips in History. Embedded system microcontroller is an independent development path, the MCU important factor in the development stage, is seeking applications to maximize the solution on the chip。 the connection does not bee a problem because the device is a serial relationship between the general, the device is not much connection between the, but the puter is not the same circuit, it is a microprocessor core, the device must be connected with the 中原工學(xué)院信息商務(wù)學(xué)院12microprocessor, the device must be coordination between, so they need to connect on a lot, as if still analog circuit like the microprocessor and devices in the connection between the individual, the number of lines will be a little more surprising, therefore the introduction of the microprocessor bus in Each device together access connections, all devices 8 data line all received eight public online, that is the equivalent of all devices together in parallel, but only this does not work, if there are two devices send data at the same time, one of “0”, one of “1’, then, whether the receiver received what is it? This situation is not allowed, so to be controlled by controlling the line, timesharing the device to work at any time only one device to send data (which can have multiple devices to receive both). Device39。0 39。139。not as a generalpurpose I / O port use39。no39。not39。s instructions, and when the MCU execution to the instruction, the also make into a high, but users will not do so 中原工學(xué)院信息商務(wù)學(xué)院13because this is usually will cause the system to collapse.4. The program39。, the process is always from the 000039。this unit, and in 0000 39。advanced post out backward first out 39。 PUSH 39。 POP 39。s habit. When set up the stack zone, does not mean that the region bee a special memory, it can still use the same memory region as normal, but generally the programmer does not regard it as an ordinary memory used. 中原工學(xué)院信息商務(wù)學(xué)院14教師評(píng)語教師簽名:20 年 月 日