Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Integer BASIC

From Wikipedia, the free encyclopedia
This article is about the specific version of BASIC included with Apple I and II computers and is not to be confused withother integer-only implementations of BASIC.
BASIC interpreter of the Apple I and original Apple II computers
Integer BASIC
DeveloperSteve Wozniak
First appeared1976; 49 years ago (1976)[1]
PlatformApple I,Apple II
Influenced by
HP BASIC
Influenced
Applesoft BASIC

Integer BASIC is aBASIC interpreter written bySteve Wozniak for theApple I andApple II computers. Originally available oncassette for the Apple I in 1976, then included inROM on the Apple II from its release in 1977, it was the first version of BASIC used by many earlyhome computer owners.[2]

The only numeric data type was the integer;floating-point numbers were not supported. Using integers allowed numbers to be stored in a compact 16-bit format that could be more rapidly read and processed than the 32- or 40-bit floating-point formats found in most BASICs of the era. This made it so fast thatBill Gates complained when it outperformedMicrosoft BASIC in benchmarks. However, this also limited its applicability as a general-purpose language.[a]

Another difference with other BASICs of the era is that Integer BASIC treated strings as arrays of characters, similar to the system inC orFortran 77. Substrings were accessed usingarray slicing rather than string functions. This style was introduced inHP Time-Shared BASIC, and could also be found in other contemporary BASICs patterned on HP, likeNorth Star BASIC andAtari BASIC. It contrasted with the style found in BASICs derived fromDEC, includingMicrosoft BASIC.

The language was initially developed under the nameGAME BASIC and referred to simply asApple BASIC when it was introduced on the Apple I. It became Integer BASIC when it was ported to the Apple II and shipped alongsideApplesoft BASIC, a port ofMicrosoft BASIC which included floating-point support. Integer BASIC was phased out in favor of Applesoft BASIC starting with theApple II Plus in 1979.

History

[edit]

As a senior inhigh school,Steve Wozniak's electronics teacher arranged for the leading students in the class to have placements at local electronics companies. Wozniak was sent toSylvania where he programmed inFORTRAN on anIBM 1130.[4] That same year,General Electric placed a terminal in the high school that was connected to one of their mainframes running theirtime-sharing BASIC service, which they were heavily promoting at the time. After being given three days of access, the students were asked to write letters on why the school should receive a terminal permanently, but their efforts were ultimately unsuccessful.[1]

Some years later, Wozniak was working atHewlett-Packard (HP) running simulations of chip designs and logic layout for calculators.[1] HP made major inroads in theminicomputer market with theirHP 2000 series machines running acustom timesharing version of BASIC. For approximately$100,000, one could build up a reasonably equipped machine that could support between 16 and 32 users running BASIC programs.[5] While expensive, it was still a fraction of the cost of themainframe machines[b] and, for heavy users, less than the timesharing services.[c] HP followed this with theHP 9830, a desktop-sized machine forUS$10,000 (equivalent to $81,000 in 2024) that also ran BASIC, which Wozniak had access to.[9]

I sniffed the wind and knew that the key to making my computer good (popular) was to include a high-level language and that it had to be BASIC.

Steve Wozniak[1]

In January 1975 theAltair 8800 was announced and sparked off themicrocomputer revolution. In March, Wozniak attended the first meeting of theHomebrew Computer Club and began formulating the design of his own computer. One of the most important pieces of software for the Altair, and one of the most heavilypirated, wasAltair BASIC from the recently formedMicrosoft.[10] Wozniak concluded that his machine would have to have a BASIC of its own, which would, hopefully, be the first for theMOS Technology 6502 processor. As the language needed 4 KB RAM, he made that the minimum memory for the design.[1]

Wozniak's references for BASIC were a copy of101 BASIC Computer Games and an HP BASIC manual.[1] He did not know that HP's BASIC was very different from theDEC BASIC variety used in101 Games, which was also the basis of Microsoft BASIC for the Altair. Based on these sources, Wozniak began sketching out asyntax chart for the language. The design initially included floating-point support, but still hoping he might publish the first BASIC on the 6502 and become "a star", he decided to abandon floating-point and write a separate integer math system to save a few weeks programming time.[1]

Wozniak would later describe his language as "intended primarily for games and educational uses".[11] Referring to it throughout development as "GAME BASIC", Wozniak wrote the code by hand, translating theassembler code instructions into theirmachine code equivalents and then uploading the result to his computer.[12] Without any training on how to write a computer language, he used his HP calculator experience to implement astack machine to interpret expressions. Once the basic routines were up and running, he worked on the other commands one-by-one in a modular fashion. With every visit to the Homebrew club, he demonstrated a few more features added in the last month.[1]

It was the most satisfying day of my life... I demonstrated Breakout [at Homebrew]-totally written in BASIC... After designing hardware arcade games, I knew that being able to program them in BASIC was going to change the world.

Steve Wozniak[9]
Ad for the Apple I computer noting Apple's policy of providing free or inexpensive software for its computers.

In early 1976 ads for itsApple I computer,Apple Inc made the claims that "our philosophy is to provide software for our machines free or at minimal cost"[13] and "yes folks, Apple BASIC is Free".[14] This was printed shortly afterBill Gates's infamousOpen Letter to Hobbyists that suggested that people were robbing him by copying versions ofAltair BASIC.[15]

Wozniak had helpedSteve Jobs, who worked forAtari, with a redesign ofBreakout.[16] At some later point, he decided to see whether one could write the game in BASIC. He added commands to readpaddle controllers and over a series of quick edits had a version of the game up and running. To improve its playability, he added a speaker to make clicks when the ball hit things. While showing it to Jobs, Wozniak demonstrated that he could quickly change the colors that his game used, just by altering thesource code. Wozniak later wrote that he had proved that "software was much more flexible than hardware", and that he and Jobs realized that "now, anyone could create arcade games without having to design it in hardware."[1]

Wozniak did complete a floating-point library for the 6502 and published it in the August 1976 edition ofDr. Dobb's Journal.[17] This library was later made part of the ROMs for theApple II.[18] Wozniak began work on back-porting the floating-point code into Apple BASIC, but got sidetracked in the task of designing afloppy disk controller for what became theDisk II.Mike Markkula said the company would go to theConsumer Electronics Show inLas Vegas if the disk system was ready in time, so Wozniak andRandy Wigginton worked on it non-stop through the 1977 holidays.[19]

When he returned to the topic of floating-point in BASIC, Jobs complained it was taking too long. Without Wozniak being aware, the company had already arranged a license with Microsoft to receive their recently completed 6502 version of the Altair code. Examining the MS code, Wozniak decided that it was easier to add graphics support to their code than add floating-point his own BASIC, as the latter required hand-patching of the original machine code while MS's was written in assembler and more easily modified. The development of Apple's BASIC ended in favor of what becameApplesoft BASIC. Wozniak later noted, "My biggest disappointment was going to the awful string functions likeLEFT$(VAR,5) andMID$(VAR2,5,3) instead of my own".[19][d]

When the Apple II shipped in the summer of 1977, Integer BASIC was supplied in ROM, while Applesoft BASIC shipped on cassette. This changed with the introduction of theApple II Plus in 1979, when Applesoft was put in the ROM.[20]

Description

[edit]

Program editing

[edit]

Like most BASIC implementations of the era, Integer BASIC acted as both the language interpreter as well as the line editing environment. When BASIC was running, a>command prompt was displayed where the user could enter statements.[21][e] Unlike laterhome computer platforms, BASIC was not the default environment when the Apple II started, it normally started in themonitor. BASIC was started by pressingCtrl+BReturn.[22]

Statements that were entered with leading numbers are entered into the program storage for "deferred execution",[23] either as new lines or replacing any that might have had the same number previously.[24] Statements that were entered without a line number were referred to as commands, and ran immediately.[f] Line numbers could be from 0 to 32767,[25][g] and lines could contain up to 128 characters.[27]

Integer BASIC also included theAUTO command to automatically enter line numbers at a given starting number likeAUTO 100, adding 10 to the last number with every new line.AUTO 300,5 would begin numbering at line 300 by fives; 300, 305, etc. Automatic numbering was turned off by enteringMAN.[28]

One interesting feature of the editor was that a section of the screen could be set aside as the "window", where live updates took place. This was normally the entire screen, but it could be limited to a smaller area byPOKEing values into memory locations 32 through 35.[29] This feature could be used to create an editable text area while the rest of the screen was in graphics mode.[30]

Debugging

[edit]

As in most BASICs, programs were started with theRUN command, and as was common, could be directed at a particular line number likeRUN 300.[31] Execution could be stopped at any time usingCtrl+C[32] and then restarted withCONtinue, as opposed to the more typicalCONT.[33]

For step-by-step execution, theTRACE instruction could be used at the command prompt or placed within the program itself. When it was turned on, line numbers were printed out for each line the program visited. The feature could be turned off again withNOTRACE.[34]

A somewhat unusual feature was theDSP (for "display") command. When encountered in a program, from that point on anychanges to a variable's value would be displayed. For instance,DSP X would display the value of X every time it changed, along with the line number where the change occurred.[35] As with TRACE, DSP was turned off withNODSP.[26]

Variable names

[edit]

WhereDartmouth BASIC and HP-BASIC limited variable names to at most two characters (either a single letter or a letter followed by one digit), and where MS-BASIC allowed a letter followed by an optional letter or digit (ignoring subsequent characters), Integer BASIC was unusual in supporting any length variable name (e.g., SUM, GAMEPOINTS, PLAYER2). The only caveat was that variable names could not contain reserved words; for example, THISCOLOR and COLORFUL were invalid variable names because they contained the keywordCOLOR, a system command.[36] Additionally, lines were limited to 128 characters, so variable names could not exceed that length.[27]

Mathematics

[edit]

Integer BASIC, as its name implies, uses integers as the basis for its math package. These were stored internally as a 16-bit number,little-endian (as is the 6502). This allowed a maximum value for any calculation between -32767 and 32767; although the format could also store the value -32768, BASIC could not display that number. Calculations that resulted in values outside that range produced a>32767 ERR.[37]

Infix operators included+ (addition),- (subtraction),* (multiplication),/ (division),MOD (remainder) and exponent using the^ character. Binary operators includedAND,OR andNOT. Binary comparisons included the standard set of=,>,<,>=,<=,<> and the HP-inspired#, which was equivalent to <>.[38]

Only single-dimension arrays were allowed, limited in size only by the available memory.[39] Mathematical functions were sparse; onlyABS (absolute value),SGN (sign) andRND (random number) were supported.[40] In contrast to MS-derived versions, where the parameter was ignored andRND always returned a value 0..<1, Integer BASIC used the parameter;RND(6) returned an integer from 0 to 5.[41]

Strings

[edit]

Integer BASIC's string handling was based on the system in HP BASIC. This treated string variables as arrays of characters which had to beDIMed prior to use. This is similar to the model inC[42] orFortran 77.[43] This is in contrast to MS-like BASICs where strings are an intrinsic variable-length type.[44] Before MS-derived BASICs became thede facto standard, this style was not uncommon;North Star BASIC[45] andAtari BASIC[46] used the same concept, as did others.

Strings in Integer Basic used a fixed amount of memory regardless of the number of characters used within them, up to a maximum of 255 characters.[47] This had the advantage of avoiding the need for thegarbage collection of theheap that was notoriously slow in MS BASIC[h] but meant that strings that were shorter than the declared length resulted in wasted memory.

Substring access was provided througharray slicing syntax. For instance,PRINTA$(0,5) printed the first six characters ofA$, characters 0 through 5.[49][49][i] Concatenation was provided using the same system,A$(5)="ABC" replaced any characters starting at position 5 with the string "ABC".[50] This contrasts with the DEC/MS-style string handling which uses string functions likeMID$ to access substrings and+ for concatenation.[51][j]

As many of the features that would be provided by string functions were instead provided by array slicing, the selection of string functions was reduced.LEN returned the length of a string[47] andASC returned the ASCII numeric code for the first letter in a string.[52] It lacked an equivalent of theCHR$ that returned the ASCII character with a given numeric code.[53]

Graphics and sound

[edit]

When launched, the onlygame controller for the Apple was thepaddle controller, which had two controllers on a single connector. The position of the controller could be read using thePDL function, passing in the controller number, 0 or 1, likeA=PDL(0):PRINTA, returning a value between 0 and 255.[54][k]

The Apple machines did not include dedicated sound hardware, only a simple "beeper". Producing sounds was accomplished byPEEKing the memory-mapped location of the speaker, -16336.[l] Repeatedly PEEKing that value produced tones, and the manual suggested using a mathematical expression to do this, likeS=PEEK(-16336)-PEEK(-16336)-PEEK(-16336)-PEEK(-16336)-PEEK(-16336).[56]

Support for graphics was more detailed. Graphics mode was turned on with theGR statement and off withTEXT.[57] Drawing was modal and normally started by issuing a command to change the color, which was accomplished by setting a pseudo-variable;COLOR=12 would set the drawing color to 12, light green. One could thenPLOT 10,10 to produce a single spot of that color,[58]HLIN 0,39 AT 20 to draw a horizontal line at row 20 that spanned the screen, orVLIN 5,15 AT 7 to draw a shorter vertical line down column 7.[59]A=SCRN X,Y returned the color of the screen at X,Y.[52][m]

Input/output

[edit]

Integer BASIC lacked any custom input/output commands, and also lacked theDATA statement and the associatedREAD. To get data into and out of a program, the input/output functionality was redirected to a selectedcard slot with thePR#x andIN#x, which redirected output or input (respectively) to the numbered slot. From then on, data could be sent to the card using conventionalPRINT commands and read from it usingINPUT.[52]

Other notes

[edit]

Integer BASIC included aTAB feature, which positioned the cursor on a given column from 0 to 39. It differed from the versions found in most BASICs in that it was a command with a following number, as opposed to a function with the value in parentheses; one would move the cursor to column 10 usingTAB 10 in Integer BASIC[60] whereas in MS this would bePRINT TAB(10). Additionally, theVTAB command worked similar toTAB but added vertical spaces instead of horizontal. For unexplained reasons, in this case the coordinates were from 1 to 24 rather than 0 to 23.[61]

Integer BASIC included aPOP command to exit from loops.[52] This popped the topmost item off the FOR stack. Atari BASIC also supported the same command,[62] whileNorth Star BASIC usedEXIT.[63]

The Integer BASIC ROMs also included amachine code monitor, "mini-assembler", and disassembler to create and debugassembly language programs. Wozniak hand-assembled the monitor as the Apple II's first program, then used it to write Integer BASIC.[64][65][2]

Reserved words

[edit]

Apple BASIC

[edit]

Apple BASIC had the following commands:[66]

AUTOval1,val2CLR[CLEAR]DELval1,val2LISTval1,val2RUNval1SCR[SCRATCH/NEW]HIMEM=exprLOMEM=expr(LET)var=exprINPUT(prompt,)var1,var2...PRINTitem(s)TABexprFORvar=expr1TOexpr2STEPexpr3NEXTvarIFexprTHENstatementIFexprTHENlinenumberGOTOexprGOSUBexprRETURNDIMvar1(expr1),var2(expr2)...REM textENDPOKEexpr1,expr2CALLexprFunctions:ABS(),SGN(),PEEK(),RND(),LEN()

Integer BASIC

[edit]

Integer BASIC added the following:[67][68]

COLOR=exprCON[CONTINUE]DSPGRHLINexpr1,expr2ATexpr3MANNEW[replacesSCR]NOTRACEPLOTexpr1,expr2POPTEXTTRACEVLINexpr1,expr2ATexpr3Function:ASC(),PDL(),SCRN(X,Y)

Implementation

[edit]

Integer BASIC read the lines typed in by the user from a buffer and ran them through aparser which output a series oftokens. As part of this process, simplesyntax errors were detected and listed. If the parsing was successful, the line number (if present) was converted fromASCII decimal format into a 16-bit integer and any keywords into a 7-bit integer token.[64]

Some keywords were represented by multiple tokens; for instance, where Microsoft BASIC had one token for the keywordPRINT, Integer BASIC had three tokens: one if the keyword was followed by no arguments, one if followed by an arithmetic expression, and one if followed by a string literal.[69]

Numeric literals, like the value 500, were converted into their 16-bit (two-byte) binary representation, in this case,$01F4hexadecimal. To indicate this was a value and not a keyword, a single byte between$B0 and$B9 was inserted in front of the two-byte value.[n] String literals, like "HELLO WORLD" were instead converted by setting the high bit of each character so thatA was stored as$C1. Variable names were converted in the same fashion, with the letters converted to have their high-bit turned on, and any digits in the name represented by the corresponding$B0 through$B9, so that the variableA5 would be tokenized as$C1B5.[64]

If the line was entered without a line number, the code was then executed directly from the buffer. If it had a line number, it was copied from the buffer into the program storage area.[64]

The runtime interpreter used two stacks for execution: one for statement keywords and the other for evaluating the parameters. Each statement was given two priorities: one that stated where it should occur in a multi-step operation, like a string of mathematical operations to provideorder of operations, and another that suggested when evaluation should occur, for instance, calculating internal values of a parentheses formula. When variables were encountered, their name was parsed and then looked up in the variable storage area. If it was not found, it was added to the end of the list. The address of the variable's storage, perhaps freshly created, was then placed on the evaluation stack.[64]

ROM details

[edit]

SWEET16

[edit]
Main article:SWEET16

In addition to Integer BASIC, the Apple ROMs contained a customassembler language known asSWEET16. SWEET16 is based onbytecodes that run within a simple 16-bitvirtual machine. This model was used so memory could be addressed via indirect 16-bit pointers and 16-bit math functions calculated without the need to translate those to the underlying multi-instruction 8-bit 6502 code. The entire virtual machine was written in only 300 bytes. Code can call SWEET16 by issuing asubroutine call, and then return to normal 6502 code when the 16-bit operations are complete.[70]

SWEET16 was not used by the core BASIC code, but was later used to implement several utilities. Notable among these was the line renumbering routine, which was included in the Programmer's Aid #1 ROM, added to later Apple II models and available for user installation on earlier examples.[71]

Floating point

[edit]

Although Integer BASIC contained its own math routines, the Apple II ROMs also included a complete floating-point library located in ROM memory between$F425-$F4FB and$F63D-$F65D. The source code was included in the Apple II manual. BASIC programs requiring floating-point calculations couldCALL into these routines.[72]

Performance

[edit]

Because Integer BASIC processed more of the originalsource code into tokens, the runtime was faster than versions that required additional runtime parsing. For comparison,Tiny BASIC tokenized only the line number,[73] while MS BASICs tokenized only the keywords. So for instance, while Integer BASIC would convert the line100 GOTO 200 entirely into tokens that could be immediately read and performed, in MS BASIC only the line number and GOTO would be tokenized, the "200" was left in its original ASCII format and had to be re-parsed into a 16-bit integer every time the line was encountered.[74]

Additionally, working solely with integer math provides another major boost in speed. This is due both to the smaller 16-bit format requiring fewer memory accesses, as well as removing the need to move the floating-point decimal after calculations. As manycomputer benchmarks of the era were small and often performed simple math that did not require floating-point, Integer BASIC trounced most other BASICs.[o]

On one of the earliest known microcomputer benchmarks, theRugg/Feldman benchmarks, Integer BASIC was well over twice as fast as Applesoft BASIC on the same machine.[76] In theByte Sieve, where math was less important but array access and looping performance dominated, Integer BASIC took 166 seconds while Applesoft took 200.[77] A review of Galfo Systems' Integer BASIC Compiler found that it produced code that is about 1.5 to eight times faster than compiled Applesoft BASIC, ten times faster than interpreted Integer BASIC, and 15 times faster than interpreted Applesoft.[78] Integer BASIC did not appear in theCreative Computing Benchmark, which was first published in 1983, by which time the language was no longer included with Apple computers.[79]

The following test series, taken from both of the original Rugg/Feldman articles,[76][75] show Integer's performance relative to the MS-derived BASIC on the same platform.

SystemCPUBASICTest 1Test 2Test 3Test 4Test 5Test 6Test 7
Apple II6502 @ 1 MHzInteger BASIC1.33.17.27.28.818.528.0
Apple II6502 @ 1 MHzApplesoft BASIC1.38.516.017.819.128.644.8

Here is a summary of what each test did:

  • Test 1: for/next loop to 1000.
  • Test 2: if/then loop with compare to 1000.
  • Test 3: same as 2 with added multiplication, division, addition subtraction by same variable.
  • Test 4: same as 3 with added multiplication, division, addition subtraction by constants.
  • Test 5: same as 4 with added subroutine call.
  • Test 6; same as 5 with added inner loop.
  • Test 7: same as 6 with added table population.

Sample code

[edit]

The following is a version of Breakout written in the 1977 version of Integer BASIC for the Apple II, which was listed in the Apple II Mini Manual.[80] There are a number of known bugs in this version.[81]

The program starts by setting the display toTEXT and thenCALL -936 to clear the screen. Lines 20 through 27, and the associated subroutines at line 100 and 200, are the color selection code Wozniak demonstrated for Jobs. Line 30 sets up the text window withPOKE 32,20[p] and then uses a series ofCOLOR andVLIN statements to draw the playfield and the score display in the text window. The entire main loop runs from line 40 through 90 with associated subroutines. Another large amount of code near the end of the program is concerned with printing the final score. Other notes of interest include the# (not-equal) comparisons on line 20, the production of a high-pitch sound using a string ofPEEKs on line 65 compared to a lower-pitched tone using a loop on line 70, and the mix of graphics and text on a single display.[q]

5TEXT:CALL-936:VTAB4:TAB10:PRINT"*** BREAKOUT GAME ***":PRINT7PRINT"  OBJECT IS TO DESTROY ALL BRICKS WITH 5 BALLS":FORN=1TO7000:NEXTN10DIMA$(20),B$(20):GR:PRINT:INPUT"HI, WHAT'S YOUR NAME? ",A$:A=1:B=13:C=9:D=6:E=15:PRINT"STANDARD COLORS,";A$;20INPUT"? ",B$:IFB$#"N"ANDB$#"NO"THEN30:FORI=0TO39:COLOR=I/2*(I<32):VLIN0,39ATI25NEXTI:POKE34,20:PRINT:PRINT:PRINT:FORI=0TO15:VTAB21+IMOD2:TABI+I+1:PRINTI;:NEXTI:POKE34,22:VTAB24:PRINT:PRINT"BACKGROUND";27GOSUB100:A=E:PRINT"EVEN BRICK";:GOSUB100:B=E:PRINT"ODD BRICK";:GOSUB100:C=E:PRINT"PADDLE";:GOSUB100:D=E:PRINT"BALL";:GOSUB10030POKE34,20:COLOR=A:FORI=0TO39:VLIN0,39ATI:NEXTI:FORI=20TO34STEP2:TABI+1:PRINTI/2-9;:COLOR=B:VLIN0,39ATI:COLOR=C:FORJ=IMOD4TO39STEP435VLINJ,J+1ATI:NEXTJ,I:TAB5:PRINT"SCORE = 0":PRINT:PRINT:POKE34,21:S=0:P=S:L=S:X=19:Y=19:X=1940COLOR=A:PLOTX,Y/3:X=19:Y=RND(120):V=-1:W=RND(5)-2:L=L+1:IFL>5THEN140:TAB6:PRINT"BALL #";L:PRINT:FORI=1TO100:GOSUB200:NEXTI:M=1:N=050J=Y+W:IFJ>=0ANDJ<120THEN60:W=-W:J=Y:FORI=1TO6:K=PEEK(-16336):NEXTI55IFPEEK(-16287)>127THENSW=1-SW60I=X+V:IFI<0THEN400:GOSUB200:COLOR=A:K=J/3:IFI>39THEN70:IFSCRN(I,K)=ATHEN90:IFITHEN120:N=N+1:V=(N>9)+1:W=(K-P)*2-5:M=165Z=PEEK(-16336)-PEEK(-16336)-PEEK(-16336)-PEEK(-16336)-PEEK(-16336)-PEEK(-16336)-PEEK(-16336):GOTO9070FORI=1TO6:M=PEEK(-16336):NEXTI:I=X:M=080V=-V90PLOTX,Y/3:COLOR=E:PLOTI,K:X=I:Y=J:GOTO5099PRINT"INVALID.  REENTER";100INPUT" COLOR (0 TO 15)",E:IFE<0ORE>15THEN99:RETURN120IFMTHENV=ABS(V):VLINK/2*2,K/2*2+1ATI:S=S+I/2-9:VTAB21:TAB13:PRINTS123Q=PEEK(-16336)-PEEK(-16336)-PEEK(-16336)-PEEK(-16336)-PEEK(-16336)-PEEK(-16336)-PEEK(-16336)-PEEK(-16336)-PEEK(-16336)-PEEK(-16336)124IFS<720THEN80130PRINT"CONGRATULATIONS, YOU WIN.":GOTO150140PRINT"YOUR SCORE OF ";S;" IS ";:GOTO141+S/100141PRINT"TERRIBLE!":GOTO150142PRINT"LOUSY.":GOTO150143PRINT"POOR.":GOTO150144PRINT"FAIR.":GOTO150145PRINT"GOOD.":GOTO150146PRINT"VERY GOOD.":GOTO150147PRINT"EXCELLENT.":GOTO150148PRINT"NEARLY PERFECT."150PRINT"SAME COLORS";:GOTO20200IFSWTHEN220:Q=(PDL(0)-5)/6:IFQ<0THENQ=0205IFQ>=34THENQ=34:COLOR=D:VLINQ,Q+5AT0:COLOR=A:IFP>QTHEN210:IFQTHENVLIN0,Q-1AT0:P=Q:RETURN210IFP=QTHENRETURN:IFQ#34THENVLINQ+6,39AT0:P=Q:RETURN220Q=(Y-5)/3+RND(3)*SGN(W)*(X<10ANDV<0):IFQ<0THENQ=0:GOTO205400FORI=1TO80:Q=PEEK(-16336):NEXTI:GOTO40

Notes

[edit]
  1. ^Or asBill Gates put it, "more powerful BASIC... using floating point".[3]
  2. ^An IBM 370/155 cost over$2 million in 1970 (equivalent to $16,000,000 in 2024).[6]
  3. ^Tymshare charged about$10 per hour (equivalent to $81 in 2024) for accessing their systems,[7] while smaller services could be found for about$5.[8]
  4. ^The string handling was not "his own", but the same system used by HP BASIC.
  5. ^To make it clear which BASIC was running, Applesoft used the] prompt.
  6. ^In what MS referred to more descriptively as "immediate mode".
  7. ^Helmers says the lowest line number is 1.[26]
  8. ^And completely broken in some versions.[48]
  9. ^HP also allowed [ and ] in place of ( and ).
  10. ^It also contrasts withDartmouth BASIC which used theCONVERT command to convert a string into an array of ASCII values which the user then manipulated and converted back to string format with a secondCONVERT.
  11. ^The manual suggests, but does not outright state, that the actual range of values is less than 0 to 255.[54]
  12. ^The negative number is a side-effect of the integers being stored in signed format, so any memory location over 32767 appeared as a negative value in BASIC.[55]
  13. ^Note the odd syntax of the SCRN, which is technically a function because it returns a value, but does not use function-like syntax which would beA=SCRN(X,Y).
  14. ^The first digit of the original value was used to select a value from 0 to 9, so in this example, the token would be$B5 for the first digit of 500.
  15. ^Bill Gates complained about this, stating that it was unfair to compare Integer BASIC to a "real" BASIC like MS.[75]
  16. ^Meaning the text starts at line 20 of 24 lines on the screen, leaving four lines of text at the bottom.
  17. ^For a list of the various CALLs, PEEKs and POKEs that performed common operations on the Apple II, seePeeks, Pokes, Calls And Programming Notes, Charles Turley, 15 December 1996.

References

[edit]

Citations

[edit]
  1. ^abcdefghiWozniak 2014.
  2. ^abWeyhrich 2001.
  3. ^Rugg, Tom; Feldman, Phil (October 1977)."BASIC timing comparisons… revised and updated".Kilobaud. pp. 20–25.
  4. ^Baum, Allan (18 July 2016). "Oral History of Allen Baum" (Interview). Interviewed by David Brock. p. 12.
  5. ^"Passing the 10-year mark".MEASURE Magazine. Hewlett Packard. October 1976.
  6. ^Cooney, Michael."The (mostly) cool history of the IBM mainframe".ARN. Archived fromthe original on 2020-02-23. Retrieved2020-02-23.
  7. ^Bourne, Charles; Hahn, Trudi Bellardo (August 2003).A History of Online Information Services, 1963–1976. MIT Press. p. 387.ISBN 9780262261753.
  8. ^Barry, Tim (27 April 1981)."Back to BASIC".InfoWorld. p. 7.
  9. ^abWilliams & Moore 1984, p. A71.
  10. ^Fisk, Nathan (2009).Understanding Online Piracy. ABC-CLIO. p. 14.ISBN 9780313354748.
  11. ^Wozniak 1977.
  12. ^Weyhrich 2001, The [Integer] BASIC, which we shipped with the first Apple II's, was never assembled — ever. There was one handwritten copy, all handwritten, all hand-assembled..
  13. ^"The Apple 1 Project".
  14. ^"Apple I Computer Ad". 30 November 2009.
  15. ^Bunnell, David (September 1975)."Across the Editor's Desk".Computer Notes.1 (4). Albuquerque NM.: MITS: 2. Archived fromthe original on March 23, 2012.
  16. ^"Classic Gaming: A Complete History of Breakout". GameSpy. Archived fromthe original on August 13, 2013. RetrievedApril 19, 2010.
  17. ^Raskin, Roy; Wozniak, Steven (August 1976)."Floating Point Routines for the 6502".Dr. Dobb's. pp. 17–19.
  18. ^Apple II Reference Manual. Apple Computer. January 1978. pp. 94–95.
  19. ^abWozniak 2018.
  20. ^Hertzfeld 1985.
  21. ^Raskin 1978, p. 11.
  22. ^Raskin 1978, p. 12.
  23. ^Raskin 1978, p. 46.
  24. ^Raskin 1978, pp. 49–55.
  25. ^Raskin 1978, p. 48.
  26. ^abHelmers 1978, p. 24.
  27. ^abRaskin 1978, p. 118.
  28. ^Raskin 1978, pp. 65–67.
  29. ^Raskin 1978, p. 124.
  30. ^Wozniak 1977, "This mixed mode provides a 40 by 40 color graphics grid plus four lines of scrolling text at the bottom of the screen.".
  31. ^Raskin 1978, p. 100.
  32. ^Raskin 1978, p. 15.
  33. ^Raskin 1978, p. 52.
  34. ^Raskin 1978, p. 107.
  35. ^Raskin 1978, pp. 100, 101.
  36. ^Raskin 1978, p. 38.
  37. ^Raskin 1978, p. 27.
  38. ^Raskin 1978, p. 61.
  39. ^Raskin 1978, p. 94.
  40. ^Raskin 1978, p. 40,120.
  41. ^Raskin 1978, p. 40.
  42. ^"Strings".learn-c.org.
  43. ^Brooks, Steve."Characters & Strings in Fortran"(PDF).University of Hawaii.
  44. ^"Integer, Floating Point and String Variables".C64 Programmer's Manual. Commodore.
  45. ^North Star BASIC version 6(PDF). North Star Corporation. 1977. Archived fromthe original(PDF) on 2020-03-05. Retrieved2020-03-03.
  46. ^The ATARI BASIC Reference Manual. Atari Inc. 1980. Archived fromthe original on 2005-05-01. Retrieved2020-04-14.
  47. ^abRaskin 1978, p. 89.
  48. ^"Create your own Version of Microsoft BASIC".
  49. ^abRaskin 1978, p. 88.
  50. ^Raskin 1978, p. 92.
  51. ^altair 8080 basic manual(PDF). MITS. April 1977. p. 30.
  52. ^abcdRaskin 1978, p. 120.
  53. ^Mini 1977, p. 17.
  54. ^abRaskin 1978, p. 36.
  55. ^Mini 1977, p. 18.
  56. ^Raskin 1978, p. 84.
  57. ^Raskin 1978, p. 31.
  58. ^Raskin 1978, p. 32.
  59. ^Raskin 1978, p. 33.
  60. ^Raskin 1978, p. 73.
  61. ^Raskin 1978, p. 74.
  62. ^Atari BASIC Reference Manual(PDF). Atari. 1983. p. 25.
  63. ^North Star BASIC version 6(PDF). North Star Corporation. 1977. p. 8. Archived fromthe original(PDF) on 2020-03-05. Retrieved2020-03-03.
  64. ^abcdeWozniak 1977, p. 42.
  65. ^Helmers 1978, p. 18.
  66. ^"PRELIMINARY APPLE BASIC USERS MANUAL". October 1976.
  67. ^"APPLE II BASIC PROGRAMMING MANUAL". 1978.
  68. ^"APPLE II REFERENCE MANUAL"(PDF).
  69. ^Paul R. Santa-Maria."Apple II Integer Basic Disassembly"(PDF). Retrieved2020-09-14.[permanent dead link]
  70. ^Wozniak 1977, p. 43.
  71. ^Apple Programmers Aid(PDF). Apple. 1978.
  72. ^Apple II Reference Manual(PDF). January 1978. pp. 94–95.
  73. ^Allison, Dennis (1976)."Build Your Own BASIC".Dr. Dobb's Journal. Vol. 1, no. 1. p. 11.
  74. ^Hardiman, Roger."Altair BASIC 3.2 (4K) - Annotated Disassembly". p. 1.11. Archived fromthe original on 5 November 2001.
  75. ^abRugg, Tom; Feldman, Phil (October 1977)."BASIC timing comparisons… revised and updated".Kilobaud. pp. 20–25.
  76. ^abRugg, Tom; Feldman, Phil (June 1977)."BASIC Timing Comparisons… information for speed freaks".Kilobaud. pp. 66–70.
  77. ^Gilbreath, Jim (September 1981)."A High-Level Language Benchmark".Byte. p. 192.
  78. ^Taylor, Joseph H.; Taylor, Jeffrey S. (September 1982)."A Comparison of Five Compilers for Applesoft BASIC".BYTE. pp. 440–464. Retrieved2024-12-30.
  79. ^Ahl, David (November 1983)."Benchmark Comparison Test".Creative Computing. p. 260.
  80. ^Mini 1977, pp. 65–67.
  81. ^"Breakout, Annotated".GitHub. 16 August 2021.

Bibliography

[edit]

External links

[edit]
Dialects of theBASIC programming language (list)
Classic
Microsoft
Texas Instruments
Hewlett-Packard
Locomotive Software
Microcomputers
Minicomputers
Time-sharing computers
Other
Extenders
Procedure-
oriented
Proprietary
Free and
open source
Withobject
extensions
Proprietary
Free and
open source
RAD
designers
Proprietary
Free and
open source
Defunct
Products
Hardware
Mac
iPod
iPhone
iPad
Other
Software
Operating
systems
Services
Financial
Media
Communication
Retail
Support
Other
Companies
Subsidiaries
Acquisitions
Partnerships
Design andmarketing
Legal issues and
labour relations
Related
People
CEOs
Board chairs
Other
executives
Current
Former
Founders
  • Italics indicate discontinued products, services, or defunct companies.
  • Category
Retrieved from "https://en.wikipedia.org/w/index.php?title=Integer_BASIC&oldid=1322927016"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp