刚学,还不怎么上手,弄半天成这样~请看看有什么地方不对
STACK_SEG ENDS
DATA_SEG SEGMENT PARA
TS DB 'HOW ARE YOU -! ',0DH,0AH
COUNT DDW$-TS
DATA_SEG STACK_SEG SEGMENT STACK
STACK_BUF DW 120 DUP(?)
TOP EQU $-STACK_BUF
ENDS
CODE_SEG SEGMENT PARA
;------------------------------------------------------
MAIN PROC FAR
ASSUME CS:CODE_SEG,DS:DATA_SEG
ASSUME SS:STACK_SEG
START:
MOV AX,STACK_SEG
MOV SS,AX
MOV SP,TOP
MOV AX,DATA_SEG
MOV DS,AX
L: MOV BX,OFFSET TS
MOV CX, COUNT
LL: MOV AH,2
MOV DL,[BX]
INT 21H
INC BX
LOOP LL
MOV CX,COUNT
CALL SUBP ;调用子程序显示COUNT的值
MOV AH,1
INT 21H
SUBP PROC
PUSH DX
PUSH AX
MOV AX,CX
AAM
OR AX,3030H
PUSH AX
MOV DL,AH
MOV AH,2
INT 21H
POP DX
MOV AH,2
INT 21H
POP AX
POP DX
RET
SUBP ENDP
MOV AX,4C00H
INT 21H
MAIN ENDP
;------------------------------------------------------
CODE_SEG ENDS
END START