亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

蟲蟲首頁(yè)| 資源下載| 資源專輯| 精品軟件
登錄| 注冊(cè)

SECOND-Level

  • 水位監(jiān)測(cè)報(bào)警系統(tǒng)原理

    摘要:本水位監(jiān)測(cè)報(bào)警器使用5V低壓直流電源(也可以用3節(jié)5號(hào)電池代替)就可以對(duì)5~15厘米的水位進(jìn)行監(jiān)測(cè),用LED顯示和數(shù)碼管顯示水位,并可以對(duì)不再此范圍內(nèi)的水位發(fā)出報(bào)警。主要采用CD4066、74LS86、74LS32、CD4511芯片,再加上數(shù)碼管、蜂鳴器、發(fā)光二極管、電阻這些器件組成一個(gè)簡(jiǎn)單而靈敏的監(jiān)測(cè)報(bào)警電路,操作簡(jiǎn)單,接通電源即可工作。因?yàn)榇蟛糠蛛娐凡捎脭?shù)字電路,所以本水位監(jiān)測(cè)報(bào)警器還具有耗能低、準(zhǔn)確性高的特點(diǎn)。關(guān)鍵字:譯碼電路    報(bào)警電路    監(jiān)測(cè)電路 Abstract: The water level alarm monitoring the use of 5 V low-voltage DC power (can also use three batteries replaced on the 5th) will be able to 5 to 15 centimeters of water level monitoring, with LED display and digital display of water level, and this can no longer Within the scope of a water level alarm. Mainly CD4066, 74LS86, 74LS32, CD4511 chips, coupled with digital control, buzzer, light-emitting diode, the resistance of these devices composed of a simple and sensitive monitoring alarm circuits. Because the majority of circuits using digital circuitry, so the water level monitored alarm system also has low energy consumption, high accuracy of the characteristics. Keyword: Decoding circuit alarm circuit monitoring circuit

    標(biāo)簽: 水位 監(jiān)測(cè)報(bào)警 系統(tǒng)原理

    上傳時(shí)間: 2013-11-05

    上傳用戶:王慶才

  • Emulating a synchronous serial

    The C500 microcontroller family usually provides only one on-chip synchronous serialchannel (SSC). If a second SSC is required, an emulation of the missing interface mayhelp to avoid an external hardware solution with additional electronic components.The solution presented in this paper and in the attached source files emulates the mostimportant SSC functions by using optimized SW routines with a performance up to 25KBaud in Slave Mode with half duplex transmission and an overhead less than 60% atSAB C513 with 12 MHz. Due to the implementation in C this performance is not the limitof the chip. A pure implementation in assembler will result in a strong reduction of theCPU load and therefore increase the maximum speed of the interface. In addition,microcontrollers like the SAB C505 will speed up the interface by a factor of two becauseof an optimized architecture compared with the SAB C513.Moreover, this solution lays stress on using as few on-chip hardware resources aspossible. A more excessive consumption of those resources will result in a highermaximum speed of the emulated interface.Due to the restricted performance of an 8 bit microcontroller a pin compatible solution isprovided only; the internal register based programming interface is replaced by a set ofsubroutine calls.The attached source files also contain a test shell, which demonstrates how to exchangeinformation between an on-chip HW-SSC and the emulated SW-SSC via 5 external wiresin different operation modes. It is based on the SAB C513 (Siemens 8 bit microcontroller).A table with load measurements is presented to give an indication for the fraction of CPUperformance required by software for emulating the SSC.

    標(biāo)簽: synchronous Emulating serial

    上傳時(shí)間: 2014-01-31

    上傳用戶:z1191176801

  • 使用軟件程序仿真C500微控制器系列SSC(同步串行通道)功

    The solution presented in this paper and in the attached source files emulates the mostimportant SSC functions by using SW routines implemented in C. The code is focused onthe SAB C513, but will fit to all C500 derivatives.Beyond the low level software drivers a test shell is delivered. This shell allows a quicktest of the software drivers by an emulator or a starter kit demo board.

    標(biāo)簽: C500 SSC 軟件 程序

    上傳時(shí)間: 2013-11-24

    上傳用戶:363186

  • An easy way to work with Exter

    Internal Interrupts are used to respond to asynchronous requests from a certain part of themicrocontroller that needs to be serviced. Each peripheral in the TriCore as well as theBus Control Unit, the Debug Unit, the Peripheral Control Processor (PCP) and the CPUitself can generate an Interrupt Request.So what is an external Interrupt?An external Interrupt is something alike as the internal Interrupt. The difference is that anexternal Interrupt request is caused by an external event. Normally this would be a pulseon Port0 or Port1, but it can be even a signal from the input buffer of the SSC, indicatingthat a service is requested.The User’s Manual does not explain this aspect in detail so this ApNote will explain themost common form of an external Interrupt request. This ApNote will show that there is aneasy way to react on a pulse on Port0 or Port1 and to create with this impulse an InterruptService Request. Later in the second part of the document, you can find hints on how todebounce impulses to enable the use of a simple switch as the input device.Note: You will find additional information on how to setup the Interrupt System in theApNote “First steps through the TriCore Interrupt System” (AP3222xx)1. It would gobeyond the scope of this document to explain this here, but you will find selfexplanatoryexamples later on.

    標(biāo)簽: Exter easy work with

    上傳時(shí)間: 2013-10-27

    上傳用戶:zhangyigenius

  • 用外部設(shè)備設(shè)置32位微控制器TriCore的中斷的指令及方法

    The Infineon TriCore provides an Interrupt System with a high safety standard. Thisdocument contains some instructions on how to initiate an Interrupt from an externaldevice. First it will show you how to trigger an Interrupt Service Request by an impulseon Port 0 or Port 1. Then in the second part of the document you can find hints how todebounce impulses to enable the use of a simple switch as input device.Authors: Thomas Bliem, CQ Nguyen / Infineon SMI MD Apps

    標(biāo)簽: TriCore 外部設(shè)備 中斷 微控制器

    上傳時(shí)間: 2013-11-05

    上傳用戶:uuuuuuu

  • Input Signal Rise and Fall Tim

    All inputs of the C16x family have Schmitt-Trigger input characteristics. These Schmitt-Triggers are intended to always provide proper internal low and high levels, even if anundefined voltage level (between TTL-VIL and TTL-VIH) is externally applied to the pin.The hysteresis of these inputs, however, is very small, and can not be properly used in anapplication to suppress signal noise, and to shape slow rising/falling input transitions.Thus, it must be taken care that rising/falling input signals pass the undefined area of theTTL-specification between VIL and VIH with a sufficient rise/fall time, as generally usualand specified for TTL components (e.g. 74LS series: gates 1V/us, clock inputs 20V/us).The effect of the implemented Schmitt-Trigger is that even if the input signal remains inthe undefined area, well defined low/high levels are generated internally. Note that allinput signals are evaluated at specific sample points (depending on the input and theperipheral function connected to it), at that signal transitions are detected if twoconsecutive samples show different levels. Thus, only the current level of an input signalat these sample points is relevant, that means, the necessary rise/fall times of the inputsignal is only dependant on the sample rate, that is the distance in time between twoconsecutive evaluation time points. If an input signal, for instance, is sampled throughsoftware every 10us, it is irrelevant, which input level would be seen between thesamples. Thus, it would be allowable for the signal to take 10us to pass through theundefined area. Due to the sample rate of 10us, it is assured that only one sample canoccur while the signal is within the undefined area, and no incorrect transition will bedetected. For inputs which are connected to a peripheral function, e.g. capture inputs, thesample rate is determined by the clock cycle of the peripheral unit. In the case of theCAPCOM unit this means a sample rate of 400ns @ 20MHz CPU clock. This requiresinput signals to pass through the undefined area within these 400ns in order to avoidmultiple capture events.For input signals, which do not provide the required rise/fall times, external circuitry mustbe used to shape the signal transitions.In the attached diagram, the effect of the sample rate is shown. The numbers 1 to 5 in thediagram represent possible sample points. Waveform a) shows the result if the inputsignal transition time through the undefined TTL-level area is less than the time distancebetween the sample points (sampling at 1, 2, 3, and 4). Waveform b) can be the result ifthe sampling is performed more than once within the undefined area (sampling at 1, 2, 5,3, and 4).Sample points:1. Evaluation of the signal clearly results in a low level2. Either a low or a high level can be sampled here. If low is sampled, no transition willbe detected. If the sample results in a high level, a transition is detected, and anappropriate action (e.g. capture) might take place.3. Evaluation here clearly results in a high level. If the previous sample 2) had alreadydetected a high, there is no change. If the previous sample 2) showed a low, atransition from low to high is detected now.

    標(biāo)簽: Signal Input Fall Rise

    上傳時(shí)間: 2013-10-23

    上傳用戶:copu

  • 介紹C16x系列微控制器的輸入信號(hào)升降時(shí)序圖及特性

    All inputs of the C16x family have Schmitt-Trigger input characteristics. These Schmitt-Triggers are intended to always provide proper internal low and high levels, even if anundefined voltage level (between TTL-VIL and TTL-VIH) is externally applied to the pin.The hysteresis of these inputs, however, is very small, and can not be properly used in anapplication to suppress signal noise, and to shape slow rising/falling input transitions.Thus, it must be taken care that rising/falling input signals pass the undefined area of theTTL-specification between VIL and VIH with a sufficient rise/fall time, as generally usualand specified for TTL components (e.g. 74LS series: gates 1V/us, clock inputs 20V/us).The effect of the implemented Schmitt-Trigger is that even if the input signal remains inthe undefined area, well defined low/high levels are generated internally. Note that allinput signals are evaluated at specific sample points (depending on the input and theperipheral function connected to it), at that signal transitions are detected if twoconsecutive samples show different levels. Thus, only the current level of an input signalat these sample points is relevant, that means, the necessary rise/fall times of the inputsignal is only dependant on the sample rate, that is the distance in time between twoconsecutive evaluation time points. If an input signal, for instance, is sampled throughsoftware every 10us, it is irrelevant, which input level would be seen between thesamples. Thus, it would be allowable for the signal to take 10us to pass through theundefined area. Due to the sample rate of 10us, it is assured that only one sample canoccur while the signal is within the undefined area, and no incorrect transition will bedetected. For inputs which are connected to a peripheral function, e.g. capture inputs, thesample rate is determined by the clock cycle of the peripheral unit. In the case of theCAPCOM unit this means a sample rate of 400ns @ 20MHz CPU clock. This requiresinput signals to pass through the undefined area within these 400ns in order to avoidmultiple capture events.

    標(biāo)簽: C16x 微控制器 輸入信號(hào) 時(shí)序圖

    上傳時(shí)間: 2014-04-02

    上傳用戶:han_zh

  • CAN與RS232轉(zhuǎn)換節(jié)點(diǎn)的設(shè)計(jì)與實(shí)現(xiàn)

    CAN與RS232轉(zhuǎn)換節(jié)點(diǎn)的設(shè)計(jì)與實(shí)現(xiàn) 介紹將CAN總線接口與RS232總線接口相互轉(zhuǎn)換的設(shè)計(jì)方法和2種總線電平轉(zhuǎn)換關(guān)系,實(shí)現(xiàn)CAN總線與各模塊的接口設(shè)計(jì),制定了相應(yīng)的軟硬件設(shè)計(jì)方案,并給出軟件設(shè)計(jì)流程圖以及部分硬件設(shè)計(jì)原理圖。為CAN總線與RS232總線互聯(lián)提供了一種方法,對(duì)CAN總線與RS232總線接口設(shè)備的互聯(lián)和廣泛應(yīng)用的實(shí)現(xiàn)具有重要意義。關(guān)鍵詞:CAN總線;RS-232總線;串行通信Design and Realization of CAN and RS232 Transformation NodeZHOU Wei, CHENG Xiao-hong(Information Institute, Wuhan University of Technology, Wuhan 430070)【Abstract】This paper introduces one design method of the CAN bus interface and the RS232 bus interface interconversion, emphasizes two kindof bus level transformation relations, realizes the CAN bus and various modules connection design, formulates the design proposal of correspondingsoftware and hardware, and gives the flow chart of software design as well as the partial schematic diagram of hardware design. It providesonemethod for the CAN bus and the RS232 bus interconnection, has the vital significance to widespread application realization of the CAN busand theRS232 bus interface equipment interconnection.【Key words】CAN bus; RS-232 bus; serial communication

    標(biāo)簽: CAN 232 RS 轉(zhuǎn)換

    上傳時(shí)間: 2013-11-04

    上傳用戶:leesuper

  • 匯編+保護(hù)模式+教程

    九.輸入/輸出保護(hù)為了支持多任務(wù),80386不僅要有效地實(shí)現(xiàn)任務(wù)隔離,而且還要有效地控制各任務(wù)的輸入/輸出,避免輸入/輸出沖突。本文將介紹輸入輸出保護(hù)。 這里下載本文源代碼。 <一>輸入/輸出保護(hù)80386采用I/O特權(quán)級(jí)IPOL和I/O許可位圖的方法來控制輸入/輸出,實(shí)現(xiàn)輸入/輸出保護(hù)。 1.I/O敏感指令輸入輸出特權(quán)級(jí)(I/O Privilege Level)規(guī)定了可以執(zhí)行所有與I/O相關(guān)的指令和訪問I/O空間中所有地址的最外層特權(quán)級(jí)。IOPL的值在如下圖所示的標(biāo)志寄存器中。 標(biāo)  志寄存器 BIT31—BIT18 BIT17 BIT16 BIT15 BIT14 BIT13—BIT12 BIT11 BIT10 BIT9 BIT8 BIT7 BIT6 BIT5 BIT4 BIT3 BIT2 BIT1 BIT0 00000000000000 VM RF 0 NT IOPL OF DF IF TF SF ZF 0 AF 0 PF 1 CF I/O許可位圖規(guī)定了I/O空間中的哪些地址可以由在任何特權(quán)級(jí)執(zhí)行的程序所訪問。I/O許可位圖在任務(wù)狀態(tài)段TSS中。 I/O敏感指令 指令 功能 保護(hù)方式下的執(zhí)行條件 CLI 清除EFLAGS中的IF位 CPL<=IOPL STI 設(shè)置EFLAGS中的IF位 CPL<=IOPL IN 從I/O地址讀出數(shù)據(jù) CPL<=IOPL或I/O位圖許可 INS 從I/O地址讀出字符串 CPL<=IOPL或I/O位圖許可 OUT 向I/O地址寫數(shù)據(jù) CPL<=IOPL或I/O位圖許可 OUTS 向I/O地址寫字符串 CPL<=IOPL或I/O位圖許可 上表所列指令稱為I/O敏感指令,由于這些指令與I/O有關(guān),并且只有在滿足所列條件時(shí)才可以執(zhí)行,所以把它們稱為I/O敏感指令。從表中可見,當(dāng)前特權(quán)級(jí)不在I/O特權(quán)級(jí)外層時(shí),可以正常執(zhí)行所列的全部I/O敏感指令;當(dāng)特權(quán)級(jí)在I/O特權(quán)級(jí)外層時(shí),執(zhí)行CLI和STI指令將引起通用保護(hù)異常,而其它四條指令是否能夠被執(zhí)行要根據(jù)訪問的I/O地址及I/O許可位圖情況而定(在下面論述),如果條件不滿足而執(zhí)行,那么將引起出錯(cuò)碼為0的通用保護(hù)異常。 由于每個(gè)任務(wù)使用各自的EFLAGS值和擁有自己的TSS,所以每個(gè)任務(wù)可以有不同的IOPL,并且可以定義不同的I/O許可位圖。注意,這些I/O敏感指令在實(shí)模式下總是可執(zhí)行的。 2.I/O許可位圖如果只用IOPL限制I/O指令的執(zhí)行是很不方便的,不能滿足實(shí)際要求需要。因?yàn)檫@樣做會(huì)使得在特權(quán)級(jí)3執(zhí)行的應(yīng)用程序要么可訪問所有I/O地址,要么不可訪問所有I/O地址。實(shí)際需要與此剛好相反,只允許任務(wù)甲的應(yīng)用程序訪問部分I/O地址,只允許任務(wù)乙的應(yīng)用程序訪問另一部分I/O地址,以避免任務(wù)甲和任務(wù)乙在訪問I/O地址時(shí)發(fā)生沖突,從而避免任務(wù)甲和任務(wù)乙使用使用獨(dú)享設(shè)備時(shí)發(fā)生沖突。 因此,在IOPL的基礎(chǔ)上又采用了I/O許可位圖。I/O許可位圖由二進(jìn)制位串組成。位串中的每一位依次對(duì)應(yīng)一個(gè)I/O地址,位串的第0位對(duì)應(yīng)I/O地址0,位串的第n位對(duì)應(yīng)I/O地址n。如果位串中的第位為0,那么對(duì)應(yīng)的I/O地址m可以由在任何特權(quán)級(jí)執(zhí)行的程序訪問;否則對(duì)應(yīng)的I/O地址m只能由在IOPL特權(quán)級(jí)或更內(nèi)層特權(quán)級(jí)執(zhí)行的程序訪問。如果在I/O外層特權(quán)級(jí)執(zhí)行的程序訪問位串中位值為1的位所對(duì)應(yīng)的I/O地址,那么將引起通用保護(hù)異常。 I/O地址空間按字節(jié)進(jìn)行編址。一條I/O指令最多可涉及四個(gè)I/O地址。在需要根據(jù)I/O位圖決定是否可訪問I/O地址的情況下,當(dāng)一條I/O指令涉及多個(gè)I/O地址時(shí),只有這多個(gè)I/O地址所對(duì)應(yīng)的I/O許可位圖中的位都為0時(shí),該I/O指令才能被正常執(zhí)行,如果對(duì)應(yīng)位中任一位為1,就會(huì)引起通用保護(hù)異常。 80386支持的I/O地址空間大小是64K,所以構(gòu)成I/O許可位圖的二進(jìn)制位串最大長(zhǎng)度是64K個(gè)位,即位圖的有效部分最大為8K字節(jié)。一個(gè)任務(wù)實(shí)際需要使用的I/O許可位圖大小通常要遠(yuǎn)小于這個(gè)數(shù)目。 當(dāng)前任務(wù)使用的I/O許可位圖存儲(chǔ)在當(dāng)前任務(wù)TSS中低端的64K字節(jié)內(nèi)。I/O許可位圖總以字節(jié)為單位存儲(chǔ),所以位串所含的位數(shù)總被認(rèn)為是8的倍數(shù)。從前文中所述的TSS格式可見,TSS內(nèi)偏移66H的字確定I/O許可位圖的開始偏移。由于I/O許可位圖最長(zhǎng)可達(dá)8K字節(jié),所以開始偏移應(yīng)小于56K,但必須大于等于104,因?yàn)門SS中前104字節(jié)為TSS的固定格式,用于保存任務(wù)的狀態(tài)。 1.I/O訪問許可檢查細(xì)節(jié)保護(hù)模式下處理器在執(zhí)行I/O指令時(shí)進(jìn)行許可檢查的細(xì)節(jié)如下所示。 (1)若CPL<=IOPL,則直接轉(zhuǎn)步驟(8);(2)取得I/O位圖開始偏移;(3)計(jì)算I/O地址對(duì)應(yīng)位所在字節(jié)在I/O許可位圖內(nèi)的偏移;(4)計(jì)算位偏移以形成屏蔽碼值,即計(jì)算I/O地址對(duì)應(yīng)位在字節(jié)中的第幾位;(5)把字節(jié)偏移加上位圖開始偏移,再加1,所得值與TSS界限比較,若越界,則產(chǎn)生出錯(cuò)碼為0的通用保護(hù)故障;(6)若不越界,則從位圖中讀對(duì)應(yīng)字節(jié)及下一個(gè)字節(jié);(7)把讀出的兩個(gè)字節(jié)與屏蔽碼進(jìn)行與運(yùn)算,若結(jié)果不為0表示檢查未通過,則產(chǎn)生出錯(cuò)碼為0的通用保護(hù)故障;(8)進(jìn)行I/O訪問。設(shè)某一任務(wù)的TSS段如下: TSSSEG                  SEGMENT PARA USE16                        TSS     <>             ;TSS低端固定格式部分                        DB      8 DUP(0)       ;對(duì)應(yīng)I/O端口00H—3FH                        DB      10000000B      ;對(duì)應(yīng)I/O端口40H—47H                        DB      01100000B      ;對(duì)用I/O端口48H—4FH                        DB      8182 DUP(0ffH) ;對(duì)應(yīng)I/O端口50H—0FFFFH                        DB      0FFH           ;位圖結(jié)束字節(jié)TSSLen                  =       $TSSSEG                  ENDS 再假設(shè)IOPL=1,CPL=3。那么如下I/O指令有些能正常執(zhí)行,有些會(huì)引起通用保護(hù)異常:                         in      al,21h  ;(1)正常執(zhí)行                        in      al,47h  ;(2)引起異常                        out     20h,al  ;(3)正常實(shí)行                        out     4eh,al  ;(4)引起異常                        in      al,20h  ;(5)正常執(zhí)行                        out     20h,eax ;(6)正常執(zhí)行                        out     4ch,ax  ;(7)引起異常                        in      ax,46h  ;(8)引起異常                        in      eax,42h ;(9)正常執(zhí)行 由上述I/O許可檢查的細(xì)節(jié)可見,不論是否必要,當(dāng)進(jìn)行許可位檢查時(shí),80386總是從I/O許可位圖中讀取兩個(gè)字節(jié)。目的是為了盡快地執(zhí)行I/O許可檢查。一方面,常常要讀取I/O許可位圖的兩個(gè)字節(jié)。例如,上面的第(8)條指令要對(duì)I/O位圖中的兩個(gè)位進(jìn)行檢查,其低位是某個(gè)字節(jié)的最高位,高位是下一個(gè)字節(jié)的最低位。可見即使只要檢查兩個(gè)位,也可能需要讀取兩個(gè)字節(jié)。另一方面,最多檢查四個(gè)連續(xù)的位,即最多也只需讀取兩個(gè)字節(jié)。所以每次要讀取兩個(gè)字節(jié)。這也是在判別是否越界時(shí)再加1的原因。為此,為了避免在讀取I/O許可位圖的最高字節(jié)時(shí)產(chǎn)生越界,必須在I/O許可位圖的最后填加一個(gè)全1的字節(jié),即0FFH。此全1的字節(jié)應(yīng)填加在最后一個(gè)位圖字節(jié)之后,TSS界限范圍之前,即讓填加的全1字節(jié)在TSS界限之內(nèi)。 I/O許可位圖開始偏移加8K所得的值與TSS界限值二者中較小的值決定I/O許可位圖的末端。當(dāng)TSS的界限大于I/O許可位圖開始偏移加8K時(shí),I/O許可位圖的有效部分就有8K字節(jié),I/O許可檢查全部根據(jù)全部根據(jù)該位圖進(jìn)行。當(dāng)TSS的界限不大于I/O許可位圖開始偏移加8K時(shí),I/O許可位圖有效部分就不到8K字節(jié),于是對(duì)較小I/O地址訪問的許可檢查根據(jù)位圖進(jìn)行,而對(duì)較大I/O地址訪問的許可檢查總被認(rèn)為不可訪問而引起通用保護(hù)故障。因?yàn)檫@時(shí)會(huì)發(fā)生字節(jié)越界而引起通用保護(hù)異常,所以在這種情況下,可認(rèn)為不足的I/O許可位圖的高端部分全為1。利用這個(gè)特點(diǎn),可大大節(jié)約TSS中I/O許可位圖占用的存儲(chǔ)單元,也就大大減小了TSS段的長(zhǎng)度。 <二>重要標(biāo)志保護(hù)輸入輸出的保護(hù)與存儲(chǔ)在標(biāo)志寄存器EFLAGS中的IOPL密切相關(guān),顯然不能允許隨便地改變IOPL,否則就不能有效地實(shí)現(xiàn)輸入輸出保護(hù)。類似地,對(duì)EFLAGS中的IF位也必須加以保護(hù),否則CLI和STI作為敏感指令對(duì)待是無意義的。此外,EFLAGS中的VM位決定著處理器是否按虛擬8086方式工作。 80386對(duì)EFLAGS中的這三個(gè)字段的處理比較特殊,只有在較高特權(quán)級(jí)執(zhí)行的程序才能執(zhí)行IRET、POPF、CLI和STI等指令改變它們。下表列出了不同特權(quán)級(jí)下對(duì)這三個(gè)字段的處理情況。 不同特權(quán)級(jí)對(duì)標(biāo)志寄存器特殊字段的處理 特權(quán)級(jí) VM標(biāo)志字段 IOPL標(biāo)志字段 IF標(biāo)志字段 CPL=0 可變(初POPF指令外) 可變 可變 0  不變 不變 可變 CPL>IOPL 不變 不變 不變 從表中可見,只有在特權(quán)級(jí)0執(zhí)行的程序才可以修改IOPL位及VM位;只能由相對(duì)于IOPL同級(jí)或更內(nèi)層特權(quán)級(jí)執(zhí)行的程序才可以修改IF位。與CLI和STI指令不同,在特權(quán)級(jí)不滿足上述條件的情況下,當(dāng)執(zhí)行POPF指令和IRET指令時(shí),如果試圖修改這些字段中的任何一個(gè)字段,并不引起異常,但試圖要修改的字段也未被修改,也不給出任何特別的信息。此外,指令POPF總不能改變VM位,而PUSHF指令所壓入的標(biāo)志中的VM位總為0。 <三>演示輸入輸出保護(hù)的實(shí)例(實(shí)例九)下面給出一個(gè)用于演示輸入輸出保護(hù)的實(shí)例。演示內(nèi)容包括:I/O許可位圖的作用、I/O敏感指令引起的異常和特權(quán)指令引起的異常;使用段間調(diào)用指令CALL通過任務(wù)門調(diào)用任務(wù),實(shí)現(xiàn)任務(wù)嵌套。 1.演示步驟實(shí)例演示的內(nèi)容比較豐富,具體演示步驟如下:(1)在實(shí)模式下做必要準(zhǔn)備后,切換到保護(hù)模式;(2)進(jìn)入保護(hù)模式的臨時(shí)代碼段后,把演示任務(wù)的TSS段描述符裝入TR,并設(shè)置演示任務(wù)的堆棧;(3)進(jìn)入演示代碼段,演示代碼段的特權(quán)級(jí)是0;(4)通過任務(wù)門調(diào)用測(cè)試任務(wù)1。測(cè)試任務(wù)1能夠順利進(jìn)行;(5)通過任務(wù)門調(diào)用測(cè)試任務(wù)2。測(cè)試任務(wù)2演示由于違反I/O許可位圖規(guī)定而導(dǎo)致通用保護(hù)異常;(6)通過任務(wù)門調(diào)用測(cè)試任務(wù)3。測(cè)試任務(wù)3演示I/O敏感指令如何引起通用保護(hù)異常;(7)通過任務(wù)門調(diào)用測(cè)試任務(wù)4。測(cè)試任務(wù)4演示特權(quán)指令如何引起通用保護(hù)異常;(8)從演示代碼轉(zhuǎn)臨時(shí)代碼,準(zhǔn)備返回實(shí)模式;(9)返回實(shí)模式,并作結(jié)束處理。

    標(biāo)簽: 匯編 保護(hù)模式 教程

    上傳時(shí)間: 2013-12-11

    上傳用戶:nunnzhy

  • 微機(jī)原理與接口課件

    微處理器及微型計(jì)算機(jī)的發(fā)展概況  第一代微處理器是以Intel公司1971年推出的4004,4040為代表的四位微處理機(jī)。      第二代微處理機(jī)(1973年~1977年),典型代表有:Intel 公司的8080、8085;Motorola公司的M6800以及Zlog公司的Z80。     第三代微處理機(jī) 第三代微機(jī)是以16位機(jī)為代表,基本上是在第二代微機(jī)的基礎(chǔ)上發(fā)展起來的。其中Intel公司的8088。8086是在8085的基礎(chǔ)發(fā)展起來的;M68000是Motorola公司在M6800 的基礎(chǔ)發(fā)展起來的;     第四代微處理機(jī) 以Intel公司1984年10月推出的80386CPU和1989年4月推出的80486CPU為代表,     第五代微處理機(jī)的發(fā)展更加迅猛,1993年3月被命名為PENTIUM的微處理機(jī)面世,98年P(guān)ENTIUM 2又被推向市場(chǎng)。 INTEL CPU 發(fā)展歷史Intel第一塊CPU 4004,4位主理器,主頻108kHz,運(yùn)算速度0.06MIPs(Million Instructions Per Second, 每秒百萬條指令),集成晶體管2,300個(gè),10微米制造工藝,最大尋址內(nèi)存640 bytes,生產(chǎn)曰期1971年11月. 8085,8位主理器,主頻5M,運(yùn)算速度0.37MIPs,集成晶體管6,500個(gè),3微米制造工藝,最大尋址內(nèi)存64KB,生產(chǎn)曰期1976年 8086,16位主理器,主頻4.77/8/10MHZ,運(yùn)算速度0.75MIPs,集成晶體管29,000個(gè),3微米制造工藝,最大尋址內(nèi)存1MB,生產(chǎn)曰期1978年6月. 80486DX,DX2,DX4,32位主理器,主頻25/33/50/66/75/100MHZ,總線頻率33/50/66MHZ,運(yùn)算速度20~60MIPs,集成晶體管1.2M個(gè),1微米制造工藝,168針PGA,最大尋址內(nèi)存4GB,緩存8/16/32/64KB,生產(chǎn)曰期1989年4月 Celeron一代, 主頻266/300MHZ(266/300MHz w/o L2 cache, Covington芯心 (Klamath based),300A/333/366/400/433/466/500/533MHz w/128kB L2 cache, Mendocino核心 (Deschutes-based), 總線頻率66MHz,0.25微米制造工藝,生產(chǎn)曰期1998年4月) Pentium 4 (478針),至今分為三種核心:Willamette核心(主頻1.5G起,FSB400MHZ,0.18微米制造工藝),Northwood核心(主頻1.6G~3.0G,FSB533MHZ,0.13微米制造工藝, 二級(jí)緩存512K),Prescott核心(主頻2.8G起,FSB800MHZ,0.09微米制造工藝,1M二級(jí)緩存,13條全新指令集SSE3),生產(chǎn)曰期2001年7月. 更大的緩存、更高的頻率、 超級(jí)流水線、分支預(yù)測(cè)、亂序執(zhí)行超線程技術(shù) 微型計(jì)算機(jī)組成結(jié)構(gòu)單片機(jī)簡(jiǎn)介單片機(jī)即單片機(jī)微型計(jì)算機(jī),是將計(jì)算機(jī)主機(jī)(CPU、    內(nèi)存和I/O接口)集成在一小塊硅片上的微型機(jī)。 三、計(jì)算機(jī)編程語(yǔ)言的發(fā)展概況 機(jī)器語(yǔ)言  機(jī)器語(yǔ)言就是0,1碼語(yǔ)言,是計(jì)算機(jī)唯一能理解并直接執(zhí)行的語(yǔ)言。匯編語(yǔ)言  用一些助記符號(hào)代替用0,1碼描述的某種機(jī)器的指令系統(tǒng),匯編語(yǔ)言就是在此基礎(chǔ)上完善起來的。高級(jí)語(yǔ)言  BASIC,PASCAL,C語(yǔ)言等等。用高級(jí)語(yǔ)言編寫的程序稱源程序,它們必須通過編譯或解釋,連接等步驟才能被計(jì)算機(jī)處理。 面向?qū)ο笳Z(yǔ)言  C++,Java等編程語(yǔ)言是面向?qū)ο蟮恼Z(yǔ)言。 1.3 微型計(jì)算機(jī)中信息的表示及運(yùn)算基礎(chǔ)(一) 十進(jìn)制ND有十個(gè)數(shù)碼:0~9,逢十進(jìn)一。 例 1234.5=1×103 +2×102 +3×101 +4×100 +5×10-1加權(quán)展開式以10稱為基數(shù),各位系數(shù)為0~9,10i為權(quán)。 一般表達(dá)式:ND= dn-1×10n-1+dn-2×10n-2 +…+d0×100 +d-1×10-1+… (二) 二進(jìn)制NB兩個(gè)數(shù)碼:0、1, 逢二進(jìn)一。 例 1101.101=1×23+1×22+0×21+1×20+1×2-1+1×2-3 加權(quán)展開式以2為基數(shù),各位系數(shù)為0、1, 2i為權(quán)。 一般表達(dá)式:  NB = bn-1×2n-1 + bn-2×2n-2 +…+b0×20 +b-1×2-1+… (三)十六進(jìn)制NH十六個(gè)數(shù)碼0~9、A~F,逢十六進(jìn)一。 例:DFC.8=13×162 +15×161 +12×160 +8×16-1 展開式以十六為基數(shù),各位系數(shù)為0~9,A~F,16i為權(quán)。 一般表達(dá)式: NH= hn-1×16n-1+ hn-2×16n-2+…+ h0×160+ h-1×16-1+… 二、不同進(jìn)位計(jì)數(shù)制之間的轉(zhuǎn)換 (二)二進(jìn)制與十六進(jìn)制數(shù)之間的轉(zhuǎn)換  24=16 ,四位二進(jìn)制數(shù)對(duì)應(yīng)一位十六進(jìn)制數(shù)。舉例:(三)十進(jìn)制數(shù)轉(zhuǎn)換成二、十六進(jìn)制數(shù)整數(shù)、小數(shù)分別轉(zhuǎn)換   1.整數(shù)轉(zhuǎn)換法“除基取余”:十進(jìn)制整數(shù)不斷除以轉(zhuǎn)換進(jìn)制基數(shù),直至商為0。每除一次取一個(gè)余數(shù),從低位排向高位。舉例: 2. 小數(shù)轉(zhuǎn)換法“乘基取整”:用轉(zhuǎn)換進(jìn)制的基數(shù)乘以小數(shù)部分,直至小數(shù)為0或達(dá)到轉(zhuǎn)換精度要求的位數(shù)。每乘一次取一次整數(shù),從最高位排到最低位。舉例:  三、帶符號(hào)數(shù)的表示方法 機(jī)器數(shù):機(jī)器中數(shù)的表示形式。真值: 機(jī)器數(shù)所代表的實(shí)際數(shù)值。舉例:一個(gè)8位機(jī)器數(shù)與它的真值對(duì)應(yīng)關(guān)系如下:  真值: X1=+84=+1010100B     X2=-84= -1010100B   機(jī)器數(shù):[X1]機(jī)= 01010100    [X2]機(jī)= 11010100(二)原碼、反碼、補(bǔ)碼最高位為符號(hào)位,0表示 “+”,1表示“-”。 數(shù)值位與真值數(shù)值位相同。 例  8位原碼機(jī)器數(shù):  真值:   x1  = +1010100B     x2    =- 1010100B      機(jī)器數(shù): [x1]原  = 01010100  [x2]原 = 11010100原碼表示簡(jiǎn)單直觀,但0的表示不唯一,加減運(yùn)算復(fù)雜。 正數(shù)的反碼與原碼表示相同。       負(fù)數(shù)反碼符號(hào)位為 1,數(shù)值位為原碼數(shù)值各位取反。 例 8位反碼機(jī)器數(shù):          x= +4: [x]原= 00000100 [x]反= 00000100     x= -4: [x]原= 10000100  [x]反= 111110113、補(bǔ)碼(Two’s Complement)正數(shù)的補(bǔ)碼表示與原碼相同。       負(fù)數(shù)補(bǔ)碼等于2n-abs(x)8位機(jī)器數(shù)表示的真值四、 二進(jìn)制編碼例:求十進(jìn)制數(shù)876的BCD碼 876= 1000 0111 0110 BCD  876= 36CH = 1101101100B 2、字符編碼    美國(guó)標(biāo)準(zhǔn)信息交換碼ASCII碼,用于計(jì)算      機(jī)與計(jì)算機(jī)、計(jì)算機(jī)與外設(shè)之間傳遞信息。 3、漢字編碼 “國(guó)家標(biāo)準(zhǔn)信息交換用漢字編碼”(GB2312-80標(biāo)準(zhǔn)),簡(jiǎn)稱國(guó)標(biāo)碼。 用兩個(gè)七位二進(jìn)制數(shù)編碼表示一個(gè)漢字 例如“巧”字的代碼是39H、41H漢字內(nèi)碼例如“巧”字的代碼是0B9H、0C1H1·4  運(yùn)算基礎(chǔ) 一、二進(jìn)制數(shù)的運(yùn)算加法規(guī)則:“逢2進(jìn)1”       減法規(guī)則:“借1當(dāng)2”       乘法規(guī)則:“逢0出0,全1出1”二、二—十進(jìn)制數(shù)的加、減運(yùn)算        BCD數(shù)的運(yùn)算規(guī)則 循十進(jìn)制數(shù)的運(yùn)算規(guī)則“逢10進(jìn)1”。但計(jì)算機(jī)在進(jìn)行這種運(yùn)算時(shí)會(huì)出現(xiàn)潛在的錯(cuò)誤。為了解決BCD數(shù)的運(yùn)算問題,采取調(diào)整運(yùn)算結(jié)果的措施:即“加六修正”和“減六修正”例:10001000(BCD)+01101001(BCD)        =000101010111(BCD)                1 0 0 0 1 0 0 0       +  0 1 1 0 1 0 0 1           1 1 1 1 0 0 0 1        +  0 1 1 0 0 1 1 0     ……調(diào)整          1 0 1 0 1 0 1 1 1                                        進(jìn)位  例:  10001000(BCD)- 01101001(BCD)= 00011001(BCD)                   1 0 0 0 1 0 0 0            -   0 1 1 0 1 0 0 1             0 0 0 1 1 1 1 1         -                    0 1 1 0   ……調(diào)整             0 0 0 1 1 0 0 1  三、 帶符號(hào)二進(jìn)制數(shù)的運(yùn)算 1.5 幾個(gè)重要的數(shù)字邏輯電路編碼器譯碼器計(jì)數(shù)器微機(jī)自動(dòng)工作的條件程序指令順序存放自動(dòng)跟蹤指令執(zhí)行1.6 微機(jī)基本結(jié)構(gòu)微機(jī)結(jié)構(gòu)各部分組成連接方式1、以CPU為中心的雙總線結(jié)構(gòu);2、以內(nèi)存為中心的雙總線結(jié)構(gòu);3、單總線結(jié)構(gòu)CPU結(jié)構(gòu)管腳特點(diǎn)  1、多功能;2、分時(shí)復(fù)用內(nèi)部結(jié)構(gòu)  1、控制; 2、運(yùn)算; 3、寄存器; 4、地址程序計(jì)數(shù)器堆棧定義 1、定義;2、管理;3、堆棧形式

    標(biāo)簽: 微機(jī)原理 接口

    上傳時(shí)間: 2013-10-17

    上傳用戶:erkuizhang

主站蜘蛛池模板: 宁夏| 青海省| 荆门市| 榆树市| 寿阳县| 凯里市| 射阳县| 自治县| 鲁山县| 永川市| 朝阳市| 泗水县| 赫章县| 县级市| 洛川县| 怀宁县| 营山县| 襄垣县| 苏尼特左旗| 乐陵市| 东阿县| 胶州市| 洛阳市| 兰西县| 寿光市| 乐至县| 鄂尔多斯市| 乐至县| 自贡市| 竹北市| 扎赉特旗| 鄯善县| 庆云县| 牟定县| 曲阳县| 布尔津县| 库车县| 唐河县| 乌审旗| 黑水县| 常宁市|