سلام پاسخ سوالات رو در بخش نظرات پست قبلي دادم حتما ببينيد .
اين كد رو هفته پيش يك خانم خواسته بودن كه امروز وقت كردم و نوشتمش به زبان اسمبلي هست ، مربوط به جمع اعداد كه مي تونيد از زير كپي كنيد در ند پد و با پسوند asm ذخيره كنيد .
--------------------------
datsg segment
msg1 db 'Enter First No. :','$'
msg2 db 'Enter Second No. :','$'
carry db 0
max1 db 5
len1 db ?
buf1 db 5 dup('0')
max2 db 5
len2 db ?
buf2 db dup('0')
result db 5 dup('$')
row db 0
datsg ENDS
codsg segment
assume ds:datsg , cs:cdg
; ******* Display ********
disp proc near
mov ah,09h
int 21h
ret
disp endp
; ******* input **********
input proc near
mov ah,0ah
int 21h
ret
input endp
******* cursor **********
cursor proc near
mov dl,00h
mov dh,[row]
mov bh,00h
mov ah,02h
int 10h
inc row
ret
cursor endp
; ****** Main ********************
main proc far
mov ax,datsg
mov ds,ax
; ****** CLS *************
mov ah,06h
mov al,00h
mov bh,17h
mov ch,00h
mov cl,00h
mov dh,24
mov dl,79
int 10h
;*******
call cursor
lea dx,msg1
call disp
lea dx,max1
call input
call cursor
lea dx,max2
call input
; ******** ADDING ********
mov cx,4
ag:lea bx,buf1
add bx,cx
dec bx
mov ah,[bx]
sub ah,30h
lea bx,buf2
add bx,cx
dec bx
mov al,[bx]
sub al,30h
add al,ah
add al,[carry]
mov ah,00h
mov dl,10
div dl
lea bx,result
add ah,30h
add bx,cx
mov [bx],ah
mov [carry],al
loop ag
lea bx,result
mov al,[carry]
add al,30h
mov [bx],al
lea dx,result
call disp
; ****** Getch *****
mov ah,08h
int 21h
; ******* Exit *****
mov ax,4c00h
int 21h
main endp
codsg ENDS
END main