汇编语言求阶乘逻辑框图
时间: 2023-07-01 11:14:20 浏览: 92
以下是求阶乘的汇编语言逻辑框图:
```
+-----+ +-----+
| | | |
| | | |
| | | |
| | | |
| X | | BX |
| | | |
| | | |
| | | |
| | | |
+-----+ +-----+
| |
| |
| |
| |
| |
| |
| |
+-----+ +-----+
| | | |
| | | |
| | | |
| | | |
| 1:0 | | DX |
| | | AX |
| | | |
| | | |
| | | |
+-----+ +-----+
| |
| |
| |
| |
| |
| |
| |
+-----+ +-----+
| | | |
| | | |
| | | |
| | | |
| | | |
| * | | |
| | | |
| | | |
| | | |
+-----+ +-----+
| |
| |
| |
| |
| |
| |
| |
+-----+ +-----+
| | | |
| | | |
| | | |
| | | |
| X-1 | | BX |
| | | |
| | | |
| | | |
| | | |
+-----+ +-----+
| |
| |
| |
| |
| |
| |
| |
| |
+-----+ +-----+
| | | |
| | | |
| | | |
| | | |
| CMP| | |
| | | |
| | | |
| | | |
| | | |
+-----+ +-----+
| |
| |
| |
| |
| |
| |
+------+ +------+
| | | |
| | | |
| | | |
| | | |
| | | |
|JNE | | LOOP1|
| | | |
| | | |
| | | |
+------+ +------+
```
其中,X表示要计算阶乘的数,BX存储X的值,DX:AX存储计算结果,初始化为1。LOOP1为一个循环,每次循环将BX减1,然后将DX:AX与BX相乘,直到BX为0。最后,如果BX不为0,则跳转到LOOP1继续循环,否则结束循环。
阅读全文