alikiller990کاربر تازه وارد

 Joined: Oct 05, 2012 Posts: 3
15906.00 امتیاز
Items
Status: Offline
|
Posted: سه شنبه، 5 خرداد ماه ، 1394 19:30:37 |
|
|
سلام به دوستان عزیز.
کد برنامه ی ماشین حساب ساده به زبان بیسیک رو دارم که توی پروتئوس درست اجرا میشه ولی وقتی مدارو میبندم این عبارت به صورت چشمک زن ظاهر میشه:
0+0=0.0
من تازه کارم و خیلی وارد نیستم شاید از چیزهای پیش پا افتاده باشه که من بلد نیستم مثلا فیوز بیت ها و اینا
کد و عکس رو هم قرار میدم.
$regfile = "m16adef.dat"
$crystal = 1000000
Dim A As Word
Dim A1 As Word
Dim A2 As Word
Dim A3 As Word
Dim X As String * 2
Dim B As Word
Dim B1 As Word
Dim B2 As Word
Dim B3 As Word
Dim D As Single
Dim K1 As Byte
Dim K2 As Byte
Dim C As Byte
Config Kbd = Portb , Debounce = 50 , Delay = 100
Config Lcdpin = Pin , Db4 = Portd.4 , Db5 = Portd.5 , Db6 = Portd.6 , _
Db7 = Portd.7 , E = Portd.3 , Rs = Portd.2
Config Lcd = 16 * 2
'*********************************
Main:
C = 0
Cls
Locate 1 , 5
Lcd "WELCOME"
'*********************************
Pro1:
K1 = Getkbd()
If K1 = 16 Then Goto Pro1
K2 = Lookup(k1 , Dat)
If K2 >= 10 Then
If K2 = 40 Then Goto Main
If K2 = 50 Then Goto Pro1
C = 0
Goto Pro3
End If
Incr C
If C = 1 Then
A1 = K2
A = A1
End If
If C = 2 Then
A2 = K2
A = A1 * 10
A = A + A2
End If
If C = 3 Then
A3 = K2
A1 = A1 * 100
A2 = A2 * 10
A = A1 + A2
A = A + A3
End If
Cls
Lcd A
If C = 3 Then
C = 0
'*********************************
Pro2:
K1 = Getkbd()
If K1 = 16 Then Goto Pro2
K2 = Lookup(k1 , Dat)
If K2 < 10 Then Goto Pro2
If K2 = 40 Then Goto Main
If K2 = 50 Then Goto Pro2
Goto Pro3
End If
Waitms 100
Goto Pro1
'*********************************
Pro3:
K2 = K2 / 10
Decr K2
X = Lookupstr(k2 , Sdat)
Cls
Lcd A ; X
Wait 1
'*********************************
Pro4:
K1 = Getkbd()
If K1 = 16 Then Goto Pro4
K2 = Lookup(k1 , Dat)
If K2 >= 10 Then
If K2 = 40 Then Goto Main
C = 0
Goto Pro6
End If
Incr C
If C = 1 Then
B1 = K2
B = B1
End If
If C = 2 Then
B2 = K2
B = B1 * 10
B = B + B2
End If
If C = 3 Then
B3 = K2
B1 = B1 * 100
B2 = B2 * 10
B = B1 + B2
B = B + B3
End If
Cls
Lcd A ; X ; B
If C = 4 Then
'*********************************
Pro5:
K1 = Getkbd()
If K1 = 16 Then Goto Pro5
K2 = Lookup(k1 , Dat)
If K1 <> 50 Then Goto Pro5
C = 0
Goto Pro6
End If
Waitms 100
Goto Pro4
'*********************************
Pro6:
Select Case X
Case Is = "/"
D = A / B
Case Is = "*"
D = A * B
Case Is = "-"
D = A - B
Case Is = "+"
D = A + B
End Select
Cls
Lcd A ; X ; B ; "=" ; D
Wait 1
'*********************************
Pro7:
K1 = Getkbd()
If K1 = 16 Then Goto Pro7
Goto Main
'*********************************
Dat:
Data 7 , 8 , 9 , 10 , 4 , 5 , 6 , 20 , 1 , 2 , 3 , 30 , 40 , 0 , 50 , 60
'*********************************
Sdat:
Data "/" , "*" , "-" , "ON" , "=" , "+"
لینک عکس
http://uploadkon.ir/fl/d/Njk4NjI%3D
|
|
Back to top |
|
 |
|
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 You cannot attach files in this forum You cannot download files in this forum
|
|
Powered by phpBB © 2001, 2008 phpBB Group
Ported to Platinum 7.6.b.4 V2 by sadeghkhafan
|
|