版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、<p><b> 外文原文:</b></p><p> monolithic integrated circuit composition</p><p> Monolithic confidential automatically completes the computation, which should it have most importa
2、nt part?</p><p> We take operate an abacus as the example computation together arithmetic topic. Example: 36 + 163¡Á156 - 166¡Â34. Now must carry on the operation, first needs an abacus,
3、 next is the paper and the pen. We the question which must calculate record, then first step calculates first 163¡Á156, with the result which 36 adds together records it on the paper, then the computation 166
4、161;Â34, then subtracts it from the previous result, obtains the final result.</p><p> Now, we use the monolithic integrated circuit to complete the above process, obviously, it first must have replace
5、s the abacus to carry on the operation the part, this is "the logic unit"; Next, must have can play to the paper and the pen role component, namely can remember the primitive topic, the primary data and the int
6、ermediate result, but also must remember causes the monolithic function automatically to carry on each kind of order which the operation but establishes. This kind of component</p><p> Like on in example, w
7、hen when computation 163¡Á156, the numeral 36 cannot at the same time enter the logic unit. Therefore needs to establish on the monolithic integrated circuit according to the controller order carries on the mov
8、ement "the gate", when the logic unit needs, lets the recent data enter. Or, when the logic unit obtains the final output, again this result output, but the intermediate result cannot be casual "slips away
9、" the monolithic integrated circuit. This kind to inputs, the ou</p><p> The user wants each kind of order which the monolithic integrated circuit carries out (procedure) also by the data form by the m
10、emory to send in the controller, (decoding) becomes each kind of control signal after controller ½â¶Á, in order to carries out like adds, reduces, while, eliminates and so on function each kind of ord
11、er. Therefore, this kind of information is called the control command, namely controls the logic unit by the controller one to carry on the operation and processing step by</p><p> The memory divides into t
12、he read-only memory and the read-write memory two kinds, former depositing debugs the fixed routine and the constant, latter deposits some to have the data as necessary which the possibility changes. As the name suggests
13、, the read-only memory once stores the data, only can read out, cannot change (EPROM, E2PROM of the same kind ROM may change, read in data - editor through certain method to pour). But the read-write memory may store or
14、the readout as necessary.</p><p> In fact, the people often are called the logic unit and the controller merge central processing element - CPU. The monolithic integrated circuit besides carries on the oper
15、ation, but also must complete the control function. Therefore cannot leave counts with fixed time. Therefore, has the timer concurrently counter in the monolithic integrated circuit on the establishment, its basic struct
16、ure with this serializes (2) center to give an example to be similar. To here up to, we had already known th</p><p> Now, we already had known the monolithic integrated circuit composition, how -odd under q
17、uestion was connects theirs each part the interdependence the whole? In fact, the monolithic integrated circuit interior has to connect them "the link", namely so-called "internal main line". This mai
18、n line has like the big city "the yang or male principle", but CPU, ROM, RAM, I/O, the interruption system and so on distributes in this "the main line" both sides, and connect with it. Thus, all inst
19、ructions, t</p><p> Second section monolithic integrated circuit command system and assembly language procedure</p><p> Front already narrated the monolithic integrated circuit several main co
20、nstituent, these parts constituted the monolithic integrated circuit hardware. The so-called hardware (Hardware), is looks obtains, traces entity which obtains. But, the light has such hardware, but also only had the rea
21、lization computation and the control function possibility. Monolithic confidential can carry on the computation and the control truly, but also must have the software (Software) coordination. The software mai</p>
22、<p> First step: (Location) center takes out the first number from its storage unit, delivers to the logic unit. Second step: In the storage unit which is at from it takes out the second integer, delivers to the lo
23、gic unit; Third step: Adds together; Fourth step: Result which adds together, delivers unit which assigns to the memory in.</p><p> All these fetching, delivers the number, adds together, the balance and so
24、 on all is one kind of operation (Operation), we request each kind which the computer carries out to hold the function order the form to write down, this is an instruction. How but can distinguish and carry out these ope
25、rations? This is by designs the personnel in the design monolithic machine-hour to entrust with its command system to decide. An instruction, is corresponding one kind of elementary operation eo; The monoli</p>&l
26、t;p> Uses the monolithic machine-hour, beforehand must the question which must solve form a series of instructions. These instructions must be the designation monolithic function recognition and the execution instruc
27、tion. The monolithic integrated circuit user for solves the instruction procedure which own question arranges, is called the source program (Source Program). The instruction usually divides into the operation code (Opcod
28、e) and the operand (Operand) two major parts. The operation code expr</p><p> The MCS - 51 monolithic integrated circuits word lengths are 8, sometimes, had to complete certain holds affects a byte still no
29、t to be able fully to express. Therefore, has the single byte instruction in the command system, also has the multi- bytes instruction. The machine code is by a succession of 0 and 1 is composed, does not have the obviou
30、s characteristic, not the good memory, is not easy to understand, is easy to make a mistake. Therefore, straight takes over the use of it to compile the</p><p> Third section MCU--51 CPU and memory</p>
31、;<p> Monolithic integrated circuit 8,051 CPU is composed by the logic unit and the controller.</p><p> First, logic unit </p><p> The logic unit by completes binary the arithmeti
32、c/Logic operation part ALU is a core, in addition temporary storage device TMP, accumulator ACC, register B, program state symbol register PSW and Boolean processor. Accumulator ACC is eight registers, it is in CPU works
33、 the most frequent register. When carries on the arithmetic, the logic operation, accumulator ACC often temporarily stores before the operation an operand (for example addend), after but operates preserves its result (fo
34、r example al</p><p> 1 ¡õbenzene ¡õposition sign CY (PSW ¡õ¡õ7). It expressed operates whether has carries (or borrows). If the operating result has in the highest or
35、der carries (addition) or borrows (subtraction), then this is 1, otherwise is 0.</p><p> 2 ¡õprepares ¨Ö ¡õcarries symbolizes AC. Also called partly carries the symbol, it had
36、reflected two eight-digit numbers operate low four whether has partly carries, namely low four add together (either reduces) whether or not carries (or borrows), like has then AC is 1 condition, otherwise is 0.</p>
37、<p> 3 ¡õcoins red soft hail afterglow of the setting sun chronic illness ¡õOV. Whether the MCS - 51 reflections belts sign digit operation result does have the overflow, when has the overflow
38、, this is 1, otherwise is 0.</p><p> 4 ¡õcompels æÅ anxious afterglow of the setting sun ¡õP. Reflects the accumulator ACC content the odevity, if in the ACC operation result h
39、as even number 1 (for example 11001100B, including 4 1), then P is 0, otherwise, P=1.</p><p> PSW other, again introduced in later. Because in PSW depositing procedure execution condition, therefore is call
40、ed the program status word?In the logic unit also has (bit) to carry on the logic operation according to the position the logical processor (to call Boolean processor). Its function when introduction position instruction
41、 again explained.</p><p> Second, controller</p><p> The controller is the CPU nerve center, it including timed control logic circuit, instruction register, decoder, address indicator DPTR and
42、 program counter PC, storehouse indicator SP and so on. Here program counter PC is a counter which constitutes by 16 registers. Wants the monolithic integrated circuit to carry out a procedure, must load in advance this
43、procedure according to the order memory ROM some region. When monolithic integrated circuit movement should take out the instruction accordin</p><p> Third, memory</p><p> The memory was a mon
44、olithic integrated circuit important constituent, chart 6 has produced one kind of storage capacity is 256 units memory structure schematic drawings. Each memory cell corresponds an address, 256 units altogether have 256
45、 addresses, 16 enters the system number with two to indicate, namely memory address (00H ~ FFH). In the memory each memory cell may store eight binary messages, passes commonly used two 16 to enter the system number to i
46、ndicate, this is the memory content. The</p><p> 1st, program memory</p><p> The procedure is control computer movement a series of orders, the monolithic integrated circuit only knew constitu
47、tes the machine instruction by "0" and "1" the code. Like forecited with helps records the symbol compilation order MOV A, # 20H, changes into code 74H, 20H which the machine knew: (Wrote binary syste
48、m is 01110100B and 00100000B). After monolithic integrated circuit processing question will have beforehand to compose the procedure, the form, the constant will collect the forming mac</p><p> data-carrier
49、 storage</p><p> The monolithic integrated circuit data-carrier storage is composed by read-write memory RAM. Its maximum capacity may expand to 64k, uses in saving the real-time input the data. 8,051 inter
50、ior have 256 units internal data-carrier storages, 00H ~ 7FH is internal stochastic memory RAM, 80H ~ FFH is the special-purpose register area. When actual use should first fully use the internal memory, says from the us
51、e angle, clarifies internal data-carrier storage the structure and the allocation is extrem</p><p> 3rd, special function register</p><p> Special function register (SFR) the address range is
52、80H ~ FFH. In MCS - in 51, besides program counter PC and four working register area, other 21 special functions register all in this SFR block. 5 are the pair of byte registers, they have altogether taken 26 bytes. Each
53、 special function register mark and address ¼û¸½±í 2. Belt * number may the position addressing. The special function register had reflected 8,051 conditions, are in fact 8,051 conditions ch
54、aracters and the control word registe</p><p><b> 外文翻譯:</b></p><p><b> 單片機的組成</b></p><p> 單片機要自動完成計算,它應(yīng)該具有哪些最重要的部分呢?</p><p> 我們以打算盤為例計算一道算術(shù)題。
55、例:36+163×156-166÷34?,F(xiàn)在要進行運算,首先需要一把算盤,其次是紙和筆。我們把要計算的問題記錄下來,然后第一步先算163×156,把它與36相加的結(jié)果記在紙上,然后計算166÷34,再把它從上一次結(jié)果中減去,就得到最后的結(jié)果。</p><p> 現(xiàn)在,我們用單片機來完成上述過程,顯然,它首先要有代替算盤進行運算的部件,這就是“運算器”;其次,要有能起到紙和
56、筆作用的器件,即能記憶原始題目、原始數(shù)據(jù)和中間結(jié)果,還要記住使單片機能自動進行運算而編制的各種命令。這類器件就稱為“存貯器”。此外,還需要有能代替人作用的控制器,它能根據(jù)事先給定的命令發(fā)出各種控制信號,使整個計算過程能一步步地進行。但是光有這三部分還不夠,原始的數(shù)據(jù)與命令要輸入,計算的結(jié)果要輸出,都需要按先后順序進行,有時還需等待。</p><p> 如上例中,當(dāng)在計算163×156時,數(shù)字36就不能
57、同時進入運算器。因此就需要在單片機上設(shè)置按控制器的命令進行動作的“門”,當(dāng)運算器需要時,就讓新數(shù)據(jù)進入。或者,當(dāng)運算器得到最后結(jié)果時,再將此結(jié)果輸出,而中間結(jié)果不能隨便“溜出”單片機。這種對輸入、輸出數(shù)據(jù)進行一定管理的“門”電路在單片機中稱為“口”(Port)。在單片機中,基本上有三類信息在流動,一類是數(shù)據(jù),即各種原始數(shù)據(jù)(如上例中的36、163等)、中間結(jié)果(如166÷34所得的商4、余數(shù)30等)、程序(命令的集合)等。這樣
58、要由外部設(shè)備通過“口”進入單片機,再存放在存貯器中,在運算處理過程中,數(shù)據(jù)從存貯器讀入運算器進行運算,運算的中間結(jié)果要存入存貯器中,或最后由運算器經(jīng)“出入口”輸出。</p><p> 用戶要單片機執(zhí)行的各種命令(程序)也以數(shù)據(jù)的形式由存貯器送入控制器,由控制器解讀(譯碼)后變?yōu)楦鞣N控制信號,以便執(zhí)行如加、減、乘、除等功能的各種命令。所以,這一類信息就稱為控制命令,即由控制器去控制運算器一步步地進行運算和處理,又
59、控制存貯器的讀(取出數(shù)據(jù))和寫(存入數(shù)據(jù))等。第三類信息是地址信息,其作用是告訴運算器和控制器在何處去取命令取數(shù)據(jù),將結(jié)果存放到什么地方,通過哪個口輸入和輸出信息等。</p><p> 存貯器又分為只讀存貯器和讀寫存貯器兩種,前者存放調(diào)試好的固定程序和常數(shù),后者存放一些隨時有可能變動的數(shù)據(jù)。顧名思義,只讀存貯器一旦將數(shù)據(jù)存入,就只能讀出,不能更改(EPROM、E2PROM等類型的ROM可通過一定的方法來更改、寫
60、入數(shù)據(jù)——編者注)。而讀寫存貯器可隨時存入或讀出數(shù)據(jù)。</p><p> 實際上,人們往往把運算器和控制器合并稱為中央處理單元——CPU。單片機除了進行運算外,還要完成控制功能。所以離不開計數(shù)和定時。因此,在單片機中就設(shè)置有定時器兼計數(shù)器,其基本結(jié)構(gòu)與本連載之(二)中的舉例類似。到這里為止,我們已經(jīng)知道了單片機的基本組成,即單片機是由中央處理器(即CPU中的運算器和控制器)、只讀存貯器(通常表示為ROM)、讀寫
61、存貯器(又稱隨機存貯器通常表示為RAM)、輸入/輸出口(又分為并行口和串行口,表示為I/O口)等等組成。實際上單片機里面還有一個時鐘電路,使單片機在進行運算和控制時,都能有節(jié)奏地進行。另外,還有所謂的“中斷系統(tǒng)”,這個系統(tǒng)有“傳達室”的作用,當(dāng)單片機控制對象的參數(shù)到達某個需要加以干預(yù)的狀態(tài)時,就可經(jīng)此“傳達室”通報給CPU,使CPU根據(jù)外部事態(tài)的輕重緩急來采取適當(dāng)?shù)膽?yīng)付措施。</p><p> 現(xiàn)在,我們已經(jīng)知
62、道了單片機的組成,余下的問題是如何將它們的各部分連接成相互關(guān)聯(lián)的整體呢?實際上,單片機內(nèi)部有一條將它們連接起來的“紐帶”,即所謂的“內(nèi)部總線”。此總線有如大城市的“干道”,而CPU、ROM、RAM、I/O口、中斷系統(tǒng)等就分布在此“總線”的兩旁,并和它連通。從而,一切指令、數(shù)據(jù)都可經(jīng)內(nèi)部總線傳送,有如大城市內(nèi)各種物品的傳送都經(jīng)過干道進行?!?lt;/p><p> 單片機指令系統(tǒng)與匯編語言程序</p>&
63、lt;p> 前面已經(jīng)講述了單片機的幾個主要組成部分,這些部分構(gòu)成了單片機的硬件。所謂硬件(Hardware),就是看得到,摸得到的實體。但是,光有這樣的硬件,還只是有了實現(xiàn)計算和控制功能的可能性。單片機要真正地能進行計算和控制,還必須有軟件(Software)的配合。軟件主要指的是各種程序。只有將各種正確的程序“灌入”(存入)單片機,它才能有效地工作。單片機所以能自動地進行運算和控制,正是由于人把實現(xiàn)計算和控制的步驟一步步地用命
64、令的形式,即一條條指令(Instruction)預(yù)先存入到存貯器中,單片機在CPU的控制下,將指令一條條地取出來,并加以翻譯和執(zhí)行。就以兩個數(shù)相加這一簡單的運算來說,當(dāng)需要運算的數(shù)已存入存貯器后,還需要進行以下幾步: 第一步:把第一個數(shù)從它的存貯單元(Location)中取出來,送至運算器?! ?第二步:把第二個數(shù)從它所在的存貯單元中取出來,送至運算器; 第三步:相加; 第四步:把相加完的結(jié)果,送至存貯器中指定的單元。</p&
65、gt;<p> 所有這些取數(shù)、送數(shù)、相加、存數(shù)等等都是一種操作(Operation),我們把要求計算機執(zhí)行的各種操作用命令的形式寫下來,這就是指令。但是怎樣才能辨別和執(zhí)行這些操作呢?這是在設(shè)計單片機時由設(shè)計人員賦予它的指令系統(tǒng)所決定的。一條指令,對應(yīng)著一種基本操作;單片機所能執(zhí)行的全部指令,就是該單片機的指令系統(tǒng)(Iustruction Set),不同種類的單片機,其指令系統(tǒng)亦不同?! ∈褂脝纹瑱C時,事先應(yīng)當(dāng)把要解決的
66、問題編成一系列指令。這些指令必須是選定的單片機能識別和執(zhí)行的指令。單片機用戶為解決自己的問題所編的指令程序,稱為源程序(Source Program)。指令通常分為操作碼(Opcode)和操作數(shù)(Operand)兩大部分。操作碼表示計算機執(zhí)行什么操作,即指令的功能;操作數(shù)表示參加操作的數(shù)或操作數(shù)所在的地址(即操作數(shù)所存放的地方編號)。因為單片機是一種可編程器件,只“認得”二進碼(0、1)。要單片機運作,單片機系統(tǒng)中的所有指令,都必須以二
67、進制編碼的形式來表示。例如,在Intel公司的MCS-51系列單片機中,從存貯器中取出一數(shù)到CPU中的累加器(在運算器中,參與運算、存放運算結(jié)果的專用寄</p><p> MCS-51單片機的字長為8位,有時,要完成某些操作用一個字節(jié)尚不能充分表達。所以,在指令系統(tǒng)中有單字節(jié)指令,也有多字節(jié)指令。機器碼是由一連串的0和1組成,沒有明顯的特征,不好記憶,不易理解,易出錯。所以,直接用它來編寫程序十分困難。因而,人
68、們就用一些助記符(Mue monic)——通常是指令功能的英文縮寫來代替操作碼,如MCS-51中數(shù)的傳送常用MOV(Move的縮寫)、加法用Add(Addition的縮寫)來作為助記符。這樣,每條指令有明顯的動作特征,易于記憶和理解,也不容易出錯。用助記符來編寫的程序稱為匯編語言程序。但是,助記符編寫的程序便于人理解,可單片機卻只認識二進制機器代碼,因此,為了讓單片機能“讀懂”匯編語言程序必須再轉(zhuǎn)換成由二進制機器碼構(gòu)成的程序,這種轉(zhuǎn)換過
69、程,就稱為“匯編”。匯編可借助于人工查表法來實現(xiàn),也可借助PC機通過所謂“交叉匯編程序”來完成。由機器碼構(gòu)成的用戶程序一旦“進入”了單片機,再“啟動”單片機,就可讓它執(zhí)行輸入程序所規(guī)定的任務(wù)。</p><p> MCU--51 CPU和存儲器</p><p> 單片機8051的CPU由運算器和控制器組成。</p><p> 一.運算器 </p&
70、gt;<p> 運算器以完成二進制的算術(shù)/邏輯運算部件ALU為核心,再加上暫存器TMP、累加器ACC、寄存器B、程序狀態(tài)標(biāo)志寄存器PSW及布爾處理器。累加器ACC是一個八位寄存器,它是CPU中工作最頻繁的寄存器。在進行算術(shù)、邏輯運算時,累加器ACC往往在運算前暫存一個操作數(shù)(如被加數(shù)),而運算后又保存其結(jié)果(如代數(shù)和)。寄存器B主要用于乘法和除法操作。標(biāo)志寄存器PSW也是一個八位寄存器,用來存放運算結(jié)果的一些特征,如有無
71、進位、借位等。其每位的具體含意如下所示。PSW CY AC FO RS1 RS0 OV - P對用戶來講,最關(guān)心的是以下四位。</p><p> 1進位標(biāo)志CY(PSW7)。它表示了運算是否有進位(或借位)。如果操作結(jié)果在最高位有進位(加法)或者借位(減法),則該位為1,否則為0。</p><p> 2輔助進位標(biāo)志AC。又稱半進位標(biāo)志,它反映了兩個八位數(shù)運算低四位是否有半進位,即
72、低四位相加(或減)有否進位(或借位),如有則AC為1狀態(tài),否則為0。</p><p> 3溢出標(biāo)志位OV。MCS-51反映帶符號數(shù)的運算結(jié)果是否有溢出,有溢出時,此位為1,否則為0。</p><p> 4奇偶標(biāo)志P。反映累加器ACC內(nèi)容的奇偶性,如果ACC中的運算結(jié)果有偶數(shù)個1(如11001100B,其中有4個1),則P為0,否則,P=1。PSW的其它位,將在以后再介紹。由于PS
73、W存放程序執(zhí)行中的狀態(tài),故又叫程序狀態(tài)字?運算器中還有一個按位(bit)進行邏輯運算的邏輯處理機(又稱布爾處理機)。其功能在介紹位指令時再說明。</p><p><b> 二、控制器</b></p><p> 控制器是CPU的神經(jīng)中樞,它包括定時控制邏輯電路、指令寄存器、譯碼器、地址指針DPTR及程序計數(shù)器PC、堆棧指針SP等。這里程序計數(shù)器PC是由16位寄存器構(gòu)
74、成的計數(shù)器。要單片機執(zhí)行一個程序,就必須把該程序按順序預(yù)先裝入存儲器ROM的某個區(qū)域。單片機動作時應(yīng)按順序一條條取出指令來加以執(zhí)行。因此,必須有一個電路能找出指令所在的單元地址,該電路就是程序計數(shù)器PC。當(dāng)單片機開始執(zhí)行程序時,給PC裝入第一條指令所在地址,它每取出一條指令(如為多字節(jié)指令,則每取出一個指令字節(jié)),PC的內(nèi)容就自動加1,以指向下一條指令的地址,使指令能順序執(zhí)行。只有當(dāng)程序遇到轉(zhuǎn)移指令、子程序調(diào)用指令,或遇到中斷時(后面將
75、介紹),PC才轉(zhuǎn)到所需要的地方去。8051 CPU碢C指定的地址,從ROM相應(yīng)單元中取出指令字節(jié)放在指令寄存器中寄存,然后,指令寄存器中的指令代碼被譯碼器譯成各種形式的控制信號,這些信號與單片機時鐘振蕩器產(chǎn)生的時鐘脈沖在定時與控制電路中相結(jié)合,形成按一定時間節(jié)拍變化的電平和時鐘,即所謂控制信息,在CPU內(nèi)部協(xié)調(diào)寄存器之間的數(shù)據(jù)傳輸、運算等操作。</p><p><b> 三、存儲器</b>
76、</p><p> 存儲器是單片機的又一個重要組成部分,圖6給出了一種存儲容量為256個單元的存儲器結(jié)構(gòu)示意圖。其中每個存儲單元對應(yīng)一個地址,256個單元共有256個地址,用兩位16進制數(shù)表示,即存儲器的地址(00H~FFH)。存儲器中每個存儲單元可存放一個八位二進制信息,通常用兩位16進制數(shù)來表示,這就是存儲器的內(nèi)容。存儲器的存儲單元地址和存儲單元的內(nèi)容是不同的兩個概念,不能混淆。</p>&l
77、t;p> 1、程序存儲器 程序是控制計算機動作的一系列命令,單片機只認識由“0”和“1”代碼構(gòu)成的機器指令。如前述用助記符編寫的命令MOV A,#20H,換成機器認識的代碼74H、20H:(寫成二進制就是01110100B和00100000B)。在單片機處理問題之前必須事先將編好的程序、表格、常數(shù)匯編成機器代碼后存入單片機的存儲器中,該存儲器稱為程序存儲器。程序存儲器可以放在片內(nèi)或片外,亦可片內(nèi)片外同時設(shè)置。由于PC程序計數(shù)
78、器為16位,使得程序存儲器可用16位二進制地址,因此,內(nèi)外存儲器的地址最大可從0000H到FFFFH。8051內(nèi)部有4k字節(jié)的ROM,就占用了由0000H~0FFFH的最低4k個字節(jié),這時片外擴充的程序存儲器地址編號應(yīng)由1000H開始,如果將8051當(dāng)做8031使用,不想利用片內(nèi)4kROM,全用片外存儲器,則地址編號仍可由0000H開始。不過,這時應(yīng)使8051的第{31}腳(即EA腳)保持低電平。當(dāng)EA為高電平時,用戶在0000H至0F
79、FFH范圍內(nèi)使用內(nèi)部ROM,大于0FFFH后,單片機CPU自動訪問外部程序存儲器。</p><p><b> 2、數(shù)據(jù)存儲器</b></p><p> 單片機的數(shù)據(jù)存儲器由讀寫存儲器RAM組成。其最大容量可擴展到64k,用于存儲實時輸入的數(shù)據(jù)。8051內(nèi)部有256個單元的內(nèi)部數(shù)據(jù)存儲器,其中00H~7FH為內(nèi)部隨機存儲器RAM,80H~FFH為專用寄存器區(qū)。實際使
80、用時應(yīng)首先充分利用內(nèi)部存儲器,從使用角度講,搞清內(nèi)部數(shù)據(jù)存儲器的結(jié)構(gòu)和地址分配是十分重要的。因為將來在學(xué)習(xí)指令系統(tǒng)和程序設(shè)計時會經(jīng)常用到它們。8051內(nèi)部數(shù)據(jù)存儲器地址由00H至FFH共有256個字節(jié)的地址空間,該空間被分為兩部分,其中內(nèi)部數(shù)據(jù)RAM的地址為00H~7FH(即0~127)。而用做特殊功能寄存器的地址為80H~FFH。在此256個字節(jié)中,還開辟有一個所謂“位地址”區(qū),該區(qū)域內(nèi)不但可按字節(jié)尋址,還可按“位(bit)”尋址。對
81、于那些需要進行位操作的數(shù)據(jù),可以存放到這個區(qū)域。從00H到1FH安排了四組工作寄存器,每組占用8個RAM字節(jié),記為R0~R7。究竟選用那一組寄存器,由前述標(biāo)志寄存器中的RS1和RS0來選用。在這兩位上放入不同的二進制數(shù),即可選用不同的寄存器組,如附表1所示。</p><p><b> 3、特殊功能寄存器</b></p><p> 特殊功能寄存器(SFR)的地址范圍
82、為80H~FFH。在MCS-51中,除程序計數(shù)器PC和四個工作寄存器區(qū)外,其余21個特殊功能寄存器都在這SFR塊中。其中5個是雙字節(jié)寄存器,它們共占用了26個字節(jié)。各特殊功能寄存器的符號和地址見附表2。其中帶*號的可位尋址。特殊功能寄存器反映了8051的狀態(tài),實際上是8051的狀態(tài)字及控制字寄存器。用于CPU PSW便是典型一例。這些特殊功能寄存器大體上分為兩類,一類與芯片的引腳有關(guān),另一類作片內(nèi)功能的控制用。與芯片引腳有關(guān)的特殊功能寄
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 眾賞文庫僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
評論
0/150
提交評論