微内核和宏内核的区别

Prerequisite

先决条件

  • Procedure in 8086 Microprocessor

    8086微处理器中的过程

  • Macros in 8086 Microprocessor

    8086微处理器中的宏

过程和宏之间的区别 (Differences between Procedures and Macros )

Characteristic Procedure Macro
Number of Instructions that can be effectively handled by the microprocessor It 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 used The 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 Time The 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 time Overhead 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 required The 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 generated The 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 parameters In 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.
特性 程序 巨集
微处理器可以有效处理的指令数 最好将过程用于大量指令集。 因此,当指令数大于10时,最好使用过程。 当集合中的指令数较少时,宏比过程有用。 因此,当子程序包含少于10条指令时,在这种情况下使用宏会更有效。
所使用的汇编程序指令 汇编程序指令-PROC用于定义过程。 汇编程序指令ENDP用于指示过程主体已结束。 汇编程序指令MACRO用于定义宏,并指示程序的主体已结束,因此使用汇编程序指令ENDM。
执行过程 每次调用一个过程时,都需要CALL和RET指令来转移对指令执行的控制。 每次调用宏时,微处理器的汇编程序都将宏的整个指令集置于主程序形式中,以进行宏调用。
执行时间处理时间 这些过程的执行速度比宏要慢,因为每次调用一个过程时,都需要将其与调用程序集成和链接,这需要时间。 与过程相比,宏的执行速度更快,因为不需要将宏与调用程序集成或链接。 每次调用时,它都被简单地加载到主存储器中。
开销时间 在调用过程并将控件返回到调用程序时会发生开销时间。 避免了开销时间,因为不会进行呼叫和返回。
所需的内存量 与宏相比,过程只需要较少的内存,因为过程只写入一次并加载到主存储器中,并且在调用时链接到调用程序。 宏需要大量的内存,因为每次调用宏时都会将其加载到主内存中。
机器代码生成的次数 定义过程后,机器代码(包含过程中的指令)仅生成一次。 每次调用宏时都会生成机器代码(包含宏中的指令)。
参数传递 在过程中,我们无法将参数直接传递给id。 但是,可以使用寄存器以及通过堆栈将值传递给它。 宏能够在其定义内处理参数,我们可以在调用该宏的语句中传递它们。

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

微内核和宏内核的区别

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

  1. Spring MVC和REST中@RestController和@Controller注释之间的区别

    Spring MVC中的@RestController注释不过是@Controller和@ResponseBody注释的组合. 它已添加到Spring 4.0中,以简化在Spring框架中RESTfu ...

  2. C#中的结构和类之间的区别

    C#类和结构 (C# class and structure) In C# and other programming languages, structure and classes are use ...

  3. SQL 中的=,in,like之间的区别

    SQL中的=,in,like之间的区别: 三者都可以用来进行数据匹配 .但三者并不相同. 等号是用来查找与单个值匹配的所有数据: IN 是 用来查找与多个值匹配的所有数据: 而 LIKE用来查找与一个 ...

  4. mysql insert into values select_mysql中insert语句中,value与values之间的区别?

    你的位置: 问答吧 -> JAVA -> 问题详情 mysql中insert语句中,value与values之间的区别? mysql> select * from tt; +---- ...

  5. call和ret指令_8086微处理器中的CALL和RET指令

    call和ret指令 8086微处理器中的CALL指令 (The CALL instruction in the 8086 microprocessor) The CALL instruction i ...

  6. java和python的web自动化有什么区别-Java Web开发和Python Web开发之间的区别

    今天的文章讨论了Java Web开发和Python Web开发之间的区别.我不鼓励我们在这里从Java Web迁移到Python Web开发.我只是想谈谈我的感受.它不一定适合所有情况,仅供我们参考. ...

  7. 计算机操作系统32跟64区别是什么,32位和64位计算机操作系统之间的区别32位和64位win7系统之间的区别...

    32位和64位Win7系统之间的区别是一个古老的话题,但是许多朋友仍然不了解它.两者有什么区别?下面的文章介绍了32位和64位Win7系统之间的区别,以及其他一些深入的理论解释.您可以在文章末尾查看扩 ...

  8. c语言中的typedef struct相当于java的一个类?,C ++中'struct'和'typedef struct'之间的区别?...

    在C ++中,之间有什么区别: struct Foo { ... }; 和 typedef struct { ... } Foo; #1楼 您不能对typedef结构使用forward声明. stru ...

  9. Spring MVC中@RequestParam和@PathVariable批注之间的区别?

    Spring MVC框架是在Java世界中开发Web应用程序最流行的框架之一,它还提供了一些有用的注释,可以从传入的请求中提取数据并将请求映射到控制器,例如@ RequestMapping,@ Req ...

最新文章

  1. Cocos2d入门--3--向量的应用
  2. Spring读取jar包外部的配置文件properties
  3. java中文版src_java Web开发医药后台管理系统mysql版本源代码下载,支持中英文
  4. 咸宁书写桂花产业-国情研究·万祥军:特色农业谋定大健康
  5. mysql忽略列,MySQL:使用DISTINCT时忽略选定的列
  6. FFmpeg 硬件加速方案概览 (上)
  7. 开发第一个Meeting App
  8. ASP.NET Core分布式项目实战(Consent Controller Get请求逻辑实现)--学习笔记
  9. 今天日期减去过去日期_汽车各零部件也有身份证,教你们如何看这些部件的quot;出生日期quot;...
  10. 【FFMPEG系列】之打印调试
  11. 互联网晚报 | 7月27日 星期三 | 微信安装包11年膨胀575倍;阿里申请香港纽约双重主要上市;苹果应用商店被曝大量色情应用...
  12. spring-cloud-kubernetes的服务发现和轮询实战(含熔断)
  13. 网站注册登录等短信验证码
  14. 传鸿蒙操作系统掌舵人王成录已从华为离职
  15. win10计算机管理没有蓝牙,Win10蓝牙在哪里?Win10蓝牙设置关闭或开启方法图解
  16. 【论文阅读笔记】Automatic Liver and Lesion Segmentation in CT Using Cascaded Fully Convolutional Neural Net
  17. PyTorch Mobile在端侧可堪大用?能否与TensorFlow Lite一较高下
  18. 各种“保险”英语怎么说?
  19. linux:ls、ls -l、ls -al区别
  20. 74LS161计数器+cd4046锁相环

热门文章

  1. uni-app运行编译报错
  2. js操作json方法总结
  3. mysql binlog空间维护
  4. html笔记(三)html5+css3(html5、css3、文字相关)
  5. 【laravel】【转发】laravel 导入导出excel文档
  6. 简单利用HTTP中的PUT协议拿下SHELL
  7. 2016年,我的和自己谈谈
  8. node.js 初体验
  9. android unbound prefix
  10. qt 试用 (3)配置编译源代码及调试