匯編語(yǔ)言論文_第1頁(yè)
匯編語(yǔ)言論文_第2頁(yè)
匯編語(yǔ)言論文_第3頁(yè)
匯編語(yǔ)言論文_第4頁(yè)
匯編語(yǔ)言論文_第5頁(yè)
已閱讀5頁(yè),還剩14頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

課程論文<**>-Sor<**>-R:<論文題目>-By:<**>,許卓明河海大學(xué),<yyyy-mm-dd>PagePAGE2ofNUMPAGES1.z.本科課程論文CoursePaper課程名稱Course:IBM-PC匯編語(yǔ)言課程設(shè)計(jì)課程名稱Course:IBM-PC匯編語(yǔ)言課程設(shè)計(jì)課程性質(zhì)CourseNo:專業(yè)課學(xué)分?jǐn)?shù)Credits:5主講教師Instructor:開(kāi)設(shè)學(xué)院College:**學(xué)院開(kāi)設(shè)時(shí)間Semester:2021-09-03撰寫日期Date:2021-01-01匯編的總結(jié)PaperTitleinEnglish**〔計(jì)算機(jī)及信息工程學(xué)院計(jì)算機(jī)科學(xué)與技術(shù)專業(yè)2年級(jí)**〕論文類型PaperType:研究總結(jié)SummaryofFocusedResearch論及主題SubjectCovered:□□■□□**學(xué)院匯編的總結(jié)姓名〔計(jì)算機(jī)及信息工程學(xué)院計(jì)算機(jī)科學(xué)與技術(shù)專業(yè)2年級(jí)**〕Email:qq.摘要:作為最根本的編程語(yǔ)言之一,匯編語(yǔ)言雖然應(yīng)用的范圍不算很廣,但重要性卻勿庸置疑,因?yàn)樗軌蛲瓿稍S多其它語(yǔ)言所無(wú)法完成的功能。就拿Linu*內(nèi)核來(lái)講,雖然絕大局部代碼是用C語(yǔ)言編寫的,但仍然不可防止地在*些關(guān)鍵地方使用了匯編代碼,其中主要是在Linu*的啟動(dòng)局部。由于這局部代碼與硬件的關(guān)系非常密切,即使是C語(yǔ)言也會(huì)有些力不從心,而匯編語(yǔ)言則能夠很好揚(yáng)長(zhǎng)避短,最大限度地發(fā)揮硬件的性能。。關(guān)鍵詞:編匯應(yīng)用開(kāi)展匯編語(yǔ)言比機(jī)器語(yǔ)言易于讀寫、易于調(diào)試和修改,同時(shí)也具有機(jī)器語(yǔ)言執(zhí)行速度快,占內(nèi)存空間少等優(yōu)點(diǎn),但在編寫復(fù)雜程序時(shí)具有明顯的局限性,匯編語(yǔ)言依賴于具體的機(jī)型,不能通用,也不能在不同機(jī)型之間移植。是能完成一定任務(wù)的機(jī)器指令的集合。常說(shuō)匯編語(yǔ)言過(guò)時(shí),是低級(jí)語(yǔ)言,并不是說(shuō)匯編語(yǔ)言要被棄之,相反,匯編語(yǔ)言仍然是程序員必須了解的語(yǔ)言,在*些行業(yè)與領(lǐng)域,匯編是必不可少的,非它不可適用。只是,現(xiàn)在計(jì)算機(jī)最大的領(lǐng)域?yàn)镮T軟件,也是我們常說(shuō)的Windows編程,在熟練的程序員手里,使用匯編語(yǔ)言編寫的程序,運(yùn)行效率與性能比其它語(yǔ)言寫的程序是成倍的優(yōu)秀,但是代價(jià)是需要更長(zhǎng)的時(shí)間來(lái)優(yōu)化,如果對(duì)計(jì)算機(jī)原理及編程根底不扎實(shí),實(shí)在是得不償失,比照現(xiàn)在的軟件開(kāi)發(fā),已經(jīng)是市場(chǎng)化的軟件行業(yè),加上高級(jí)語(yǔ)言的優(yōu)秀與跨平臺(tái),一個(gè)公司不可以讓一個(gè)團(tuán)隊(duì)使用匯編語(yǔ)言來(lái)編寫所有的東西,花上幾倍甚至幾十倍的時(shí)間,不如使用其它語(yǔ)言來(lái)完成,只要最終結(jié)果不比匯編語(yǔ)言編寫的差太多,就能搶先一步完成,這是市場(chǎng)經(jīng)濟(jì)下的必然結(jié)果。匯編語(yǔ)言(6*)但是,至今為止,還沒(méi)有程序員敢斷定匯編語(yǔ)言是不需要學(xué)的,一個(gè)不懂匯編語(yǔ)言的程序員,只是三流的程序員,這是大局部人的共識(shí),同時(shí),技術(shù)匯編語(yǔ)言(AssemblyLanguage)是面向機(jī)器的程序設(shè)計(jì)語(yǔ)言精湛的匯編程序員,已經(jīng)脫離軟件開(kāi)發(fā),擠身于工業(yè)電子編程中,一個(gè)電子工程師,主要開(kāi)發(fā)語(yǔ)言就是匯編,c語(yǔ)言使用只占極少局部,而電子開(kāi)發(fā)工程師是千金難求,在一些工業(yè)公司,一個(gè)核心的電子工程師比其它任何職員待遇都高,比照起來(lái),一般電子工程師待遇是程序員的十倍以上。這種情況是因?yàn)楝F(xiàn)在學(xué)習(xí)匯編的人雖然也不少,但是真正能學(xué)到精通的卻不多,它難學(xué),難用,適用范圍小,雖然簡(jiǎn)單,但是過(guò)于靈活,學(xué)習(xí)過(guò)高級(jí)語(yǔ)言的人去學(xué)習(xí)匯編比一開(kāi)場(chǎng)學(xué)匯編的人難得多,但是學(xué)過(guò)匯編的人學(xué)習(xí)高級(jí)語(yǔ)言卻很容易,簡(jiǎn)從繁易,繁從簡(jiǎn)難??傊?,匯編語(yǔ)言是程序員的必修語(yǔ)言。目前國(guó)內(nèi)最好的匯編是"AoGo匯編小站〞。其站長(zhǎng)aogo,就是一個(gè)在工業(yè)方面有所成就的工程師,有意者可多參考。其次就是羅云彬的匯編站點(diǎn):這個(gè)大概是國(guó)內(nèi)建站時(shí)間最長(zhǎng)的匯編站點(diǎn),其編寫的"Windows下匯編語(yǔ)言程序設(shè)計(jì)"一書。是站長(zhǎng)十幾年的經(jīng)歷的集合,不妨看看。熟悉指令,可以嘗試破解,加強(qiáng)興趣,參考看雪學(xué)院,國(guó)內(nèi)最好的破解組織,其中看雪與眾高手打造的破解書"加密解密完全方案"非常有名。匯編語(yǔ)言是一種低級(jí)的程序語(yǔ)言可直接控制硬件。匯編語(yǔ)言是計(jì)算機(jī)最底層的語(yǔ)言,現(xiàn)在一般都用在硬件層,對(duì)硬件直接控制,其他的都用高級(jí)的語(yǔ)言編寫了,因?yàn)閰R編寫程序容易出錯(cuò),而且太過(guò)于復(fù)雜和長(zhǎng)啦,雖然引入了其他的有類似高級(jí)語(yǔ)言的一些偽指令但是相比高級(jí)語(yǔ)言可以解決的問(wèn)題都不用匯編啦。好似現(xiàn)在的計(jì)算機(jī)已經(jīng)增加了對(duì)C++還是什么語(yǔ)言〔反正就是高級(jí)語(yǔ)言〕的支持啦,就是開(kāi)集的引導(dǎo)程序已經(jīng)不用匯編啦〔好似只有為蘋果apple系統(tǒng)制作的機(jī)子有,微軟不知道為什么還沒(méi),不過(guò)不是技術(shù)問(wèn)題,據(jù)說(shuō)有其他目的〕。作為最根本的編程語(yǔ)言之一,匯編語(yǔ)言雖然應(yīng)用的范圍不算很廣,但重要性卻勿庸置疑,因?yàn)樗軌蛲瓿稍S多其它語(yǔ)言所無(wú)法完成的功能。就拿Linu*內(nèi)核來(lái)講,雖然絕大局部代碼是用C語(yǔ)言編寫的,但仍然不可防止地在*些關(guān)鍵地方使用了匯編代碼,其中主要是在Linu*的啟動(dòng)局部。由于這局部代碼與硬件的關(guān)系非常密切,即使是C語(yǔ)言也會(huì)有些力不從心,而匯編語(yǔ)言則能夠很好揚(yáng)長(zhǎng)避短,最大限度地發(fā)揮硬件的性能。按CPU不同的話根本每一種CPU都對(duì)應(yīng)一種匯編,比方Intel出的CPU可以算一個(gè)系列的,這些CPU在推出新版CPU的時(shí)候會(huì)根本保持向下兼容,就是原來(lái)低級(jí)CPU的指令在高級(jí)的CPU上也是一樣的,所以說(shuō)可以算作一類.另外還有單片機(jī)的匯編,單片機(jī)的指令和PC上CPU的指令是有出入的,所以另作一類按操作系統(tǒng)不同的話可以分為windows下匯編,DOS匯編等,雖然可能在一樣的CPU上運(yùn)行不同的操作系統(tǒng)(比方windows下的dos窗口),但不同的操作系統(tǒng)的程序設(shè)計(jì)是不一樣的,比方在DOS下你不可能去調(diào)用windows的API,在windows下也不可能去調(diào)用DOS的int21H中斷.另外*些單片機(jī)也有操作系統(tǒng)大多數(shù)情況下Linu*程序員不需要使用匯編語(yǔ)言,因?yàn)榧幢闶怯布?qū)動(dòng)這樣的底層程序在Linu*操作系統(tǒng)中也可以用完全用C語(yǔ)言來(lái)實(shí)現(xiàn),再加上GCC這一優(yōu)秀的編譯器目前已經(jīng)能夠?qū)ψ罱K生成的代碼進(jìn)展很好的優(yōu)化,確實(shí)有足夠的理由讓我們可以暫時(shí)將匯編語(yǔ)言拋在一邊了。但實(shí)現(xiàn)情況是Linu*程序員有時(shí)還是需要使用匯編,或者不得不使用匯編,理由很簡(jiǎn)單:精簡(jiǎn)、高效和libc無(wú)關(guān)性。假設(shè)要移植Linu*到*一特定的嵌入式硬件環(huán)境下,首先必然面臨如何減少系統(tǒng)大小、提高執(zhí)行效率等問(wèn)題,此時(shí)或許只有匯編語(yǔ)言能幫上忙了。匯編語(yǔ)言直接同計(jì)算機(jī)的底層軟件甚至硬件進(jìn)展交互,它具有如下一些優(yōu)點(diǎn):能夠直接訪問(wèn)與硬件相關(guān)的存儲(chǔ)器或I/O端口;能夠不受編譯器的限制,對(duì)生成的二進(jìn)制代碼進(jìn)展完全的控制;能夠?qū)﹃P(guān)鍵代碼進(jìn)展更準(zhǔn)確的控制,防止因線程共同訪問(wèn)或者硬件設(shè)備共享引起的死鎖;能夠根據(jù)特定的應(yīng)用對(duì)代碼做最正確的優(yōu)化,提高運(yùn)行速度;能夠最大限度地發(fā)揮硬件的功能。同時(shí)還應(yīng)該認(rèn)識(shí)到,匯編語(yǔ)言是一種層次非常低的語(yǔ)言,它僅僅高于直接手工編寫二進(jìn)制的機(jī)器指令碼,因此不可防止地存在一些缺點(diǎn):編寫的代碼非常難懂,不好維護(hù);很容易產(chǎn)生bug,難于調(diào)試;只能針對(duì)特定的體系構(gòu)造和處理器進(jìn)展優(yōu)化;開(kāi)發(fā)效率很低,時(shí)間長(zhǎng)且單調(diào)。匯編當(dāng)然可以寫網(wǎng)絡(luò)程序啦,高級(jí)語(yǔ)言可以做的匯編可以做,高級(jí)語(yǔ)言不可以做的匯編也可以做。IP探測(cè)的軟件一般都不用匯編,畢竟高級(jí)語(yǔ)言可以解決,但是匯編寫出來(lái)的沒(méi)有高級(jí)語(yǔ)言自身的一些限制,如平安性,可能對(duì)權(quán)限有限制。匯編可以應(yīng)用于單片機(jī),因?yàn)樗麄兒?jiǎn)單種類繁多,沒(méi)有操作系統(tǒng)〔開(kāi)發(fā)代價(jià)大,而且不劃算〕故用匯編,不過(guò)其他的涉及電子的根本上都可以用匯編一方面,匯編語(yǔ)言指令是用一些具有相應(yīng)含義的助憶符來(lái)表達(dá)的,所以,它要比機(jī)器語(yǔ)言容易掌握和運(yùn)用,但另一方面,它要直接使用CPU的資源,相對(duì)高級(jí)程序設(shè)計(jì)語(yǔ)言來(lái)說(shuō),它又顯得難掌握。匯編語(yǔ)言程序歸納起來(lái)大概有以下幾個(gè)主要特性。1、與機(jī)器相關(guān)性匯編語(yǔ)言指令是機(jī)器指令的一種符號(hào)表示,而不同類型的CPU有不同的機(jī)器指令系統(tǒng),也就有不同的匯編語(yǔ)言,所以,匯編語(yǔ)言程序與機(jī)器有著密切的關(guān)系。由于匯編語(yǔ)言程序與機(jī)器的相關(guān)性,所以,除了同系列、不同型號(hào)CPU之間的匯編語(yǔ)言程序有一定程度的可移植性之外,其它不同類型(如:小型機(jī)和微機(jī)等)CPU之間的匯編語(yǔ)言程序是無(wú)法移植的,也就是說(shuō),匯編語(yǔ)言程序的通用性和可移植性要比高級(jí)語(yǔ)言程序低。2、執(zhí)行的高效率正因?yàn)閰R編語(yǔ)言有"與機(jī)器相關(guān)性〞的特性,程序員用匯編語(yǔ)言編寫程序時(shí),可充分發(fā)揮自己的聰明才智,對(duì)機(jī)器內(nèi)部的各種資源進(jìn)展合理的安排,讓它們始終處于最正確的使用狀態(tài),這樣做的最終效果就是:程序的執(zhí)行代碼短,執(zhí)行速度快?,F(xiàn)在,高級(jí)語(yǔ)言的編譯程序在進(jìn)展存放器分配和目標(biāo)代碼生成時(shí),也都有一定程度的優(yōu)化(在后續(xù)課程"編譯原理"的有關(guān)章節(jié)會(huì)有詳細(xì)介紹),但由于所使用的"優(yōu)化策略〞要適應(yīng)各種不同的情況,所以,這些優(yōu)化策略只能在宏觀上,不可能在微觀上、細(xì)節(jié)上進(jìn)展優(yōu)化。而用匯編語(yǔ)言編寫程序幾乎是程序員直接在寫執(zhí)行代碼,程序員可以在程序的每個(gè)具體細(xì)節(jié)上進(jìn)展優(yōu)化,這也是匯編語(yǔ)言程序執(zhí)行高效率的原因之一。3、編寫程序的復(fù)雜性匯編語(yǔ)言是一種面向機(jī)器的語(yǔ)言,其匯編指令與機(jī)器指令根本上一一對(duì)應(yīng),所以,匯編指令也同機(jī)器指令一樣具有功能單一、具體的特點(diǎn)。要想完成*件工作(如計(jì)算:A+B+C等),就必須安排CPU的每步工作(如:先計(jì)算A+B,再把C加到前者的結(jié)果上)。另外,在編寫匯編語(yǔ)言程序時(shí),還要考慮機(jī)器資源的限制、匯編指令的細(xì)節(jié)和限制等等。由于匯編語(yǔ)言程序要安排運(yùn)算的每一個(gè)細(xì)節(jié),這就使得編寫匯編語(yǔ)言程序比擬繁瑣、復(fù)雜。一個(gè)簡(jiǎn)單的計(jì)算公式或計(jì)算方法,也要用一系列匯編指令一步一步來(lái)實(shí)現(xiàn)。4、調(diào)試的復(fù)雜性在通常情況下,調(diào)試匯編語(yǔ)言程序要比調(diào)試高級(jí)語(yǔ)言程序困難,其主要原因有四:匯編語(yǔ)言指令涉及到機(jī)器資源的細(xì)節(jié),在調(diào)試過(guò)程中,要清楚每個(gè)資源的變化情況;程序員在編寫匯編語(yǔ)言程序時(shí),為了提高資源的利用率,可以使用各種實(shí)現(xiàn)技巧,而這些技巧完全有可能破壞程序的可讀性。這樣,在調(diào)試過(guò)程中,除了要知道每條指令的執(zhí)行功能,還要清楚它在整個(gè)解題過(guò)程中的作用;高級(jí)語(yǔ)言程序幾乎不顯式地使用"轉(zhuǎn)移語(yǔ)句〞,但匯編語(yǔ)言程序要用到大量的、各類轉(zhuǎn)移指令,這些跳轉(zhuǎn)指令大大地增加了調(diào)試程序的難度。如果在匯編語(yǔ)言程序中也強(qiáng)調(diào)不使用"轉(zhuǎn)移指令〞,則,匯編語(yǔ)言程序就會(huì)變成功能單調(diào)的順序程序,這顯然是不現(xiàn)實(shí)的;調(diào)試工具落后,高級(jí)語(yǔ)言程序可以在源程序級(jí)進(jìn)展符號(hào)跟蹤,而匯編語(yǔ)言程序只能跟蹤機(jī)器指令。不過(guò),現(xiàn)在這方面也有所改善,CV(CodeView)、TD(TurboDebug)等軟件也可在源程序級(jí)進(jìn)展符號(hào)跟蹤了。綜上所說(shuō),匯編語(yǔ)言的特點(diǎn)明顯,其誘人的優(yōu)點(diǎn)直接導(dǎo)致其嚴(yán)重的缺點(diǎn),其"與機(jī)器相關(guān)〞和"執(zhí)行的高效率〞導(dǎo)致其可移植性差和調(diào)試難。所以,我們?cè)谶x用匯編語(yǔ)言時(shí)要根據(jù)實(shí)際的應(yīng)用環(huán)境,盡可能防止其缺點(diǎn)對(duì)整個(gè)應(yīng)用系統(tǒng)的影響。下面簡(jiǎn)單列舉幾個(gè)領(lǐng)域以示說(shuō)明,但不要把它們絕對(duì)化。1、適用的領(lǐng)域要求執(zhí)行效率高、反響快的領(lǐng)域,如:操作系統(tǒng)內(nèi)核,工業(yè)控制,實(shí)時(shí)系統(tǒng)等;系統(tǒng)性能的瓶頸,或頻繁被使用子程序或程序段;與硬件資源密切相關(guān)的軟件開(kāi)發(fā),如:設(shè)備驅(qū)動(dòng)程序等;受存儲(chǔ)容量限制的應(yīng)用領(lǐng)域,如:家用電器的計(jì)算機(jī)控制功能等;沒(méi)有適當(dāng)?shù)母呒?jí)語(yǔ)言開(kāi)發(fā)環(huán)境。2、不宜使用的領(lǐng)域大型軟件的整體開(kāi)發(fā);沒(méi)有特殊要求的一般應(yīng)用系統(tǒng)的開(kāi)發(fā)等。PaperTitleinEnglishNAMEName-name〔Student-No,College〕Email:"Abstract:Asoneofthemostbasicprogramminglanguage,assemblylanguage,althoughthescopeofapplicationisnotverywide,buttheimportanceisundoubtedly,becauseitcandomanyotherlanguagecanpletethefunctionof.TaketheLinu*kernel,althoughthevastmajorityofthecodeiswrittenusingClanguage,butstillinevitablyincertainkeyareasuseassemblycode,whichismainlyintheLinu*portionoftheboot.Duetothispartofthecodeandthehardwareoftherelationshipisveryclose,evenifistheClanguagealsowillbetheretoo,andassemblylanguagecanbeverygoodfosterstrengthsandcircumventweaknesses,toma*imizetheperformanceofhardware..Keywords:pilationApplicationDevelopmentAssemblylanguagemachinelanguageeasytoreadandwrite,iseasytodebugandmodify,whilealsohavingamachinelanguageisfast,occupythememoryspaceislittlewaitforanadvantage,butintheplicatedprogramminghasobviouslimitations,assemblylanguageisdependentonthespecificmodels,notgeneral,notindifferentmodelsoftransplantation.Istopleteacertaintaskmachineinstructionset.Assemblylanguageisoftensaid,isthelow-levellanguage,isnottosaythattheassemblylanguagetobeabandoned,incontrast,assemblylanguageisstilltheprogrammermustbeawareofthelanguage,andinsomeindustriesandfields,thepilationisessential,foritisnotapplicable.Just,nowthelargestfieldofputerfortheITsoftware,andweoftensaytheWindowsprogramming,inskilledprogrammer'shands,theuseofassemblylanguageprogramming,operationefficiencyandperformancethanotherlanguagesaremultipliedbytheelite,butthepriceistakelongertooptimize,iftheputerprincipleandprogrammingbasedonitisnotsolid,thelossoutweighsthegain.,paredwiththecurrentsoftwaredevelopment,isthemarketofthesoftwareindustry,coupledwithadvancedlanguagebestcrossplatform,apanymaynotmakeateamusingassemblylanguagetowriteallthethings,spendseveraltimesorevenseveraltimes,astheuseofotherlanguagesplete,aslongastheendresultthanassemblylanguagetoomuch,willthefirststep,thisistheinevitableresultofmarketeconomy.Assemblylanguage(6)but,sofar,noprogrammerbetassemblylanguageistolearn,donotknowaassemblylanguageprogrammers,justthreestreamprogrammers,thisisthemostmon,atthesametime,technologyofassemblylanguage(AssemblyLanguage)isamachineorientedlanguageskillsassemblylanguageprogrammers,hasbeenseparatedfromthesoftwaredevelopment,amongtheindustrialelectronicprogramming,anelectronicsengineer,mainlythedevelopmentoflanguageistheClanguagepilation,usingonlyasmallpercentof,whiletheelectronicdevelopmentengineerispriceless,insomeindustries,acoreelectronicengineersthananyotherstafftreatmentishigh,incontrastGeneralElectronicEngineer,programmertreatmentismorethantentimes.Thisisbecausethepresentstudythepilationofalthoughmany,butreallycanlearngoodnotmuchhowever,itisdifficult,difficulttouse,suitablescopeislittle,althoughsimple,buttoomuchfle*ibility,learningadvancedlanguagetolearnassemblythanstartedthepilationofrare,butlearnedassemblerpeoplelearnlanguagesveryeasily,Janefromple*ity,simplifyingdifficult.Inshort,theassemblylanguageisapulsorylanguageprogrammer.Currentlythebestpilationofsiteis"AoGoassemblystation".Theheadofaogo,isanindustrialachievementofengineer,thoseinterestedcanreferto.Ne*tisLuoYunbinassemblysite:Thisisprobablythehomestationforthelongesttimeassemblysite,itswrite"Windowsassemblylanguageprogramdesign"inabook.Thestationismorethan10yearsofe*perienceinthecollection,mayhavealook.Familiarwiththeinstruction,cantrytocrack,tostrengthentheinterest,referencetoseeSnowCollege,thebestdomesticcrackinggroup,whichseethesnowandthemastertocreatecrackbook"encryptionanddecryptionprogrampletely"isveryfamous.Assemblylanguageisalow-levelprogramminglanguagecandirectlycontrolthehardware.Assemblylanguageisaputeratthebottomofthelanguage,nowgenerallyusedinthehardwarelayer,todirecthardwarecontrol,othersusetheadvancedlanguage,becausetheprogramiseasytomakeamistake,butitistooplicatedandlong,althoughintroducedothersimilarseniorlanguageofsomepseudoinstructionbutparedwiththeadvancedlanguageitcansolvetheproblemwithoutpilation.NowitseemsthatputerhasbeenaddedtotheC++orwhatlanguage(itisahigh-levellanguage)support,issettoguidetheprocesshasnoassembly.(ifonlyfortheappleapplesystemmakingmachinewithMicrosoft,don'tknowwhyhehasn't,butisnotatechnicalproblem,issaidtohaveotherpurposes).Asoneofthemostbasicprogramminglanguage,assemblylanguage,althoughthescopeofapplicationisnotverywide,buttheimportanceisundoubtedly,becauseitcandomanyotherlanguagecanpletethefunctionof.TaketheLinu*kernel,althoughthevastmajorityofthecodeiswrittenusingClanguage,butstillinevitablyincertainkeyareasuseassemblycode,whichismainlyintheLinu*portionoftheboot.Duetothispartofthecodeandthehardwareoftherelationshipisveryclose,evenifistheClanguagealsowillbetheretoo,andassemblylanguagecanbeverygoodfosterstrengthsandcircumventweaknesses,toma*imizetheperformanceofhardware.AccordingtoCPUdifferentessentialeachkindofCPUcorrespondstoanassembly,suchastheIntelCPUcanbecountedasaseries,theCPUinlaunchinganewversionofCPUwillbasicallymaintaindownwardpatibility,istheoriginalgradeCPUinstructioninseniorCPUisthesame,socanbeconsideredasaclass.Anotherpilation,MCUinstructionsandPCCPUinstructionisdifferent,soaclassAccordingtotheoperatingsystemtodifferentwordscanbedividedintowindowspilation,DOSpilation,althoughpossibleinthesameCPUrunningondifferentoperatingsystem(suchasthewindowsDOSwindow),butadifferentoperatingsystemprogramdesignisnotthesameas,fore*ample,inDOSyouwon'tbeabletocallthewindowsAPI,inthewindowsalsoimpossibletocallDOSint21Hinterrupt.MoreoversomechipalsohasoperatingsystemMostcasesofLinu*programmersdonotneedtouseassemblylanguage,becauseeventhehardwaredriversthattheunderlyingprogramintheLinu*operatingsystemcanalsobeusedentirelyinClanguagetoachieve,plusGCCthise*cellentpilerhasbeenabletoultimatelygeneratethecodeofgoodoptimization,thereissufficientreasonforwecanputasidetheassemblylanguage.ButtheimplementationofLinu*programmerissometimesstillneedtouseapilation,ortousethepilation,thereasonisverysimple:streamlined,efficientandlibcindependence.SupposeyouwanttotransplantLinu*toagivenhardwareenvironment,firstofallmustfacehowtoreducethesystemsize,improvee*ecutionefficiencyandotherissues,thisisprobablytheonlyassemblylanguagecanhelp.Assemblylanguagedirectlywiththebottomlayeroftheputersoftwareandhardwaretointeract,ithasthefollowingadvantages:TobeabletodirectlyaccessthehardwarerelatedmemoryorI/Oport;Withoutbeingaffectedbythepiler,togeneratethebinarycodepletecontrol;Thekeycodetobemoreprecisecontrol,toavoidthemonthreadstoaccessorhardwaredevicesharedbyadeadlock;Accordingtospecificapplicationcodetodothebestoptimization,improvetheoperatingspeed;Toma*imizethefunctionofhardware.Atthesametimealsoshouldbeawareof,theassemblerlanguageisakindofverylowlevelsofthelanguage,itishigherthanthatofdirectwritingbinarymachinecodeinstruction,itinevitablyhassomeshortings:Codeisverydifficulttounderstand,notmaintenance;Itiseasytoproducebug,difficulttodebug;Onlyspecificarchitectureandprocessoroptimization;Thedevelopmentofefficiencyisverylow,longandboring.Assemblycancertainlywritenetworkprograms,high-levellanguagecandoassemblycanbedone,thehigh-levellanguagecannotdoassemblycanalsodo.IPdetectionsoftwareisgenerallynothigh-levellanguagepilation,afterall,canbesolved,butapilationofwrittenlanguageitselfwithoutadvancedsomerestrictions,suchassecurity,mayhaveontheauthorityrestriction.AssemblycanbeappliedtoSCM,becauseoftheirsimplevariety,nooperatingsystem(thepriceofdevelopmentoflarge,butnotworthwhile)theassembly,buttheotherrelatestoelectronbasicallycanbepiledononehand,assemblylanguageinstructionisusedwithsomecorrespondingmeaningmnemonicsymbolstoe*press,therefore,itshouldbeeasytomasterandusethanmachinelanguage,butontheotherhand,itistodirectlyusetheCPUresources,relativelyadvancedprogramminglanguage,itisdifficulttomaster.Assemblylanguageprogramissummedupaboutthefollowingmaincharacteristics.In1,andmachinecorrelationAssemblylanguageinstructionisakindofsymbolicmachineinstruction,anddifferenttypesofCPUhavedifferentmachineinstructionsystem,alsohavedifferentassemblylanguageassemblylanguageprogram,therefore,iscloselyrelatedwiththemachine.Astheassemblylanguageprogramandmachinecorrelation,so,inadditiontotheseries,variousmodelsofCPUbetweenassemblylanguageprocedureshaveacertaindegreeofportability,otherdifferenttypes(suchas:miniputerandmicroputeretc)betweentheCPUassemblylanguageprogramcannotbetransplanted,thatistosay,thegeneralassemblylanguageprogramandportabilitythanadvancedlanguageprogramislow.In2,theefficientimplementationBecauseofassemblylanguage"andtherelationshipbetweenthecharacteristicsofmachine",programmersuseassemblylanguageprogramming,cangivefullplaytotheirone'sabilityandcleverness,themachineinterioreachkindofresourcesforareasonablearrangement,sothattheywillalwaysbeinthebeststate,thefinalresultis:thee*ecutionoftheprogramcodeisshort,faste*ecutionspeed.Now,thehigh-levellanguagepilerinregisterallocationandobjectcodegeneration,alsohaveacertaindegreeofoptimization(inthefollow-upofthecourse"principles"totherelevantchaptershaveintroduced),butduetothe"optimization"toadapttodifferentsituations,therefore,theseoptimizationstrategiescanonlybemacroscopically,maynotbeinmicrocosmicon,detailsontheoptimization.Andtheuseofassemblylanguageprogrammingisalmostdirectlyinthee*ecutionofthewritecodeprogrammers,programmerscanintheprocedureforeachspecificdetailsontheoptimization,whichistheassemblylanguageprograme*ecutionefficiencyisoneofthereasons.3,writeaprogrample*ityTheassemblerlanguageisakindofmachinelanguage,assemblyinstructionsandmachineinstructionsbasicallyoneonecorresponding,so,assemblyinstructionswithmachineinstructionsasafunctionofasingle,specificcharacteristic.Wanttodosomething(suchasputing:A+B+C),CPUmustbearrangedeverystepofthejob(suchas:tocalculateA+B,thenCisappliedtotheresultoftheformer.).Inaddition,inthepreparationofassemblylanguageprograms,butalsoconsiderthemachineresourceconstraints,assemblerinstructiondetailsandsoon.Astheassemblylanguageprogramtoarrangetheoperationofeverydetail,whichmakeswritingassemblylanguageproceduresmorecumbersome,ple*.Asimplecalculationformulaormethodofcalculation,butalsowithaseriesofpilationinstructionsstepbysteptoachieve.4,debuggingple*ityInmostcases,debuggingassemblylanguageprogramtodebugprogramminglanguagedifficulties,themainreasonsare:four:Assemblylanguageinstructioninvolvesmachineresourcedetails,intheprocessofdebugging,tocleareachresourceschanges;Programmersinthepreparationofassemblylanguageprogram,inordertoimprovetheutilizationrateofresources,canuseavarietyoftechniques,butthesetechniquesmayhavepletelydestroyedthereadabilityoftheprogram.So,intheprocessofdebugging,inadditiontoknoweachinstructione*ecutionfunction,butalsoknowitintheprocessofsolvingthefunction;Advancedlanguageprogramalmostdonote*plicitlyusethe"transfer",buttheassemblylanguageprogramtousealotof,varioustypesoftransferinstructions,thejumpinstructionisgreatlyincreasedthedifficultyofdebuggingprogram.Iftheassemblylanguageprogramalsoemphasizesnotusing"instruction",then,theassemblylanguageprogramwillbeefunctionalmonotonicsequenceprogram,thisisclearlynotrealistic;Debuggingtoolisbackward,advancedlanguageprograminthesourceprogramlevelsymboltracking,andassemblylanguageprogramcanonlykeeptra

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論