📄 flashdisk.bas
字号:
$Regfile = "M103Def.dat"
$Crystal = 4000000
' Use Serial 0 for communication with PC-Terminal
$Baud = 9600
Config Serialin = buffered , Size = 20
Open "Com1:" for Binary as #1
' If you use a software-UART, define it with #1
Enable Interrupts
config pinb.6 = Output
config pinb.7 = Output
portb.6 = 0
portb.7 = 1
goto BehindIncludes
$Include "FlashCardDrive.bas"
$Include "Interpreter.bas"
BehindIncludes:
' Init Port and Card
Print #1 , "Setup Port and Reset Card ... ";
if DriveCheck() = 1 then
DriveInit
else
print #1 , "Card not inserted, check Card!"
end if
Print #1 , "OK"
print #1 , "Ready for Commands"
PrintPrompt
Dim gbInp as Byte ' holds user input
' Handling communication with user
do
gbInp = inkey(#1) ' get user input
if gbInp <> 0 then ' something typed in?
toggle portb.7
GetInput gbInp ' give input to interpreter
end if
loop ' do forever
End 'end program
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -