“buf1 equ 2200h buf2 equ 2250h buf3 equ 22a0h stack segment sp1 db 20 dup(0) stack ends code segment assume cs:code,ss:stack beg proc far start: mov ax,0h mov ds,ax mov ax,stack mov ss,ax mov bx,buf1 mov al,0ah call fmov mov bx,buf2 mov al,0bh call fmov mov bx,buf3 mov al,55h call fmov jmp start fmov proc near mov cx,16 fmov_lop: mov [bx],al inc bx loop fmov_lop ret endp code ends end beg”的流程图
时间: 2024-02-10 14:09:49 浏览: 138
以下是该程序的流程图:
```
+---------------------+
| start |
| (far proc) |
| |
| +------------+ |
| | mov ax,0h | |
| | mov ds,ax | |
| | mov ax,stack| |
| | mov ss,ax | |
| +------------+ |
| |
| +------------+ |
| | mov bx,buf1| |
| | mov al,0ah | |
| | call fmov | |
| +------------+ |
| |
| +------------+ |
| | mov bx,buf2| |
| | mov al,0bh | |
| | call fmov | |
| +------------+ |
| |
| +------------+ |
| | mov bx,buf3| |
| | mov al,55h | |
| | call fmov | |
| +------------+ |
| |
| +------------+ |
| | jmp start | |
| +------------+ |
| |
+---------------------+
+---------------------+
| fmov |
| (near proc) |
| |
| +------------+ |
| | mov cx,16 | |
| | fmov_lop: | |
| | mov [bx],al| |
| | inc bx | |
| | loop fmov_lop| |
| +------------+ |
| | ret | |
| +------------+ |
| |
+---------------------+
```
程序分为两个过程,一个是主程序start,另一个是子程序fmov。
start中,首先设置DS寄存器为0,SS寄存器为堆栈段的基地址,然后依次调用fmov子程序,将三个内存区域写入指定的数据,最后通过jmp指令跳转到start标记,实现程序循环执行。
fmov子程序中,使用了循环结构和MOV指令,将AL寄存器中的值写入指定的内存单元。其中,使用了LOOP指令实现循环。
阅读全文