汇编 求两个数相加输出 没最前面的进位

20080430132924[1]

data segment
int1 db ‘935797238’,13,10,24h
int2 db ‘843758912’,13,10,24h

data ends
code segment
     assume cs:code,ds:data
main: mov ax,data
      mov ds,ax
      lea dx,[int1]
      mov ah,9
      int 21h
      lea dx,[int2]
      mov ah,9
      int 21h
      lea si,[int1+8]
      lea di,[int2+8]
      mov cx,9
      mov ah,0
again:sub [si],30h
      sub [di],30h
      mov al,[si]
      add al,[di]
      add al,ah
      mov ah,0
      cmp al,0ah
      jge lab
      jmp lab1
  lab:mov ah,1
      sub al,10
lab1:add al,30h
      mov [si],al
      dec si
      dec di
      loop again
      lea dx,[int1]
      mov ah,9
      int 21h
      mov ax,4c00h
      int 21h
      code ends
          end main

- THE END -
版权声明:
转载原创文章请注明,文章出处:http://kinggoo.com
原文地址:http://kinggoo.com/chengxu-huibian-xiangshuxiangjiajinwei.htm
发表评论?

0 条评论。

发表评论