将数据由1000h移到2000h,并由小到大排序,并输出。以下是我写的程序。可是运行后,什么都没有。请大家指教
data segment
org 1000h
data1 db 1,56,99,200,65,3,7,8,13,10
org 2000h
data2 db 10 dup(?)
data ends
stack1 segment para stack'stack'
db ?
stack1 ends
code segment
assume cs:code,ds:data,ss:stack1
begin:mov si,offset data1 ;将数据由1000h移到2000h,这是我那题目的要求
mov di,offset data2
push di
mov cx,10
s:mov ax,[si]
mov [di],ax
inc si
inc di
loop s
pop di ;冒泡法排序,使数由小到大排列
mov cx,9
s0:push di
mov cx,9
s1:mov bx,[di]
cmp bx,[di+1]
jg next
inc di
jmp return
next:xchg bx,[di+1]
inc di
return:loop s1
pop di
loop s0
mov di,offset data2 ;输出数据
mov cx,10
take:mov al,[di]
mov bl,100
and ax,00ffh
div bl
mov bh,ah
mov dl,al
add dl,30h
cmp dl,30h
jz two
mov ah,02h
int 21h
two:mov bl,10
mov ax,0
mov al,bh
div bl
mov bh,ah
mov dl,al
add dl,30h
mov ah,02h
int 21h
three:mov dl,bh
add dl,30h
mov ah,02h
int 21h
loop take
mov ax,4c00h
int 21h
code ends
end begin
[此贴子已经被作者于2006-11-29 12:49:02编辑过]