博文
多位数乘法的汇编实现(二)(2005-08-19 17:31:00)
摘要:addition proc near
start3:sub ax,ax
sub dx,dx
mov bx,offset op1
mov al,[bx+1]
mov si,ax
mov bx,offset op2
cmp byte ptr[bx],al
jbe calc
mov di,ax
mov al,[bx+1]
mov si,ax
mov ax,0
push ax
popf
;------------------------------------------------------初始化运算
calc: mov al,[bx+si+2]
mov dl,[bx+di+2]
adc al,dl
;--------------------......
多位数乘法的汇编实现(一)(2005-08-19 17:31:00)
摘要:.model small
.stack 64
.data
op1 db 11,?,11 dup(0)
op2 db 11,?,11 dup(0)
pro1 db 12 dup(0),'$'
pro2 db 11 dup(0),'$'
pro3 db 22 dup(0),'$'
pro4 db 11 dup(0),'$'
pro5 db 11 dup(0),'$'
msg1 db 0dh,0ah,'**************************************************************'
db 0dh,0ah,' This calculator only can bear 10 digits of operand!'
db 0dh,0ah,' And the oprand shuld be no sign!'
db 0dh,0ah,'**************************************************************',0dh,0ah,'$'
msg2 db 0dh,0ah,'Please input the FIRST operand(Press ENTER to finish):','$'
msg3 db 0dh,0ah,'Please input the SECOND operand(Press ENTER to finish):','$'
msg4 db 0dh,0ah,'The summation is: ','$'
msg5 db 0dh,0ah,'The margin is: ','$'
msg6 db 0dh,0ah,'The product is: ',......
汇编语言实现二叉树的存储和遍历(三)(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......
