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

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

生活随笔

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

编程问答

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

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

遞歸轉(zhuǎn)化成非遞歸過(guò)程

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:

眾所周知,過(guò)程是一組單獨(dú)編寫(xiě)的指令,可在需要時(shí)隨時(shí)在代碼中使用。 正常的過(guò)程執(zhí)行包括調(diào)用過(guò)程,將處理器的控制權(quán)移交給該過(guò)程,然后將控制權(quán)返回給調(diào)用程序。 可以很好地理解如下:

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

除此之外,我們有兩種特殊類型的過(guò)程: 遞歸過(guò)程和重入過(guò)程 ...

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:

遞歸過(guò)程是一個(gè)調(diào)用自身的過(guò)程。 這導(dǎo)致從過(guò)程內(nèi)部一次又一次地生成過(guò)程調(diào)用。 這可以理解為:

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.

遞歸過(guò)程將繼續(xù)執(zhí)行,直到達(dá)到終止條件為止。 遞歸過(guò)程非常有效地使用和實(shí)施,但是它們占用了大量的堆棧空間,并且過(guò)程中的過(guò)程鏈接需要花費(fèi)更多的時(shí)間,并且會(huì)給處理器帶來(lái)額外的負(fù)擔(dān)。

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:

重入過(guò)程是一種非常特殊的過(guò)程。 在這種過(guò)程中,過(guò)程1稱為主線程序,然后過(guò)程2稱為表單過(guò)程1,然后過(guò)程1又稱為表單過(guò)程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.

這稱為重入過(guò)程,因?yàn)橐粋€(gè)過(guò)程從另一個(gè)過(guò)程重新進(jìn)入自身,該另一個(gè)過(guò)程也存在于其自身內(nèi)部。 重入過(guò)程在以下三種情況下發(fā)生:當(dāng)過(guò)程進(jìn)行遞歸時(shí),在程序內(nèi)部實(shí)現(xiàn)多線程時(shí)或在生成某些中斷時(shí)。 像遞歸過(guò)程一樣,在重入過(guò)程中也要有一個(gè)終止條件,這一點(diǎn)也很重要,否則由于無(wú)限的過(guò)程調(diào)用,我們可能會(huì)遇到機(jī)器暫停的情況。

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

遞歸轉(zhuǎn)化成非遞歸過(guò)程

總結(jié)

以上是生活随笔為你收集整理的递归转化成非递归过程_8086微处理器中的递归和重入过程的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

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