汇编,求C=A+B

2016-12-26 09:45
DATA SEGMENT
    A       DB  ?
    B       DB  ?
    C       DB  ?
    STRING  DB  'C=$'
DATA    ENDS
CODE    SEGMENT
MAIN    PROC FAR
ASSUME  CS:CODE, DS:DATA, ES:DATA
START:
    PUSH DS
    SUB AX,AX
    PUSH AX
    MOV AX,DATA
    MOV DS,AX
    MOV ES,AX
    MOV A,1
    MOV B,2
    MOV AL,A
    ADD AL,B
    MOV C,AL
    LEA DX,STRING
    MOV AH,09
    INT 21H
    ADD C,30H
    MOV DL,C
    MOV AH,2
    INT 21H
    MOV DL,0AH
    INT 21H
    MOV DL,0DH
    INT 21H
    RET
MAIN ENDP
CODE ENDS
END START