博文
汇编语言实现二叉树的存储和遍历(三)(2005-08-17 17:12:00)
摘要:;------------------------------------------------------------------------------------------------------------------------------------
midrr proc near
start10:push ax
push dx
cmp byte ptr[si+2],0
jz exit3
push si
mov si,offset binary
add si,cx
add cx,3
call midr
pop si
exit3: sub si,3
pop dx
pop ax
ret
midrr endp
;------------------------------------------------------------......
汇编语言实现二叉树的存储和遍历(四)(2005-08-17 17:12:00)
摘要:prompt proc near ;give the prompt information
start5:push ax
push dx
mov ax,0900h
mov dx,offset hey2
int 21h
mov ax,0200h
mov dl,[si]
int 21h
mov ax,0900h
mov dx,bx
int 21h
&......
汇编语言实现二叉树的存储和遍历(三)(2005-08-17 17:09:00)
摘要:;---------------------------------------------------------
Inroot proc near ;the procedure of input root
start2:push ax
push dx
CMP CX,186
jz quit
mov [si],al
call leftchild
call rightchild
pop ax
pop dx
ret
quit: mov ax,0900h
mov dx,offset hey9
 ......
汇编语言实现二叉树的存储和遍历(一)(2005-08-17 17:06:00)
摘要:;;;;;;;;;;;;;;;;;二叉树的遍历
.model small
.stack 64
.data
;--------------------------------------------------------------------------------------------------------------------------------
binary db 63 dup (0,0,0)
hey1 db 'Please input the root of the binary:',0dh,0ah,'$'
hey2 db 0dh,0ah,'Does ',27h,'$'
hey3 db 27h,' have a leftchild?(If it no leftchild,please press ENTER)',0dh,0ah,'$'
hey4 db 27h,' have a rightchild?(If it no rightchild,please key in ENTER)',0dh,0ah,'$'
hey5 db 'The first root traversing:',0dh,0ah,'$'
hey6 db 'The middle root traversing:',0dh,0ah,'$'
hey7 db 'The last root traversing:',0dh,0ah,'$'
hey8 db 0dh,0ah,'$'
hey9 db 0dh,0ah,'The input is over!','$'
hey10 db 0dh,0ah,'Pree anykey to continue,ESC to finish...',0dh,0ah,'$'
;---------------------------------------------------------------------------------------------------------------------------------
.code
main proc far &n......
