DATA SEGMENT
JDCZ DB 20,30,15,10,20,28,22,25,25,20,15,27,10,20,15,10
cz DB 75 ,95 ,87 ,55
F1 db '100>$'
F2 db ' 90>$'
F3 db ' 80>$'
F4 db ' 60>$'
F5 db '>=90 1$'
F6 db '>=80 1$'
F7 db '>=60 1$'
F8 db ' 1$'
F9 db ' ZCZ=312$'
DATA ENDS
STACK SEGMENT STACK
DW 100 DUP(?)
STACK ENDS
CODE SEGMENT
ASSUME CS:CODE, DS:DATA, SS:STACK
MAIN PROC FAR
MOV AX,DATA
MOV DS,AX
;将数据载入寄存器
CALL WWB
;调用子程序WWB
mov dl,20h
mov ah,2
int 21h
mov dl,0dh
int 21h
mov dl,0ah
int 21h
;-----转行-----
LEA SI,cz ;将CZ数据首地址存入SI
call zsc
mov ah,4ch
int 21h ;终断程序
MAIN ENDP
;--------------数字输出子程序----------------
shuzi proc near
mov bl,10d
mov cx,2
lp: mov ah,0
div bl
mov dl,ah
push dx
loop lp
mov cx,2
mov ah,2
ye: pop dx
add dl,30h
int 21h
loop ye
ret
shuzi endp
;----------数据矩阵输出子程序----------------
WWB proc near
MOV DH,0
MOV BH,0 ;寄存器清零
LEA SI,JDCZ
;将JDCZ数据首地址存入SI
COUN:
MOV AL,[SI]
CALL SHUZI ;调用子程序SHUZI
mov dl,20h
mov ah,2
int 21h ;空格
INC SI ;SI地址加1
INC BH ;循环次数加1
CMP BH,4 ;设置内循环次数
JL COUN
Mov dl,20h
Mov ah,2
int 21h
mov dl,0dh
int 21h
mov dl,0ah
int 21h
MOV BH,0
INC DH ;外循环加1
CMP DH,4 ;设置外循环次数
JL COUN ret
WWB endp
;----输出产值范围及总产值子程序------
ZSC proc near
lea DX,F1
mov ah,9
int 21h ;输出F1
mov al,[si+1]
call shuzi
lea dx,f5
mov ah,9
int 21h ;输出F5
mov dl,20h
mov ah,2
int 21h
mov dl,0dh
int 21h
mov dl,0ah
mov al,[si+2]
call shuzi
lea dx,f6
mov ah,9
int 21h ;输出F6
mov dl,20h
mov ah,2
int 21h
mov dl,0dh
int 21h
mov dl,0ah
int 21h ; 转行
lea DX,F3
mov ah,9
int 21h 输出F3
mov al,[si]
call shuzi
lea dx,f7
mov ah,9
int 21h ;输出F7
mov dl,20h
mov ah,2
int 21h
mov dl,0dh
int 21h
mov dl,0ah
int 21h ;转行
lea DX,F4
mov ah,9
int 21h ;输出F4
mov al,[si+3]
mov dl,20h
mov ah,2
int 21h
mov dl,0dh
int 21h
mov dl,0ah
int 21h ;转行
mov dl,20h
mov ah,2
int 21h
mov dl,0dh
int 21h
mov dl,0ah
int 21h ;转行
lea dx,F9
mov ah,9
int 21h 输出F9
ret
ZSC endp
code ends
end
使用DEBUG调试过程
编译连接程序显示为如图4.1
上一页 [1] [2] [3] [4] [5] [6] 下一页