递归转化成非递归过程

As we all know that a procedure is a set of instruction written separately which can be used any time in the code when required. A normal procedure execution includes calling of the procedure, shifting the control of the processor to the procedure, and then returning the control to the calling program. This can be well understood as follows:

众所周知,过程是一组单独编写的指令,可在需要时随时在代码中使用。 正常的过程执行包括调用过程,将处理器的控制权移交给该过程,然后将控制权返回给调用程序。 可以很好地理解如下:

Apart from this, we have two special types of procedures: Recursive Procedures and Re-entrant procedures...

除此之外,我们有两种特殊类型的过程: 递归过程和重入过程 ...

1)递归程序 (1) Recursive procedures)

A recursive procedure is a procedure which calls itself. This results in the procedure call to be generated from within the procedures again and again. This can be understood as follows:

递归过程是一个调用自身的过程。 这导致从过程内部一次又一次地生成过程调用。 这可以理解为:

Image reference: https://images.app.goo.gl/kyJgWtWnF5faQfTe7

图片参考:https://images.app.goo.gl/kyJgWtWnF5faQfTe7

The recursive procedures keep on executing until the termination condition is reached. The recursive procedures are very effective to use and to implement but they take a large amount of stack space and the linking of the procedure within the procedure takes more time as well as puts extra load on the processor.

递归过程将继续执行,直到达到终止条件为止。 递归过程非常有效地使用和实施,但是它们占用了大量的堆栈空间,并且过程中的过程链接需要花费更多的时间,并且会给处理器带来额外的负担。

2)重入程序 (2) Re-entrant procedures)

The re-entrant procedure is a very special kind of procedure. In such kind of procedure, procedure 1 is called the mainline program, then procedure 2 is called form procedure 1 and then again procedure 1 is called form procedure 2. This can be well understood from the following diagram:

重入过程是一种非常特殊的过程。 在这种过程中,过程1称为主线程序,然后过程2称为表单过程1,然后过程1又称为表单过程2。这可以从下图中很好地理解:

Recursive and Re-entrant Procedures in 8086 Microprocessor (3)

Image reference: https://images.app.goo.gl/HKw5j6K6HQk79ki29

图片参考:https://images.app.goo.gl/HKw5j6K6HQk79ki29

This is called a re-entrant procedure because a procedure is re-entering into itself form another procedure which is also present inside its own body. The re-entrant procedure occurs in the following three conditions: when the procedure is undergoing recursion, when multi-threading is being implemented inside a program or when some interruption is being generated. Like the recursive procedures, it is important to have a termination condition for the procedures in the re-entrant procedures also, else we can face machine halts due to infinite procedure calls.

这称为重入过程,因为一个过程从另一个过程重新进入自身,该另一个过程也存在于其自身内部。 重入过程在以下三种情况下发生:当过程进行递归时,在程序内部实现多线程时或在生成某些中断时。 像递归过程一样,在重入过程中也要有一个终止条件,这一点也很重要,否则由于无限的过程调用,我们可能会遇到机器暂停的情况。

翻译自: https://www.includehelp.com/embedded-system/recursive-and-re-entrant-procedures-in-8086-microprocessor.aspx

递归转化成非递归过程

递归转化成非递归过程_8086微处理器中的递归和重入过程相关推荐

  1. 规范化的递归转换成非递归

    递归函数被调用时,系统需要一个运行栈.系统的运行栈要保存函数的返回地址,保存调用函数的局部变量,每一层递归调用所需保存的信息构成运行栈的一个工作记录,在没进入下一层递归调用是,系统就会建立一个新的工作 ...

  2. 递归改写成非递归的两种套路 Python实现

    树的遍历 所有遍历方式,这一篇就够了 生成随机二叉树并彩色打印 喜欢的话,记得点赞和收藏哟! 1 模拟系统调用栈 编译器使用堆栈传递函数参数.保存返回地址等.这里我们把子问题的参数都压入栈中,通过顺序 ...

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

    微内核和宏内核的区别 Prerequisite 先决条件 Procedure in 8086 Microprocessor 8086微处理器中的过程 Macros in 8086 Microproce ...

  4. 递归javascript_使用freeCodeCamp挑战解释了JavaScript中的递归

    递归javascript In this article I will touch on a few important ideas to help you understand Recursion ...

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

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

  6. 通用apdu指令_8086微处理器中的通用指令格式

    通用apdu指令 Introduction: 介绍: In this article, we are going to discuss about the 6 general formats of i ...

  7. 逻辑地址物理地址计算_8086微处理器中的物理地址计算问题

    逻辑地址物理地址计算 Q1) The value of Code Segment (CS) Register is 4042H and the value of different offsets i ...

  8. 如何将问卷结果转化成相应的数据放在spss中进行分析

    首先,将问卷的原始数据导出,如果问卷中有很多矩阵题,需要根据题目分别导出. 对问卷中的答案进行赋值,因为spss不能分析文本类内容,所以需要将所选的选项用数字赋值 以这样的方式制作excel表格 此时 ...

  9. 在游戏中实现语音聊天和语音转化成文字

    今天碰到一个任务就是在游戏中添加语音聊天功能,并且需要将语音转化成文本信息,在聊天界面显示. 当然这种功能专业性太强,我们就只能选择使用第三方SDK来实现了. 国内做的语音识别比较好的就是科大讯飞,不 ...

最新文章

  1. nginx重定向到其他url方法_高级开发必须掌握Nginx之四,if、set、return
  2. python标准库有多强大_Python标准库——走马观花
  3. CubieBoard开发板不用ttl线也不用hdmi线的安装方法
  4. 文件上传下载-准备上传页面
  5. Python遍历字典的四种方法对比
  6. 互联网教育+大数据=新型大学?
  7. hql 查询关联对象_在spring data jpa中如何做报表统计查询?
  8. 时序分析基本概念介绍——SDC概述
  9. 0配置EF连接MySql数据库_第八节:EF Core连接MySql数据库
  10. 吴恩达机器学习详细总结(三)
  11. 基于嵌入式linux的设计与实现,基于嵌入式Linux图片浏览器的设计与实现
  12. 抖音火爆表白小程序(C#语言实现)
  13. 周口女子职专计算机分为哪些专业,周口女子职业中专学校
  14. leetcode 罗马数字与整数的转换算法
  15. Paddle 印刷电路板(PCB)瑕疵检测
  16. 数字化汗字中仲字如化数字化_如何将旧的电影照片数字化
  17. javascript join()
  18. 解决“我们注意到您的计算机目前处于离线状态。您需要连接网络以使用EA”
  19. XSS挑战之旅 解题记录
  20. 【案例】蜂巢链:基于区块链的资产证劵化

热门文章

  1. f3arra1n3.4.1版本_Sysmon v11.1新版本功能测试报告
  2. 用python程序编写二元多项式_Python多项式回归的实现方法
  3. java文件序列化_Java序列化与反序列化,文件操作
  4. Pytorch:数据并行和模型并行,解决训练过程中内存分配不均衡的问题
  5. 云主机tracert外网无返回需在安全组入方向加ICMP Time Exceeded TTLexpired in transit
  6. [前端漫谈] 做一个四则计算器
  7. shell 查出文件并复制到另一个文件夹
  8. JavaScript--变量、作用域及内存(12)
  9. 神啊,6小时30分钟,完成想要的所有Lync测试
  10. 详解:设计模式之-单例设计模式