DATA SEGMENT ;数据段 X DW 1, 2, 3, 4 Y DW 4 DUP(?) DATA ENDS
CODE SEGMENT ;代码段 ASSUME CS:CODE, DS:DATA START: MOV AX, DATA MOV DS, AX ;MOV DI,0 MOV AX, X[0] ; 将x[0]放到y[6] MOV Y[6], AX MOV AX, X[2] MOV Y[4], AX MOV AX, X[4] MOV Y[2], AX MOV AX, X[6] MOV Y[0], AX
;下面是输出语句 MOV DX, Y[0] ADD DX, 30H //将DX加上0的ASCII值,因为Y里装的是整数 MOV AH, 02 //调用输出功能 INT 21H
MOV DX, Y[2] ADD DX, 30H MOV AH, 02 INT 21H
MOV DX, Y[4] ADD DX, 30H MOV AH, 02 INT 21H
MOV DX, Y[6] ADD DX, 30H MOV AH, 02 INT 21H
MOV AX, 4C00H INT 21H CODE ENDS END START
|