Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Apple III
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
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!
==BASIC== {{More citations needed|section|date=March 2023}} [[Microsoft]] and Apple each developed their own versions of BASIC for the Apple III. '''Apple III Microsoft BASIC''' was designed to run on the [[CP/M]] platform available for the Apple III. '''Apple Business BASIC''' shipped with the Apple III. Donn Denman ported Applesoft BASIC to SOS and reworked it to take advantage of the extended memory of the Apple III. Both languages introduced a number of new or improved features over [[Applesoft BASIC]]. Both languages replaced Applesoft's single-precision [[floating-point]] variables using 5-[[byte]] storage with the somewhat-reduced-precision 4-byte variables, while also adding a larger numerical format. Apple III Microsoft BASIC provides double-precision floating-point variables, taking 8 bytes of storage,<ref>Apple III Microsoft BASIC Reference Manual, Microsoft Corporation, 1982</ref> while Apple Business BASIC offers an extra-long integer type, also taking 8 bytes for storage.<ref>Apple Business BASIC Reference Manual, Apple Computer, Inc., 1981</ref> Both languages also retain 2-byte integers, and maximum 255-character [[string (computer science)|strings]]. Other new features common to both languages include: *Incorporation of disk-file commands within the language. *Operators for MOD and for integer-division. *An optional ELSE clause in IF...THEN statements. *HEX$() function for [[hexadecimal]]-format output. *INSTR function for finding a substring within a string. *PRINT USING statement to control format of output. Apple Business BASIC had an option, in addition to directly specifying the format with a string expression, of giving the line number where an IMAGE statement gave the formatting expression, similar to a FORMAT statement in [[Fortran|FORTRAN]]. Some features work differently in each language: {| class="wikitable" ! scope="col" width="150px" | ! scope="col" width="230px" | Apple III Microsoft BASIC ! scope="col" width="265px" | Apple Business BASIC |- | integer division operator | \ (backslash) | DIV |- | reading the keyboard without waiting | INKEY$ function returns a one-character string representing the last key pressed, or the null string if no new key pressed since last reading | KBD read-only "reserved variable" returns the ASCII code of the last key pressed; the manual fails to document what is returned if no new key pressed since last reading |- | reassigning a portion of a string variable | MID$() assignment statement || SUB$() assignment statement |- | determining position of text output | POS() function to read horizontal screen position, and LPOS() function to read horizontal position on printer | HPOS and VPOS assignable "reserved variables" to read or set the horizontal or vertical position for text screen output |- | accepting hexadecimal-format values | "&H"-formatted expressions | TEN() function to give numerical value from string representing hexadecimal |- | result of ASC("") (null string operand) | causes an error | returns the value β1 |} ===Microsoft BASIC additional features=== *{{mono|INPUT$()}} function to replace Applesoft's {{mono|GET}} command. *{{mono|LINE}} {{mono|INPUT}} statement to input an entire line of text, regardless of punctuation, into a single string variable. *{{mono|LPRINT}} and {{mono|LPRINT}} {{mono|USING}} statements to automatically direct output to paper. *{{mono|LSET}} and {{mono|RSET}} statements to left- or right-justify a string expression within a given string variable's character length. *{{mono|OCT$()}} function for output, and "&"- or "&O"-formatted expressions, for manipulating octal notation. *{{mono|SPACE$()}} function for generating blank spaces outside of a {{mono|PRINT}} statement, and {{mono|STRING$()}} function to do likewise with any character. *{{mono|WHILE}}...{{mono|WEND}} statements, for loop structures built on general [[Boolean data type|Boolean]] conditions without an index variable. *[[bitwise operation|Bitwise]] Boolean (16-bit) operations ({{mono|AND}}, {{mono|OR}}, {{mono|NOT}}), with additional operators {{mono|XOR}}, {{mono|EQV}}, {{mono|IMP}}. *Line number specification in the {{mono|RESTORE}} command. *{{mono|RESUME}} options of {{mono|NEXT}} (to skip to the statement after that which caused the error) or a specified line number (which replaces the idea of exiting error-handling by {{mono|GOTO}}-line, thus avoiding Applesoft II's [[stack (abstract data type)|stack]] error problem). *Multiple parameters in user-defined ({{mono|DEF FN}}) functions. *A return to the old Applesoft One concept of having multiple {{mono|USR()}} functions at different addresses, by establishing ten different {{mono|USR}} functions, numbered {{mono|USR0}} to {{mono|USR9}}, with separate {{mono|DEF USRx}} statements to define the address of each. The argument passed to a {{mono|USRx}} function can be of any specific type, including string. The returned value can also be of any type, by default the same type as the argument passed. There is no support for graphics provided within the language, nor for reading analog controls or buttons; nor is there a means of defining the active window of the text screen. ===Business BASIC additional features=== Apple Business BASIC eliminates all references to absolute memory addresses. Thus, the POKE command and PEEK() function were not included in the language, and new features replaced the CALL statement and USR() function. The functionality of certain features in Applesoft that had been achieved with various [[PEEK and POKE]] locations is now provided by: * BUTTON() function to read game-controller buttons * WINDOW statement to define the active window of the text screen by its coordinates * KBD, HPOS, and VPOS system variables External binary [[subroutines]] and functions are loaded into memory by a single INVOKE disk-command that loads separately-assembled code modules. A PERFORM statement is then used to call an INVOKEd procedure by name, with an argument-list. INVOKEd functions would be referenced in expressions by EXFN. (floating-point) or EXFN%. (integer), with the function name appended, plus the argument-list for the function. Graphics are supported with an INVOKEd module, with features including displaying text within graphics in various fonts, within four different graphics modes available on the Apple III.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Apple III
(section)
Add topic