Cube

 1 assume cs:code, ds:data
 2 
 3 data segment
 4 
 5 d1 db 1, 2, 3, 4, 5, 6, 7, 8
 6 d2 dw 8 dup(0)
 7 
 8 data ends
 9 
10 code segment
11 
12 start: mov ax, data
13 mov ds, ax
14 mov bx, offset d1 ;ds:bx 指向的是要进行cube的数据
15 mov bp, offset d2 ;ds:bp 指向的是存储结果的内存单元
16 
17 mov cx, 8
18 
19 s1: mov dl, [bx]
20 call cube
21 mov [bp], ax
22 inc bx
23 add bp, 2
24 
25 loop s1
26 
27 mov ax, 4C00H
28 int 21H
29 
30 cube: mov al, dl
31 mul dl
32 mul dl
33 
34 ret
35 
36 code ends
37 
38 end start
原文地址:https://www.cnblogs.com/AI-Cobe/p/9133852.html