Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Commodore DOS
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Command channel=== As previously noted, the Commodore DOS itself is accessed via the "command channel", using syntax like that used to access files. Issuing commands to the DOS and retrieving status and error messages generated in response to commands is accomplished by opening a file to the device using 15 as the secondary address, for example: :{{code|lang=cbmbas|OPEN 1,8,15}} To retrieve and display the device status, one could code: :{{code|lang=cbmbas|OPEN 1,8,15:INPUT#1,E,E$,T,S:PRINT E,E$,T,S:CLOSE 1}} In the above example, <code>E</code> will hold the error number (if any; it will be zero if no error exists), <code>E$</code> will be a terse text description of the error, <code>T</code> will represent the disk track where the error occurred, and <code>S</code> will be the sector on track <code>T</code> to which the error refers. If no error exists, the equivalent of {{samp|00,OK,00,00}} will be returned in the four variables. Note that <code>INPUT#</code> is a run mode only verb. Also, in programs that issue many disk commands it is customary to open a file to the device's command channel at the start of the program and not close it until the program has finished. Commodore BASIC versions 4.0 and later provide a pseudo-variable referred to as <code>DS$</code> that may be used to retrieve drive status in lieu of the above code. This reserved variable is not available on earlier versions of BASIC, so the command channel must be manually read as demonstrated above. Note that immediately after power-on or reset, the DOS revision will be returned. For example, a 1541 will return {{samp|73,CBM DOS V2.6 1541,00,00}}. Error code 73 is common to all drive models and may be used to determine if the drive has been reset to its power-on state.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)