Category: Programming

Use of Apple II Color Graphics in Assembly Language

The APPLE-II color graphics hardware will display a 40H by 48V grid, each position of which may be anyone of 16 colors. The actual screen data is stored in 1 K bytes of system memory, normally locations $400 to $7FF.(A dual page mode allows the user to alternatively display locations $800 to $BFF). Color displays are generated by executing programs which modify the “screen memory.” For example, storing zeroes throughout locations $400 to $7FF will yield an all-black display while…

The Program They Said Couldn’t Be Written

The Aldrich brothers strike again.  Remember, folks, you read it first in Call-A.P.P.L.E..  “Convert”, by Ron Aldrich using the disk, will create a text file from an Integer BASIC program listing, call Applesoft, and presto, your program has been converted.   After Conversion, list it out and note all the lines that need to be changed to conform to the Applesoft format. This means that the Integer commands that are not compatible with Applesoft must be changed.  For example:  TAB must…

A Disk Utility Program

Perhaps this may be the first disk program published for Apple’s new Disk II. If so, a feather for our cap! The “SAVE” program, listed in column two will ask the user to input the file names of six disk programs, start recording on tape and hit return. SAVE will then consecutively load from disk and save to tape, in one operation, the six named programs. A neat way to make a tape for a friend from your disk collection….

Program to Initialize a Diskette

Note: In line 400 after the first quote, hit the Control key and the “D” key at the same time. This is how the disk system responds to commands within a Basic program, with Control D in a print statement.

A Patch For Double Loops

By Bob Huelsdonk When inputting to a double loop by row, then jumping out to a double loop to total by column, it is necessary to revers the subscript order. This will not work in Applesoft BASIC because the right counters do not reset.  The following simple example will demonstrate: 80 PRINT  “INPUT ‘-1’ TO TERMINATE INPUTS” 100 FOR R = 1 TO 3 120 FOR C = 1 TO 3 140 INPUT A(R,C) 160 IF A(R,C) = – 1…

Routine to Print Free Bytes

By Bob Huelsdonk Only line 30001 is required for less than 32K of Memory.  The first GOTO 30000 shows result with  greater than 32K of Memory. The second GOTO 30000 shows the result with less than 32K of memory. 30000 IF PEEK (203)>128 THEN 30002 30001 PRINT PEEK (202)+ PEEK (203)*256- PEEK (204)- PEEK (205 )*256;” BYTES FREE”: END 30002 PRINT 32767-( PEEK (204)+ PEEK (205)*256);” BYTES + “; PEEK (202)+( PEEK< (203)-128)*256 +1;” BYTES FREE”: END >GOTO 30000 30719…

Apple Mash

By Mike Thyng In the previous articles, we’ve discussed types of files – sequential and random – and general facts and figures about the PERSCI floppy disk drive. This issue I’d like to explore some of the actual commands necessary to get data to and from the diskettes. Before you can write a file, you have to do something called “opening” it.  This defines to your program that some related data – let’s say names and addresses – is going…

The Poor Man’S HEX -Decimal — HEX Converter

A pencil, scratch pad and you – that’s all you need to convert HEX TO DECIMAL, or DECIMAL TO HEX. Based on the fact that unit, ten, hundred, and thousand columns have a unique set of values for hexadecimal, the above table will assist you convert either way. This remainder equals 8 in the LSB column, and. HEX(8). So, the HEX number for 14632 is,3928. This might seem cumbersome, but it is surprising how rapid this conversion can become with…

Use of Color Mask Byte in HIRES

by Darrell Aldrich This is a brief description of the use of the color mask byte (Location 81210) for high re solution graphics in Apple Integer Basic. This mask specifies an 8 bit pattern of plottable X coordinates, with the pattern repeating itself every eight coordinates, going from left to right. The bits in this byte represent the colors violet and green, alternately. (See Figure 1). Suppose we want to mask off every other green bar on the screen as…

Routine to find page length

This handy little subroutine can be used in two manners; to fill a screen page with repetitive material or to determine the length of a screen page of print statements. Assume line 100 is a print statement with which you wish to fill the page. 100 PRINT” “:GOSUB 400 400 IF PEEK(37) < 18 THEN RETURN 410 POP:PRINT “FOR NEW PAGE HIT ANY KEY”:CALL 756:GOTO 000 Line 400 reads the cursor and finds whereitis on the page. If less than…

BASIC Programming Classes

Don Williams will be our instructor again for two levels of Integer Basic Programming classes available to our members.   Beginning and Intermediate classes will be available, with the beginning class starting sometime in August. Details will be available in the next issue of Call-A.P.P.L.E.

Key Clicker Routine

If you have a newer Apple with the silent keyboard, Don Williams has written a short and sweet machine language routine to solve your problem. 0300:  48              PHA 0301 : A9 20        LDA #$20 0303: 8D 30 CO   STA $C030 0306: 20 A8 FC    JSR $FCA8 0309: 8D 30 CO   STA $C030 030C: 68              PLA 030D: 4C 1B FD   JMP $FDIB 0038: 00 03 Once you store the address ($0300) in location $38 and hit return, your keys will click…

Bytes From The Apple

As usual, we are down to the wire again as it comes time to write this column. We are still receiving applications from all over the country as we pass the 110 mark in membership, and we would also at this time like to extend a special welcome to our first overseas member, Paul Moortgat who lives in Nieuwkerken, Belgium! There are many special features for new members in this issue, and we would like to refer you to the…

Converting Applesoft I to II

A complete program listing is given below to convert a program written in Applesoft I so it will load in Applesoft II.  This program is available from the club library, as is a version of Applesoft I with corrections made. Load the converter program in Integer BASIC and RUN.  The program will instruct you when to load your Applesoft I program.  When the conversion is complete and you have re-saved your Applesoft I program, load it into Applesoft II and…

Applesoft II Pointers & Tokens

By Val J. Golding Applesoft & Applesoft II store in memory from the bottom up, unlike Integer BASIC, which is just the opposite, storing from the top down. Although pointers and characteristics of Applesoft I and II are similar, they are different. Therefore we will limit ourselves to APII in this discussion. Programs store startirlg at decimal location 12289 upwards, at’Id variables are located starting at the high end of program storage. Where there is no program present, theh the…

Routine to Format Decimal Numbers

10 REM ROUTINE TO FORMAT DECIMALNUMBERS ROUNDED OFF TO TWO PLACES AND RIGHT JUSTIFIED BY BOB HUELSDONK 15 REM 4/27/78 20 REM APPLE PUGETSOUND PROGRAM LIBRARY EXCHANGE 6708 39TH AVE SW SEATTLE, WA. 98136 70 FOR I • 1 TO 10: READ A: P= A : GOSUB 6000 75 PRINT P$: NEXT 80 END 90 DATA 56.2,23456.1,5,1.186,345.70,23,678.0123,-99999.889,.2389,789S67 100 REM 110 REM ” A.’ WAS CHANGED TO ‘P’ 120 REM TO KEEP THE SUBROUTINE 130 REM ANONYMOUS. 140 REM WORKS FOR…

Applesoft ][ Tokens

NOTE:Values 00 to 7F (0 to 127 decimal) are used by the standard Ascii character set. As in Integer BASIC, Apple II outputs last two rows (60-7F) as uppercase. This table is a complement to “Applesoft II Pointers and Tokens on Pages 6 & 7, and should be saved as a  permanent reference chart.

HIRES Capabilities and Limitations

By Darrell Aldrich While written for Applesoft II, this article is also applicable to Integer Basic HIRES graphics mode. The High Resolution Graphics screen is composed of 280 vertical bars (X coordinates), by 160 units high (Y coordinates). The even-numbered bars are violet in color, while the odd-numbered bars are green. The color white is produced by plotting adjacent green and violet bars. (Green+Violet=White. ) By plotting only on even bars, (even X coordinates), violet plots can be made. However,…

Assembly Language Classes

The Assembly Language classes are now scheduled to start June 1 at Empire Electronics. Cost $35 per persorn including Synertek manual. To sign up, call Tom Geer at (206)244-5200 or Don Williams at (206)242-6807. The course includes Number Systems, Boolean Algebra, 6502 Instruction set and Programming.

Applesoft II Workshop

We will have available sometime within the next month the Applesoft II version of Programmers Workshop, with most of the same routines, Append, Renumber, Examine Basic, Pick a Base, Poke writer.  Pricing has yet to be determined.