汇编顺序程序设计
DATA SEGMENT
X1 DB ?
X2 DB ?
Y DW ?
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
MAIN PROC FAR
START:PUSH DS
MOV AX,0
PUSH AX
MOV BX,DATA
MOV DS,BX
MOV AL,X1
MOV BX.X2
ADD AL,BL
ADC AH,0
SAR AX,1
MOV Y,AX
RET
MAIN ENDP
CODE ENDS
END START
DATA SEGMENT
X1 DB ?
X2 DB ?
Y DW ?
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
MAIN PROC FAR
START:PUSH DS
MOV AX,0
PUSH AX
MOV BX,DATA
MOV DS,BX
MOV AL,X1
MOV BX.X2
ADD AL,BL
ADC AH,0
SAR AX,1
MOV Y,AX
RET
MAIN ENDP
CODE ENDS
END START