For instance, suppose bit 1 of location 40963 is 0 when the door to Room X is closed, and 1 if the door is open. The following program will print "Intruder Alert" if the door is opened:

10

IF NOT (PEEK(40963) AND 2) THEN 10

This line will execute over and over until

 

 

bit 1 (masked or selected by the 2)

 

 

becomes a 1. When that happens, we go

 

 

to line 20.

20

PRINT "INTRUDER ALERT"

Line 20 will output "INTRUDER

 

 

ALERT."

However, we can replace statement 10 with a "WAIT" statement, which has exactly the same effect.

10 WAIT 40963,2

This line delays the execution of the

 

next statement in the program until

 

bit 1 of location A003 becomes 1. The

 

WAIT is much faster than the equivalent

 

IF statement and also takes less bytes

 

of program storage.

The following is another useful way of using relational operators:

125 A=-(B>C)*B-(B<=C)*C

This statement will set the variable A

 

to MAX(B,C) = the larger of the two

 

variables B and C.

303 COMMANDS

A BASIC command may be entered when the cursor is displayed. This is called the "Command Level." Commands may be used as program statements. Certain commands, such as LIST, NEW, and LOAD

will terminate program execution when they finish. Each command may require one or more

arguments in addition to the command statement, as defined in the syntax/function description. An argument without parenthesis is required to be entered without parenthesis. Arguments contained within parenthesis are required to be entered with the shown parenthesis. Arguments within brackets are optional. Optional arguments, if included, must be entered with or without accompanying parenthesis, however shown.

STATEMENT

SYNTAX/FUNCTION

EXAMPLE

CLEAR

CLEAR

CLEAR

 

Clears all program variables, resets "FOR"

 

and "GOSUB" state, and restores data.

STATEMENT

SYNTAX/FUNCTION

EXAMPLE

CONT

CONT

CONT

 

Continues program execution after the F1

 

key or a STOP or INPUT statement termi-

 

nates execution. You cannot continue after

 

any error, after modifying your program, or

 

before your program has been run. One of

 

the main purposes of CONT is debugging.

 

Suppose at some point after running your

 

program, nothing is printed. This may be

 

because your program is performing some

 

time consuming calculation, but it may be

 

because you have fallen into an "infinite

 

loop." An infinite loop is a series of BASIC

 

statements from which there is no excape.

 

BASIC will keep executing the series of

 

statements over and over; until you inter-

 

vene or until power to the AIM 65 is

 

turned off. If you suspect your program

 

is in an infinite loop, press F1 until the

 

BREAK message is displayed. The line

 

number of the statement BASIC was

 

executing will be displayed. After BASIC

 

has displayed the cursor, you can use

 

PRINT to type out some of the values of

 

your variables.

After examining these

 

 

 

Page 236
Image 236
Apple II Print Intruder Alert, Commands, Statement SYNTAX/FUNCTION Example Clear, Statement SYNTAX/FUNCTION Example Cont

II specifications

The Apple II, launched in April 1977, was one of the first highly successful mass-produced microcomputer products. It marked a significant leap in personal computing, setting standards for future developments in the industry. Created by Steve Wozniak and Steve Jobs, the Apple II differentiated itself with its user-friendly design, appealing aesthetics, and robust capabilities.

One of the standout features of the Apple II was its open architecture, which allowed users to expand and enhance the computer's functionality. This design enabled hundreds of third-party hardware and software developers to contribute to its ecosystem, resulting in an array of peripherals, including printers, modems, and storage devices. The Apple II utilized a MOS Technology 6502 microprocessor running at a clock speed of 1 MHz. Initially equipped with 4 KB of RAM, the machine could be expanded to 48 KB, accommodating more complex applications and programs.

The Apple II was also notable for its colorful graphics. It was one of the first computers to support color display, offering a 6-color palette with a resolution of 280x192 pixels in 16 colors when using its Color Graphics Card. This feature significantly enhanced the visual appeal of games and educational software developed for the platform, making computing more accessible and entertaining for various audiences.

Apple's commitment to user experience was evident in the design of the machine. It featured an integrated keyboard and a plastic case, which was both durable and visually appealing. The self-contained design included drive bays for floppy disk drives, allowing for quicker data access than traditional tape drives. It also supported audio output, enabling sound effects and music, a novelty at the time.

The introduction of the Apple DOS operating system further underscored the machine's capabilities. DOS streamlined file management and made it easier for users to navigate and manage their data. The combination of hardware and software positioned the Apple II as an educational tool and a gaming platform, fostering a vibrant software ecosystem.

The Apple II family continued to evolve, with variations like the Apple II+, IIe, and IIgs being introduced over the years. These iterations brought enhancements in memory, processing power, and graphics capabilities. The legacy of the Apple II endures, not only as a foundational product in personal computing but also as a symbol of innovation that paved the way for future advancements in technology. Its impact is still felt today, as it inspired countless developers and shaped the trajectory of the computer industry.