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
Atari Microsoft BASIC
(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!
==Details== The underlying interpreter was based on the same 9 KB [[MOS 6502]] code that also formed the basis of [[Commodore BASIC]] and [[AppleSoft BASIC]], and was largely compatible with them. A key aspect of this was the string handling system, which was based on the same code as those platforms. In contrast, Atari BASIC used an entirely different system that treated strings as arrays of characters and was not compatible with, nor easily ported from, most other systems. It retained the original 40-bit format [[floating-point arithmetic]] library that replaced the notoriously slow one in the system's [[operating system]] ROMs, and thus ran math code at the same speed as other platforms, and much faster than Atari BASIC. It also included an additional [[integer]] math package for added performance. The integer math system was triggered when the assignment was to an integer variable, or the literal values were all integers. If either was not true, the integer values would be converted to floating-point, use the floating-point code for the calculation, and then be converted back to integer for storage. {| class="wikitable" |+ Examples ! Division with two integers ! Division with integer and floating-point |- | {{kbd|PRINT 3/2|spacing=0}} {{samp|1}} | {{kbd|PRINT 3/2.0|spacing=0}} {{samp|1.5}} |} Another notable performance-related improvement was related to {{code|FOR...NEXT}} loops. Atari BASIC performed these by placing the line number of the {{code|FOR}} on the execution stack, so when the associated {{code|NEXT}} was encountered it could find which line to loop back to. In contrast, MS BASIC had always placed the memory location of that line on the stack, allowing it to jump back to the {{code|FOR}} without having to search through the entire program for the matching line. This oddity in Atari BASIC is one of the primary reasons for its slow performance, and because this was not true in Atari Microsoft BASIC, it generally ran much faster than Atari BASIC. In contrast to Atari BASIC, which parsed and tokenized entire lines when they were typed in, MS BASICs only partially tokenized the [[source code]]. When a line was entered, the line number was converted from ASCII to a 16-bit integer, the first program statement was tokenized to a single-byte value, and then the rest of the line was left as text format. The last character had its high-bit set to indicate the end of the line. Depending on the use-case, Atari BASIC's complete tokenization of the line could result in less memory being used to store the program. This difference also meant that many syntax errors would only be noticed at runtime in the MS code, unlike the Atari version where the entire line was checked at edit time. In theory, edit-time compilation should have made Atari BASIC much faster than MS, which re-tokenizes the line every time it is encountered, but this advantage was washed away by the other performance issues noted above. MS BASIC did not include a system for entering short forms of keywords, unlike Atari BASIC which allowed them to be abbreviated with a period during entry. When the program was {{code|LIST}}ed, the keywords would be expanded out. Commodore's version which added control-character completion to the same end. Atari Microsoft BASIC added a number of new features to take advantage of the platform. One interesting addition is {{code|AFTER (600) GOTO 100}} which waited for the specified number of "jiffies", 1/60ths of a second, and then performed the {{code|FOR}}. It also included the {{code|WAIT}} which instead paused while awaiting a memory address to change before proceeding to the next line. {{code|WAIT}} had been part of the earliest versions of MS BASIC but not widely used. Atari Microsoft BASIC included most of the graphics and sound commands from Atari BASIC. Oddly, the original {{code|DRAWTO}} was merged into {{code|PLOT}} using the optional {{code|PLOT...TO...}} format. This means graphics code for Atari BASIC was not compatible. Atari Microsoft BASIC added a number of additional commands for handling [[player/missile graphics]] and user-defined [[character set]]s that were not available in Atari BASIC. ''Atari Microsoft BASIC'' came in two packages: * [[Floppy disk]] β CX8126 * [[ROM cartridge]] β RX8035. Since the cartridge could only hold 16 KB, the remaining 11 KB file was included on an "extension" disk. The cartridge version was called ''Atari Microsoft BASIC II''. Although more feature-filled than Atari BASIC, Microsoft BASIC never had the popularity that Atari BASIC had. The biggest problems were: * increased memory needed (at least 32 KB) * disk drive required * performance (faster than Atari BASIC, but slower than [[Turbo-Basic XL]] and [[Optimized Systems Software|BASIC XL]]) * not compatible with Atari BASIC * added cost The cartridge version eliminated the first two requirements, but a disk drive was needed for all of its features.
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)