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

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

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

發布時間:2025/3/11 编程问答 24 豆豆
生活随笔 收集整理的這篇文章主要介紹了 递归转化成非递归过程_8086微处理器中的递归和重入过程 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

遞歸轉化成非遞歸過程

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。這可以從下圖中很好地理解:

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微处理器中的递归和重入过程的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。