[求助]数据在内存中是如何存储的?
大家看看这个程序实现的是什么功能?data segment
a1 db '请输入第一个数:$'
b1 db 0dh,0ah, '请输入第二个数:$'
c1 db 0dh,0ah, '结果为:$'
A db 52,0,52 dup(0)
B db 52,0,52 dup(0)
s db 52 dup(0)
s1 db 0dh,0ah,'输入错误!$'
data ends
stack1 segment para stack
dw 100 dup(0)
stack1 ends
code segment
assume cs:code,ds:data,ss:stack1
start: mov ax,data
mov ds,ax
mov dx,offset a1
mov ah,09h
int 21h
mov dx, offset A
mov ah,0ah
int 21h
mov dx,offset b1
mov ah,09h
int 21h
mov dx, offset B
mov ah,0ah
int 21h
mov dx,offset c1
mov ah,09h
int 21h
mov si,offset A+2
mov al, A+1
mov ah,0
add ax,si
mov di,ax
dec di
f1: cmp si,di
jae d2cl
mov al,[si]
xchg aL,[di]
xchg al,[si]
inc si
dec di
jmp f1
d2cl: mov si,offset B+2
mov al, B+1
mov ah,0
add ax,si
mov di,ax
dec di
f2: cmp si,di
jae szcl
mov al,[si]
xchg al,[di]
xchg al,[si]
inc si
dec di
jmp f2
szcl: mov cx,50
mov dl,A+1
mov si,offset A+2
mov di, offset A
szcl1: cmp dl,0
jz bu0
mov al,[si]
cmp al ,'0'
jnb d1
jmp err
d1:cmp al,'9'
jna d2
jmp err
d2:and al ,0fh
mov [di], al
inc si
inc di
dec dl
dec cx
jmp szcl1
bu0: cmp cx,0
jz blend
mov byte ptr [di],0
dec cx
inc di
jmp bu0
blend: mov cx,50
mov dl,B+1
mov si,offset B+2
mov di, offset B
szcl2: cmp dl,0
jz bu01
mov al,[si]
cmp al ,'0'
jnb d11
jmp err
d11: cmp al,'9'
jna d22
jmp err
d22: and al ,0fh
mov [di], al
inc si
inc di
dec dl
dec cx
jmp szcl2
bu01: cmp cx,0
jz jf
mov byte ptr [di],0
dec cx
inc di
jmp bu01
jf: mov cx,0
mov si,offset A
mov di,offset B
mov bx,offset s
clc
pushf
l2: mov al,[si]
popf
adc al,[di]
aaa
mov [bx],al
inc si
inc di
inc cx
inc bx
pushf
cmp cx,50
jz jsend
jmp l2
jsend: popf
jnc jieshu
mov byte ptr [bx],1
jieshu: mov si,50
mov bx,offset s
find0: cmp byte ptr [bx+si],0
jnz exitfind0
dec si
cmp si ,0
jz exitfind0
jmp find0
exitfind0: add si,bx
push si
mov di,offset s
p3: cmp si,di
jbe xszf
mov al,[si]
xchg al,[di]
xchg al,[si]
dec si
inc di
jmp p3
xszf: mov si,offset s
pop di
p5: add byte ptr [si],30h
inc si
cmp si,di
ja p4
jmp p5
p4: mov byte ptr [si], '$'
mov dx,offset s
mov ah,09h
int 21h
mov ah,4ch
int 21h
err: mov dx, offset s1
mov ah,09h
int 21h
mov ah,4ch
int 21h
code ends