1 assume cs:code,ds:data
2 //不计溢出,计算两个数的128位减法,使用sbb指令
3 data segment
4 dd 12345678h,91011121h,31415161h,71819202h,12223242h,52627282h,93031323h,43536383h
5 data ends
6
7 code segment
8 start:
9 mov ax,data
10 mov ds,ax
11 mov si,0
12 mov di,10h
13 call add128
14 mov ax,4c00h
15 int 21h
16 add128:
17 push ax
18 push cx
19 push si
20 push di
21 sub ax,ax
22 mov cx,8
23 main:
24 mov ax,[si]
25 sbb ax,[di] //等价于(ax)-([di])-CF
26 mov [si],ax
27 add si,2
28 add di,2
29 loop main
30 ok:
31 pop di
32 pop si
33 pop cx
34 pop ax
35 ret
36 code ends
37
38 end start