日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

微内核和宏内核的区别_8086微处理器中的过程和宏之间的区别

發(fā)布時(shí)間:2023/12/1 编程问答 42 豆豆
生活随笔 收集整理的這篇文章主要介紹了 微内核和宏内核的区别_8086微处理器中的过程和宏之间的区别 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

微內(nèi)核和宏內(nèi)核的區(qū)別

Prerequisite

先決條件

  • Procedure in 8086 Microprocessor

    8086微處理器中的過(guò)程

  • Macros in 8086 Microprocessor

    8086微處理器中的宏

過(guò)程和宏之間的區(qū)別 (Differences between Procedures and Macros )

CharacteristicProcedureMacro
Number of Instructions that can be effectively handled by the microprocessorIt is better to use Procedures for a set of a large number of instructions. Hence, it is optimal to use Procedures when the number of instructions is more than 10.Macros are useful over Procedures when the number of instructions in the set is less. Therefore, when the subprogram contains less than 10 instructions, Macros are more efficient to use in such cases.
Assembler Directives usedThe assembler directive - PROC is used to define a Procedure. And the assembler directive - ENDP is used to indicate that the body of the procedure has ended.The assembler directive- MACRO is used to define a Macro, And to indicate that the body of the procedure has ended, the assembler directive- ENDM is used.
Execution Process Every time a procedure is called, the CALL and RET instructions are required for shifting the control of instruction execution. Every time a Macro is called, the assembler of the microprocessor places the entire set of instructions of the Macros in the mainline program form where the call to the macro is made.
Execution TimeThe Procedures execute slower than the Macros because every time a procedure is called, it is necessary to integrate and link it with the calling program and this takes time.?The execution of macros is faster as compared to procedures because there is no need to integrate or link the macros with the calling program. It is simply loaded into the main memory every time it is called.
Overhead timeOverhead time occurs while calling the procedure and returning the control to the calling program.?Overhead time is avoided as calling and returning does not take place.
Amount of memory requiredThe Procedures require less amount of memory than the Macros because a Procedure is written and loaded into the main memory only once, and is linked to the calling program when called.The Macros require a large amount of memory because it is loaded into the main memory every time it is called.
Number of times machine code generatedThe machine code (containing the instructions within the Procedure) is generated only once when the procedure is defined.The machine code (containing the instructions within the Macros) is generated every time the macro is called.
Passing of parametersIn procedures, we cannot pass the parameter to id directly. However, the values can be passed to it using registers and also via stack.The macros are capable of handling parameters within their definition and we can pass them in the statement which calls the macro.
特性 程序 巨集
微處理器可以有效處理的指令數(shù) 最好將過(guò)程用于大量指令集。 因此,當(dāng)指令數(shù)大于10時(shí),最好使用過(guò)程。 當(dāng)集合中的指令數(shù)較少時(shí),宏比過(guò)程有用。 因此,當(dāng)子程序包含少于10條指令時(shí),在這種情況下使用宏會(huì)更有效。
所使用的匯編程序指令 匯編程序指令-PROC用于定義過(guò)程。 匯編程序指令ENDP用于指示過(guò)程主體已結(jié)束。 匯編程序指令MACRO用于定義宏,并指示程序的主體已結(jié)束,因此使用匯編程序指令ENDM。
執(zhí)行過(guò)程 每次調(diào)用一個(gè)過(guò)程時(shí),都需要CALL和RET指令來(lái)轉(zhuǎn)移對(duì)指令執(zhí)行的控制。 每次調(diào)用宏時(shí),微處理器的匯編程序都將宏的整個(gè)指令集置于主程序形式中,以進(jìn)行宏調(diào)用。
執(zhí)行時(shí)間處理時(shí)間 這些過(guò)程的執(zhí)行速度比宏要慢,因?yàn)槊看握{(diào)用一個(gè)過(guò)程時(shí),都需要將其與調(diào)用程序集成和鏈接,這需要時(shí)間。 與過(guò)程相比,宏的執(zhí)行速度更快,因?yàn)椴恍枰獙⒑昱c調(diào)用程序集成或鏈接。 每次調(diào)用時(shí),它都被簡(jiǎn)單地加載到主存儲(chǔ)器中。
開銷時(shí)間 在調(diào)用過(guò)程并將控件返回到調(diào)用程序時(shí)會(huì)發(fā)生開銷時(shí)間。 避免了開銷時(shí)間,因?yàn)椴粫?huì)進(jìn)行呼叫和返回。
所需的內(nèi)存量 與宏相比,過(guò)程只需要較少的內(nèi)存,因?yàn)檫^(guò)程只寫入一次并加載到主存儲(chǔ)器中,并且在調(diào)用時(shí)鏈接到調(diào)用程序。 宏需要大量的內(nèi)存,因?yàn)槊看握{(diào)用宏時(shí)都會(huì)將其加載到主內(nèi)存中。
機(jī)器代碼生成的次數(shù) 定義過(guò)程后,機(jī)器代碼(包含過(guò)程中的指令)僅生成一次。 每次調(diào)用宏時(shí)都會(huì)生成機(jī)器代碼(包含宏中的指令)。
參數(shù)傳遞 在過(guò)程中,我們無(wú)法將參數(shù)直接傳遞給id。 但是,可以使用寄存器以及通過(guò)堆棧將值傳遞給它。 宏能夠在其定義內(nèi)處理參數(shù),我們可以在調(diào)用該宏的語(yǔ)句中傳遞它們。

翻譯自: https://www.includehelp.com/embedded-system/procedures-vs-macros-in-8086-microprocessors.aspx

微內(nèi)核和宏內(nèi)核的區(qū)別

創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎(jiǎng)勵(lì)來(lái)咯,堅(jiān)持創(chuàng)作打卡瓜分現(xiàn)金大獎(jiǎng)

總結(jié)

以上是生活随笔為你收集整理的微内核和宏内核的区别_8086微处理器中的过程和宏之间的区别的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。