;x*y/t并把结果存入u , u+1, u+2, u+3
data segment
x dw 2 dup(?)
y dw 2 dup(?)
t db 1 dup(?)
u db 1 dup(?)
z dw 2 dup(?)
i dw 2 dup(?)
j dw 2 dup(?)
k db 1 dup(?)
m db 1 dup(?)
n db 1 dup(?)
data ends
code segment
assume cs:code , ds:data
start:
mov ax, data
mov ds, ax
mov x, 0908h
mov y, 0302h
mov t, 06h
mov cx, x
mov dx, y
mov al, cl
mov bl, dl
mul bl;x第一位相乘的结果
aam
mov z, ax;空出ax
mov al, ch
mul bl
aam
mov bx, z
mov bl, bh
mov bh, 0
add ax, bx
aaa
;*********************
mov i, ax
mov al, dh
mov bl, cl
mul bl;x第二位相乘的结果
aam
mov bx, i
add ax, bx
aaa
mov i, ax
;**********************
mov al, ch
mov bl, dh
mul bl;x第三位相乘的结果
aam
mov bx, i
mov bl, bh
mov bh, 0
add ax, bx
aaa
mov j, ax
;**********************
;除法
mov al, ah
mov ah, 0
aad
div t
mov k, al;
mov bh, ah
mov ax, j
mov ah, bh
aad
div t
mov u, al;保存结果2
mov bh, ah
mov ax, i
mov ah, bh
aad
div t
mov n, al;
mov bh, ah
mov ax, z
mov ah, bh
aad
div t
mov m, al
mov al, m
mov ds:[0], al
mov al, n
mov ds:[1], al
mov al, u
mov ds:[2], al
mov al, k
mov ds:[3], al
mov ah, 4ch
int 21h
code ends
end start
本文地址:http://com.8s8s.com/it/it26437.htm