ParsX.com
پذیرش پروژه از دانشجویی ... تا سازمانی 09376225339
 
   ProfileProfile   Log in to check your private messagesLog in to check your private messages  |  FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups Log inLog in   RegisterRegister 

محاسبه يك عبارت رياضي به زبان ماشين(فوري فوري لطفا x^2+14x+5

 
Post new topic   Reply to topic    ParsX.com Forum Index -> ساختمان و زبان ماشين
View previous topic :: View next topic  
Author Message
parnian
دوست آشناي سايت


Joined: 29 Jul 2006
Posts: 72

PostPosted: Sun Jul 30, 2006 5:30 pm    Post subject: محاسبه يك عبارت رياضي به زبان ماشين(فوري فوري لطفا x^2+14x+5 Reply with quote

اين برنامه محاسبه فرمول رياضي زير مي باشدا 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 را بزنيد .
Back to top
vahid
بي تو هرگز


Joined: 26 Nov 2004
Posts: 3067
Location: Tehran

PostPosted: Tue Aug 01, 2006 7:34 am    Post subject: Reply with quote

شما قسمت خروجي

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 اونهارو چاپ كني .
Back to top
parnian
دوست آشناي سايت


Joined: 29 Jul 2006
Posts: 72

PostPosted: Wed Aug 02, 2006 5:08 am    Post subject: Reply with quote

مرسي ممنون
Back to top
vahid
بي تو هرگز


Joined: 26 Nov 2004
Posts: 3067
Location: Tehran

PostPosted: Wed Aug 02, 2006 3:12 pm    Post subject: Reply with quote

خواهش مي كنم . باز هم اگه نتونستي بگو وقت كردم كدش روبرات مي نويسم .
Back to top
parnian
دوست آشناي سايت


Joined: 29 Jul 2006
Posts: 72

PostPosted: Thu Aug 03, 2006 7:05 am    Post subject: Reply with quote

ممنون مي شم اگه كدش رو بنويسي چون اون چيزي رو كه توضيح دادي نوشتم ولي خطامي گيره شايد من درست متوجه نشدم منتظرم ممنون
Back to top
vahid
بي تو هرگز


Joined: 26 Nov 2004
Posts: 3067
Location: Tehran

PostPosted: Thu Aug 03, 2006 8:40 am    Post subject: Reply with quote

;farzan : dx=ax=20 (adaded do raghami)
;raghame dahgan
mov bl,10
div bl
mov cl,al
add al,30H
mov dl,al
mov ah,2
int 21h
;raghame yekan
mov al,cl
mov ah,0
div bl
add al,30H
mov dl,al
mov ah,2
int 21h
Back to top
parnian
دوست آشناي سايت


Joined: 29 Jul 2006
Posts: 72

PostPosted: Thu Aug 03, 2006 12:29 pm    Post subject: Reply with quote

خيلي خيلي ممنون
Back to top
parnian
دوست آشناي سايت


Joined: 29 Jul 2006
Posts: 72

PostPosted: Sun Aug 06, 2006 6:00 pm    Post subject: Reply with quote

اقا وحيد اين برنامه با كدي كه شما نوشتي رو اجرا كردم جواب رو براي عدد يك مي ده 200 به جاي 20 مي شه يه راهنمايي ديگه بكني(استادمونم خيلي حوصله داره هامي گه تا برنامه تون درست اجرا نشه نمره پروزه رو نمي دم)البته پروژه من نيست مال دوستمه با ان حال شما كه لطف كرديد يكم بيشتر ....
ممنون
Back to top
vahid
بي تو هرگز


Joined: 26 Nov 2004
Posts: 3067
Location: Tehran

PostPosted: Sun Aug 06, 2006 9:05 pm    Post subject: Reply with quote

اگه وقت كردم چشم ...
Back to top
Display posts from previous:   
Post new topic   Reply to topic    ParsX.com Forum Index -> ساختمان و زبان ماشين All times are GMT + 3.5 Hours
Page 1 of 1

 
Jump to:  
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