Posted: Sun Jul 30, 2006 5:30 pm Post subject: محاسبه يك عبارت رياضي به زبان ماشين(فوري فوري لطفا x^2+14x+5
اين برنامه محاسبه فرمول رياضي زير مي باشدا x^2+14x+5 كه اين برنامه اشكال منطقي دارد لطفا سريعتر راهنمايي كنيدممنون
stacksg segment stack 'stack'
dw 100h dup(0)
stacksg ends
datasg segment 'data'
msg3 db 13,10,'this program is x^2+14*x+5:','$',13,10
msg1 db 13,10,'please enter one number two digits:','$',13,10
msg2 db 13,10,'result is',13,10,'$'
strlst label byte
max db 2
len db ?
buffer db 0
datasg ends
codesg segment 'code'
assume cs:codesg,ds:datasg,ss:stacksg
sdd: mov ax,datasg
mov ds,ax
mov ah,09h
lea dx,msg3
int 21h
mov ah,09h
lea dx,msg1
int 21h
mov ah,0ah
lea dx,strlst
int 21h
mov ah,09h
lea dx,msg2
int 21h
mov al,buffer
sub al,30h
mov bl,al
mul al
mov cl,14
mov dx,ax
mov al,bl
mul cl
add dx,ax
add dx,5
mov ax,dx
;add ax,30h
mov cl,4
mov bL,aL
shr bL,cl
and bL,0fh
add bL,30h
mov dl,bl
mov ah,02h
int 21h
and aL,0fh
add aL,30h
mov dl,al
mov ah,02h
int 21h
mov ah,4ch
int 21h
codesg ends
end sdd
----
vahid : براي چپ چين شدن كدها كدها رو در اديتور سايت انتخاب كنيد و سپس دكمه code را بزنيد .
mov cl,4
mov bL,aL
shr bL,cl
and bL,0fh
add bL,30h
mov dl,bl
mov ah,02h
int 21h
اشكال داري .
فرضا اگه ورودي ما 1 باشه . خروجي بايد 20 بشه . بعد از اينكه اين عدد رو توي برنامه در آوردين .
مي تونين با دوبار تقسيم بر 10 عدد دو و صفر رو در خارج قسمت بدست بياري و بعد با جمع كردن 30H اونهارو چاپ كني .
اقا وحيد اين برنامه با كدي كه شما نوشتي رو اجرا كردم جواب رو براي عدد يك مي ده 200 به جاي 20 مي شه يه راهنمايي ديگه بكني(استادمونم خيلي حوصله داره هامي گه تا برنامه تون درست اجرا نشه نمره پروزه رو نمي دم)البته پروژه من نيست مال دوستمه با ان حال شما كه لطف كرديد يكم بيشتر ....
ممنون
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum