代码:
EXTRN LOAD:FAR,SAVE:FAR
N EQU 20
DELTA EQU 5
STAC SEGMENT STACK
DB 128 DUP (?)
STAC ENDS
DATA SEGMENT
SOURCE DB N DUP(?)
RESULT DB N DUP(0)
NAME0 DB 'INPUT38.DAT ',0
NAME1 DB 'OUTPUT38.DAT ',0
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE, DS:DATA, SS:STAC
START PROC FAR
PUSH DS
XOR AX,AX
PUSH AX
MOV AX,DATA
MOV DS,AX
LEA DX,SOURCE ; 数据区起始地址
LEA SI,NAME0 ; 原始数据文件名起始地址
MOV CX,N ; 字节数
CALL LOAD ; 从 "input1.dat "中读取数据
LEA SI,SOURCE
LEA DI,RESULT