主题:求高手帮忙 转换以下bascom 到c 跪谢!!!
以下是bascom code, 我真的不知道如何改了 请前辈大侠们帮我改成c 跪谢了 跪谢了
$regfile = "m8def.dat"
$crystal = 4000000
Config Pinb.1 = Output ' Gate Triac
Config Pind.7 = Input ' Key Up
Config Pinb.0 = Input ' Key Dn
Config Int0 = Rising
On Int0 Int0_int ' Initialise the INT0 Interrupt
Enable Interrupts
Enable Int0
Dim E As Eram Byte
Dim B As Byte
Dim D As Byte
If E > 9 Then E = 9
B = E
D = 0
Set Portb.1
Do
If Pind.7 = 0 Then
If B > 0 Then Decr B
Waitms 10
E = B
End If
If Pinb.0 = 0 Then
If B < 9 Then Incr B
Waitms 10
E = B
End If
Loop
End ' end program
Int0_int:
Set Portb.1
For D = 0 To B
Waitus 200
Next D
Reset Portb.1
Return
$regfile = "m8def.dat"
$crystal = 4000000
Config Pinb.1 = Output ' Gate Triac
Config Pind.7 = Input ' Key Up
Config Pinb.0 = Input ' Key Dn
Config Int0 = Rising
On Int0 Int0_int ' Initialise the INT0 Interrupt
Enable Interrupts
Enable Int0
Dim E As Eram Byte
Dim B As Byte
Dim D As Byte
If E > 9 Then E = 9
B = E
D = 0
Set Portb.1
Do
If Pind.7 = 0 Then
If B > 0 Then Decr B
Waitms 10
E = B
End If
If Pinb.0 = 0 Then
If B < 9 Then Incr B
Waitms 10
E = B
End If
Loop
End ' end program
Int0_int:
Set Portb.1
For D = 0 To B
Waitus 200
Next D
Reset Portb.1
Return