DATA SEGMENT
BUF1 DB 200
DB ?
DB 200 DUP(?)
BUF2 DB 200
DB ?
DB 200 DUP(?)
CTRL DB 0AH,0DH,'$'
DATA ENDS
STACK SEGMENT
DB 200 DUP(?)
STACK ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA,SS:STACK
START:
MOV AX,DATA
MOV DS,AX
LEA DX,BUF1
MOV AH,10
INT 21H
LEA DX,CTRL
MOV AH,9
INT 21H
MOV CL,BUF1+1
LEA SI,BUF1+2
InStack:
MOV DX,[SI]
PUSH DX
INC SI
DEC CL
JNZ InStack
MOV CL,BUF1+1
LEA SI,BUF2
OutStack:
pop DX
MOV [SI],DL
INC SI
DEC CL
JNZ OutStack
LEA DX,CTRL
MOV AH,9
INT 21H
LEA DX,BUF2
MOV AH,9
INT 21H
MOV AH,4CH
INT 21H
CODE ENDS
END START