;.......H+........H=?
data segment
buff1 dw 0h
buff2 dw 0h
st1 db 0, 78h,9ah,0bch,0deh
st2 db 0,54h,32h,1ah,0bch
st3 db 5 dup(?)
st4 db 5 dup(?)
str1 db "st3= ",13,10,"$"
str2 db " st4= ",13,10,"$"
data ends
stack segment para stack
db 100 dup(?)
stack ends
code segment
assume cs:code,ds:data,es:data,ss:stack
sub1 proc far
start: push ds
mov ax,0
push ax
mov ax,data
mov ds,ax
mov es,ax
mov cx,5
mov si,4
next: mov al,st1[si]
adc al,st2[si]
mov st3[si],al
dec si
loop next ;loop---循环
mov cx,5
mov si,4
next1: mov al,st1[si]
sbb al,st2[si]
mov st4[si],al
dec si
loop next1
;mov dx, offset str1
lea dx,str1
mov ah,9
int 21h
mov cx,5
mov si,0
next2: mov al,st3[si]
call sub3
inc si
loop next2
;mov dx,offset str2
lea dx,str2
mov ah,9
int 21h
mov cx,5
mov si,0
next3: mov al,st4[si]
call sub3
inc si
loop next3
ret
SUB1 ENDP
SUB3 PROC
mov bl,al
shr al,1
shr al,1
shr al,1
shr al,1
CALL SUB2
mov al,bl
and al,0fh
CALL SUB2
ret
SUB3 ENDP
SUB2 PROC
cmp al,9
ja g1
add al,"0"
jmp g2
g1: add al,37h
g2: mov dl,al
mov ah,2
int 21h
RET
SUB2 ENDP
code ends
end start