Motorola iDEN Keyboard Mini 32K Operating instructions

'A M APPLE ATARI KIM OSI PET SYM APPLE KIM PET AIM ATARI OSI SYM ATARI PET APPLE OSI AIM KIM AIM KIM APt
ATARI SYM OSI ATARI AIM PET KIM APPLE SYM APPLE KIM PET AIM ATARI OSI SYM ATARI PET APPLE OSI AIM KIM AI
PET KIM ATARI SYM OSI ATARI AIM
PI.A
1M OSI PET SYM APPLE KIM PET AI
a I SYM ATARI PET APPLE OSI AI
)
T..
AIM PET KIM APPLE AIM APPLE AT
SYM AIM APPLE KIM PET AIM ATA
.
1M APPLE PETATARI SYM OSI AT.
KIM PEt APPLE AIM APPLE ATARI
ET AIM ATARI OSI SYM ATARI PE7
APPLE OSI KIM AIM SYM OSI PET A
II'
RI
.E
SYM PET OSI KIM ATARI APPLE AT.
AIM APPLE ATARI KIM OSI PET SYM APPLE KIM PET AIM ATARI OSI SYM ATARI PET APPLE OSI AIM KIM AIM KIM AP
ATARI SYM OSI ATARI AIM PET KIM APPLE SYM APPLE KIM PET AIM ATARI OSI SYM ATARI PET APPLE OSI AIM KIM AI
PET KIM ATARI SYM OSI ATARI AIM P
P
TARI KIM OSI PET KIM eSI PET SYM APPLE KIM PET AlA
OSI SYM ATARI PET.
E,
1M K.
RI S
T.
PLE AIM APPLE AT
SYM AIM APPLE KI
'ARI •
as
ATARI SYM OSI AT,
1M PET APPLE AIM P
I KI
TS
I SYM ATARI PE
APPLE OSI KIM AIM SYM OSI PET ATARI SYM OSI ATARI AIM PET KIM APPLE AIM AIM SYM PET OSI KIM ATARI APPLE A T.
AIM APPLE ATARI KIM OSI PET SYM APPLE KIM PET AIM ATARI OSI SYM ATARI PET APPLE OS! AIM KIM AIM KIM AP
ATARI SYM OSI ATARI AIM PET KIM APPLE SYM APPLE KIM PET AIM ATARI OSI SYM ATARI PET APPLE OSI AIM KIM AI
Human Physiological Parameters
LET YOUR
ICRO HELP YOU
GET IINTO S'HAPIE
'AIM APPLE KIM PET AIM ATARI OSI SYM ATARI PET APPLE OSI AIM KIM AIM KIM APPLE PET ATARI SYM OSI ATARI
ET APPLE AIM APPLE ATARI KIM APPLE ATARI KIM OS! PET SY", APPLE KI", PET AI", ATARI OSI SY", ATARI PET AP
E OSI KI", AI", SYM OSI PET ATARI SYM OSI ATARI AI", PET KI", APPLE AI", AI", SY", PETOSI KI", ATARI APPLE ATARI
PPLE ATARI KIM OSI PET SYM A
I
ATA
AI", KI", AI", KI", APPLE
I S~
TA
PET KIAI
'lf/OS
PPLE OSI
I
AP
IAI
AI
TARI AlAI
I
OSI
YII APPLE
AT.
YAI ATARI PET APPLE OSI AIM KIM AIM KIM APPLE PET ATARI SYMOSI ATARI AI PET KIAI APPLE AI APPLE ATARI
AIM APPLE KI", PET AlAI ATARI OSI SYM ATARI PET APPLE OSI AIAlIeIAl AlAI KIM APPLE PET ATARI SY OSI ATARI
PET APPLE AIM APPLE ATARI KIAI APPLE ATARI KIAI OS! PET SYM APPLE IeIAl PET AIM ATARI OSI SY", ATARI PET AP
E OSI KIM AIM SYM OSI PET ATARI SYM OSI ATARI AI", PET KIM APPLE AIM AIM SY", PET OSI KIAI A TARI APPLE A TARI
softsidesOI~ware
30~
Riverside Drive New York. N.Y.
1
GRAPHICS PAC 2
2
ASSEMBLER 2001
1002:»
Quadruple your PET's graphic resolution. Why be
stuck with the PET's cumbersome 25 x 40 1000 point
display. With Graphics Pac you can directly control
(set and clear) 4000 points on screen. It's great for graphing, plotting, and gaming. Graphics
Pac allows you to plot in any combination of two modes: 4 Quadrant graphing with (0,0) center
screen, and Standard graphing with (0,0) plotted in the upper left hand corner. Complete documentation shows how you can merge this useful routine with any of your own programs without retyping either one! All this on a high quality Microsette for only $9.95.
New Version
A full featured assembler for your PET microcomputer that follows the standard set of 6502 mnemonics.
Now you can take full advantage of the computing
abilities of your PET. Store and load via tape, run through the SYS or USR functions. List a'nd
edit too with this powerful assembler. No other commercial PETassembler gives you all these
features plus the ability to look at the PET'S secret Basic HOMs all in one program. This valuable program is offered at $15.95
An exciting new simulation that puts you III
charge of a bicycle manufacturing empire. Juggle
inflation. breakdowns, seasonal sales variations,
inventory. workers. prices. machines. and ad campaigns to keep your enterprise in the
black. Bike is dangerously addictive Once you start a game you will not want to stop. To
allow you to take short rest breaks. Bike lets you store Ithe data from your game on a tape
so you can continue where you left off next time you wish to play. Worth a million in fun,
we'll offer BIKE at $995.
Dynamic usage of the PET's graphICS features
when combined with the fun of the number 1 arcade
game equals an action packed video spectacle for
your computer. Bumpers. chutes. flippers. free balls. g·ates. a jackpot, and a little luck
guarantee a great game for all. $995.
Authors: Our royalties are unbeatable
3
BIKE
4
*
SPECIAL
1:ctrtrt:rt:r* MUSICAL MADDNESS ******
add an exciting new dimension to your PET computer
with Soundware's soundsational music box
and sonicsound software from Softside & Soundware
*THE SOUNDWORKS *
The Soundware music box for your PET
comes complete with controllable volume,
an earphone jack, a demo tape with two
programs. an instruction book. and a one
year warranty. this sturdy unit is enclosed
in an attractive plastic case. Notes tell
how to program your own sound effects.
All this during our musical madness for
just
29.95
WORD FUN: Speller: fun ways to practice
spelling + Scramble + Flashcards
9.95
*
SOUND
*MUSICAL SOFTWARE *
ACTION PACK: Breakthru + Target +
Catterpillar: non stop graphic action 9.95
PINBALL: a video action spectacle with
real time flippers, chutes gates. bumpers.
tags etc. .
9.95
CLASSICS: Checkers + Backgammon
Board + Piano Player; checkers vs. computer or friend. Piano plays Minute Waltz
9.95
MUSIC MANIA: Try to repeat a growing
sequence of tones. With graphics. Challenge to the best ear
9.95
Skyles Electric Works
The BASIC Programmer's Toolkit
For PET Owners Who Want More Fun
And Fewer Errors with Their Programming
Here are Ten Comands you'll need, all on a single chip you can install,
in a minute without tools, on any PET or PET system. 2 KB of ROM
firmware on a single chip with a collection of machine language
programs available to you from the time you turn on your PET to the
time you shut it off. No tape to load or to interfere with any running
programs.
AUTO
DELETE
STEP
OFF
RENUMBER
HELP
TRACE
APPEND
DUMP
FIND
LIST
RJN
RUN
10
15
16
99
GOSUB 99
PRINT I
GOTO 10
INPUT .I
100 IF J ~O THEN END
200 I ~ SOR JIRETURN
READY
READy
?DIVI$ION BY ZERO ERROR IN 500
DUMP
AEADY
HELP
SOOJ=SQR(A"S .")
READY
A1
BW
'J
CS
HI
f)
1
READY
RENUMBER 'C'0,10
READY
LIST
)
100 GOSUB 130
110 PRINT I
120 GOTO 10')
130 INPUT.
140 IF J = 0 THEN END
'50 I ~ SORIJIRETURN
READY
Can be placed in main board socket or with precision-engineered PCB
connector to attach to data bus ... depending on the model of your PET
and additional memory systems.
Now available to interface
8N/8B, 16N/16B, 32N/32B PET...chip only
2001-8...chip and interface PCB
With Expandamen, PME 1
R. C. Factor or Skyles Electric Works systems
With Computhink Disk System
With Commodore's Word Processor II, for original 2001-8 PETs
With Commodore's Word Processor II, for new PETs
Wi·th Skyles Macro TeA
$50.00*
80.00*
80.00*
85.00*
90.00*
72.50*
50.00*
·Shipping and handling, California sales tax where applicable must be added. See order
form attached.
'California residents: please add 6% or 6,5% sales tax
u
~
as requlfed
VISA, MASTERCHARGE ORDERS CALL (800) 538-3083 (except California residents)
CALIFORNIA ORDERS PLEASE CALL (408) 257-9140
10301 Stonyda1e Drive
Skyles Electric Works I f:~~~~fomia95014
_ _ _ _ _.. __••.
~"..
.
I"
•••••••••••••••••••••••••••••••••••••••
•
••
:
:
Safliware far lihe Apple II
•
<in
ci
I
:.~
:'i I· I
••
•••
••
•
•
•
•
~~~
I
•
:
;'
:
I
SCORE: 10S
•:
••
:
SCORE: t0S
•••
••
•••
•
ULTRA BLOCKADE- the standard against which
other versions have to be compared. Enjoy Blockade's superb combination of fast action (don't be
the one who crashes) and strategy (the key is
accessible open space-maximize yours while minimizing your opponent's). Play against another
person or the computer. New high resolution
graphics lets you see how you filled in an area-or
use reversibility to review a game in slow motion
(or at top speed, if that's your style). This is a
game that you won't soon get bored with! By
Don Stone. Integer Basic (plus machine language);
32 K; $9.95.
•
•
•
•
•
•
•
•
DYNAMAZE-a dazzling new real-time game. You
move in a rectangular game grid, drawing or erasing
walls to reflect balls into your goal (or to deflect
them from your opponent's goal). Every ball in
your goal is worth 100 points, but you lose a point
for each unit of elapsed time and another point for
each time unit you are moving. Control the speed
with a game paddle: playas fast as ice hockey or
as slowly and carefully as chess. Back up and reo
play any time you want to; it's a reversible game.
By Don Stone. Integer Basic (plus machine language); 32 K; $9.95.
•
•
•
•
What is a REVERSIBLE GAME? You can stop the play at any point, back up and then do an "instant
replay", analyzing your strategy. Or back up and resume the game at an earlier point, trying out a different
strategy. Reversibility makes learning a challenging new game more fun. And helps you become a skilled
player sooner.
•
•
•
WORLD OF ODYSSEY-a new adventure game utilizing the full power of Disk II, which enables the player
to explore 353 rooms on 6 different levels full of dragons, dwarfs, orcs, goblins, gold and jewels. Applesoft II
48K; $19.95 includes diskette.
••
•
•
PERQUACKEY-an exciting vocabulary game which pits the player against the clock. The object of the
game is to form words from a group of 10 letters which the computer chooses at random. The words must
be 3 to 10 characters in length with no more than 5 words of any particular length. Each player has only
3 minutes per turn. The larger the words the higher the score. Applesoft II 16K; $9.95.
•
•
•
•
•
APPLESHIP-is a naval game in which two players enter their ships in respective oceans. Players take turns
trying to blast their opponent's ships out of the water. The first player to destroy their opponent's ships
may win the game. A great low-res graphics game. Applesoft II 32K; $14.95.
•
•
•
•
•
•
•
•
•
•
•
•
Available at your
local computer store
Call or write for our free
SOFTWARE CATALOG
DEALER INQUIRIES INVITED
POJITEH§OFT. INC.
•
•
•
•
:7
Apple II is a registered
trademark of
Apple Computer, Inc.
P. O. BOX 157
PITMAN, NEW JERSEY 08071
(609) 589.5500
•
•
•
•
•
•
•
•
•
•
•
•
•
•
••
Programs Available on Diskette
at $5.00 Additional
•
• Check or Money Order
.'
shipping and handling
C.O.D. ($1.00 add'tl. charge)
• Master Charge and VISA
orders accepted
• New Jersey residents add
5% sales tax
•
•
•
• Include $1.00 for
•
•
•
•
•
.......................................
Tape Execute File
Create and Use
Once upon a time, a computerist wanted to convert his
integer BASIC programs to Applesoft BASIC. He read
about a great technique . but it required a disk. He did
not have a disk, but did have cassettes. Could the
technique be modified for tape? And, what other
changes would be required for the complete conver·
sion? Some interesting things were discovered, and are
reported here.
For a long time, I had been trying to
find a way to convert Integer programs
to Applesoft. So it was with great in·
terest that I read the How to Section ti·
tied "Disk Magic;; in Contact 5. A short
summary follows for those who didn't
get Contact 5. It was a way to list the Integer programs on to disk and then load
it into Applesoft. This was done by placing the following line in the program:
o
PRINT"@ OPEN X":POKE 33,33:
PRINT"@WRITE
X":L1ST:PRINT"@CLOSE X":END
(Where @means Control D)
When this line is entered type "RUN"
and press "RETURN". When the operation is complete, enter Applesoft and EX·
ECute the file.
The only problem with this method
.,
is that I do not have a disk yet.
I started to think about how this
could be done with just a tape. During a
normal "SAVE" both Integer and Applesoft write the program to tape the
way it is stored in memory, not the way it
is listed. The program is stored as
tokens; and since the tokens do not
match, Applesoft cannot load Integer
programs.
So I wrote two routines which link
into the input and output hooks CSW
and KSW at $36-$39. (This article uses
"$" to indicate a hexadecimal number.)
The output routine gets each byte
as the Apple outputs it and stores it in a
buffer before the actual output. When
the Apple outputs a carriage return, the
routine writes the buffer to tape. This
continues until the Apple outputs a car·
Allen J. Lacy
1921 Oglethorpe Avenue
Albany, GA 31707
riage return as the first character, the
routine then resets the output hook.
The buffer is 256 bytes long. This
number was chosen because that is the
length of the Apple's input buffer. Note
the buffer is from $3FOO to $3FFF
(decimal 16128 to 16383). This is
because my Apple has 16K. For different
memory sizes this can be changed. If
you have an assembler, change the
SAVE address to the values in table 1. If
you do not have an assembler, change
the locations shown in table 2.
The input routine reads the tape
records back into memory and passes
the bytes through the input hooks. This
continues until a record comes in which
contains a carriage return as the first
byte, the routine then gives control back
to the keyboard.
.J
January, 1980
MICRO -- The 6502 Journal
20:5
MEMORY SIZE
SAVE ADDRESS
$7FOO
$BFOO
32K
48K
HIMEM
32512
-16640
Applesoft
A = 16 • RND(1)
In Integer either "#" or ''9' can be
used to mean not equal, in Applesoft only "(y' can be used.
Example:
Table I
Integer
IF A # B THEN 10
The first version used the tape write
routine at $FECD, which writes a 10 second header; therefore, the write took
about 11 seconds, 10 for the header and
1 for the data. However, I noticed that at
$FECD the instruction is LOA #$40
followed by JSR HEADR. Therefore
when I want to write a record to tape, I
load the accumulator with $20 and enter
the monitor at $FECF. This causes the
Apple to write a 5 second header, which
means each record takes 6 seconds.
Now what you have to do is change
the things which are different between
Applesoft and Integer. This wilt have to
be done whether you use the disk or
tape.
All "TAB" statements have to be changed to 'HTAB"
All computed "GOTO" and 'GOSUB"
have to be changed to "ON"
"GOTO" or "ON" "GOSUB".
Applesoft
IF A(>B THEN 10
There is no "MOD" operation in Applesoft, so you have to calculate the
modulus.
Example:
Integer
B = A MOD C
Example:
To use:
Where N can vary from 1 to 4
Integer
GOTO 400 + N • 100
Load the routines into memory
Enter Integer Basic
Type "HIMEM:16128"
Press "RETURN"
Load the Program
Type in the following line:
o POKE 33,33:CALL 769:L1ST:END
Type "RUN"
Set the recorder in record mode
Press "RETURN"
Applesoft
ON N GOTO 500,600,700,800
All multi statement "1F"s will have to be
broken into two lines because of difference in the way Integer and Applesoft
handle ifs.
The program will now list to tape
and the TV. When this has finished, the
prompt (» will reappear.
Now enter Applesoft
Rewind the Tape
Warning: Since the headers are only 5
seconds long, you must set the tape as
close to the beginning of the first one as
you can.
The program will come into Applesoft as if you had typed it in. When
the Applesoft prompt Ol appears with
just the cursor behind it, control is back
at the keyboard.
Variable names may have to be
changed. In Integer all letters are significant; in Applesoft only the first 2 letters
are significant. To Integer PAY1 and
PAY2 are different; to Applesoft they are
the same variable.
Example:
Integer
PAY1 = PAY2 + PAY3
Example:
100 IF A=B THEN A=A+1:C=C+1
In Integer C always has one added
to it, whether or not A equals B. This
same line in Applesoft will cause C to
have 1 added to it only if A equals B. So
for the program to work like the Integer
program, the line will have to be broken
into two lines.
100 IF A=B THEN A=A+1
101 C=C+1
Type "HIMEM:16128"
Press "RETURN"
Type "CALL 772"
Start the recorder in play mode
Press "RETURN"
Applesoft
B = A- INT(A/C) • C
Applesoft
P1 = P2 + P3
Another difference is the way strings are handled. In Integer "DIM A$(20)"
means set up 1 string which can be up to
20 characters long. To Applesoft, it
means set up 20 strings each of which
can be up to 255 characters long. So all
string dims should be removed from the
program.
The random number functions are
different between Integer and Applesoft.
Also to get specific characters out
of a string, you have to use the MID$
function in Applesoft.
Example:
Example:
Integer
B$ = A$(2,5)
Integer
A = RND(16)
Applesoft
B$ = MID$(A$,2,3)
MEMORY SIZE
32K
48K
$30C
$322
$340
$369
HIMEM
$7F
$BF
$7E
$BE
$7F
$BF
$7E
$BE
32512
-16640
Example:
Integer
A = B
Table /I
20:6
The last difference that I have found
is that all variables should be converted
to Applesoft integer variables. This is
not always needed, a lot of programs
will run without this being done.
MICRO -- The 6502 Journal
App/esoft
A% = B%
January, 1980
1000 ** ••••••••• *** •••••••••••• ** •• ***
1010 •
1020 •
TAPE EXECUTE FILE
CREATE & USE
1030 •
1040 •
1050 • MAIN USE TO CONVERT INTEGER
1060·
PROGRAMS TO APPLESOFT II
1070 •
1080 •
BY
ALLEN J LACY
1090 •
AUGUS'f 1979
1100 •
1110 •
1120 •••••••••••••••••••••••••••••••••
1130 •••••••••••••••••••••••••••••••••
0301- 4C 9E 031
1140
1150
1160
1170
llBO
1190
1200
1210
1220
1230
1240
1250
1260
1270
12BO
1-290
•
• 256 BYTE BUFFER TO STORE TEXT •
• FROM ADDRESS S3FOO TO S3FFF
• CHANGE FOR LARGER APPLE II
•
•••••••••••••••••••••••••••••••••
SAVE .EO S3FOO
PT
.EO 5300
gSW .EO SFOIB
WR
.EQ SFECF
RE
.EQ SFEFO
COUT .EO SFOOO
XSAV .EO 547
.OR S301
•
•••••••••••••••••••••••••••••••••
1300
1310
1320
1330
1340
1350
•
• S~f UP FOR OUTPUT OF FILE
•
•••••••••••••••••••••••••••••••••
STP JMP SP
•
1360 •••••••••••••••••••••••••••••••••
1370 •
13BO • SET UP FOR INPUT OF FILE
1390 •
1400 •••••••••• * ••••••••••••••••••••••
0304- 4C 80 03
1400 STK
1420 •
JllP SK
1430 •••••••••••••••••••••••••••••••••
1440
1450
1460
1470
03070309030B0300030F0311031303150317-
0318031A031003200323032503270329032:::032003300332033403370339033C033F:: 034003430345034803490348034E035103530356-
)
fl9
85
A9
85
A9
85
A9
85
60
86
Ff.
fiE
90
C9
FO
A6
20
60
AD
C9
FO
20
.1\.9
20
A6
119
20
A9
80
60
A9
80
20
A9
20
119
00
3C
3F
3D
FF
3E
3F
3F
47
00
00
FF
80
06
47
FO
00
01
15
07
20
CF
47
80
FO
00
00
•
·SUBROUTINE TO SET TAPE POINTERS·
••••••••• * •••••••••••••••••••••••••
0358035A035C035E-
035F036103640367036A036C036E037103730375037B037A0370037F03Bl038203B403B603BB038A03BO03BF0391039303950398039f103900391:03AO03A20311403A603A803AB03AC03.AF0332-
14BO SEf LOA tSAVE
1490
STA 53C
1500
LOA ISAVE
1510
S·fA S30
1520
LOA tSAVE+255
1530
S'fA S3E
1540
LOA ISAVE+255
1550
STA $ 3F
1560
RTS
1570 •
1580 * ••••••••••••••••••••••••••••••••
03
03
3E
FO
03
03
FI':
FO
03
SO
00 3F
07 03
20
CF FE
FO
1590
1600
1610
1620
1630
1640
1650
1660
1670
16 BO
1690
1700
1710
1720
1 730
1740
1750
1760
1770
1780
1790
IBO 0
IBI0
1820
1830
IB40
IB50
IB60
1870
18BO
IB90
•
• BITE OUTPUT ROUTI NE
•
•• ~*.* •••••• *•••••• *•• *.**.******
PPT srx XSAV
STORE )t PEG
I!'lC PT
LOX PT
S'fA SAVE-LX S·fORE [lYTE
CMP t S80
CP?
BE(1 CR
L9X XSAV
RESTOPF:: )t REG
JSR COUT
RTS
CR
LOA PT
'lPT
C~lP
H
BEQ
JSR
WII
JSP
LaX
WA
JSR
L'l.A
S·fA
RTS
LOA
s'rA
JSR
WA
JSR
L'lA
NPT
SF.T
H20
\,p
XSAV
.589
COUT
.0
47
00
00
FF
80
11
00
01
00
AC
00
00
BO
47
03
03
3E
03
03
03
IB
3B
FO
39
70 03
51'
3B
03
39
AC 03
00
00 03
IB
36
03
37
00
00 03
07 03
FO FE
STA 536
WA ICOllT
Sf A $37
RT~
•
**~**************.*******~***~***
•
• BYTE INPuT ROUTINE
•
*********************************
RI':O
STX
INC
Ll)X
LOA
CMP
BNE
LOA
CMP
BEO
JSR
LOA
STA
RCR LOA
NCR LOX
RTS
NKEY LOA
S'fA
LOA
S'fA
JMP
SK
LOA
STA
LeA
STA
JSP
LOA
STA
RTS
SP
LO}l
Sf A
LOA
srA
LOA
STA
RTS
TR
JSR
JSP
RTS
XSAV
PT
PT
SAVE-l,X
ISBO
NCR
PT
SIIVE X REG
GET BYTE
CR?
U
NKEY
TR
to
PT
'SBo
XSAV
LOAD CR
RC:STORE X REG
'KSW
S 3B
IKSW
S39
ReR
'RED
S3B
IRED
S39
TP
GIVE CONTROL
TO KEYBOARD
tPRT
S36
IPRT
537
.0
PT
GI VE OUTPUT
CONTROL TO
PRT
'0
PT
GIVE INPUT
CONTROL TO
RED
REIIO 1ST RF::C
SET
PE
.CN
EOITIED BY
OAVID E. SMITH
YOU SOUGHT THE 8ESTI NOW LEARN TO USE tTl
AT LAST!
\
A ma........ devoted to A""Hc.tlOIIa ..
wen . . Teollnlque fer the Apple Comput••
THE APPLE SHOPPE W'LL TEACH YOU HOW TO
DO ALL THOSE FANCY THINGS ON THE APPLE.
LEARN HOW OTHERS ARE USING THIEIR
APPLES IN THE HOME, SCHOOLS AND 8US,·
NESSES.
ReSET PT
o YES
I want to learn now to get the most out otmy Apple. Send me aoneyear
subec,iptlon. I enclose 112.
NAME:
_
# SB'l
SAVE
SF:T
IS20
#eOllT
B6
EE
AE
BO
C9
DO
AD
C9
FO
20
A9
BO
A9
A6
60
A9
85
A9
B5
4C
A9
B5
1\9
B5
20
A9
80
60
A9
B5
A9
B5
}l9
BO
60
20
20
60
1900
1910
1920
1930
1940
1950
1960
1970
1980
1990
2000
2010
2020
2030
2040
2050
2060
2070
2080
2090
2100
2110
2120
2130
2140
2150
2100
2170
2180
2190
2200
2210
2220
2230
2240
22 50
2260
2270
22BO
2290
2300
2310
2320
2330
2340
2350
236C
2370
23BO
5 src HE'\orp
\·!PITE TO TAPF:
RS8TOPE )tPEG
OUTPUT CR
PT
I,P
85 36
1\9 FO
B9 37
60
ADDRESS,
CllY
l'/PITF LJ\ST PF:C
PESF:T PRI'H
o
_
STATE _ _ ZIP _ _ PHONE
_
NO. I al....dy know il all. but send me a Ir.. sample of next issue.
Send check or money order to: Apple Shoppe, P.O. Box 701, PlacentiL CA m70
or call (714) 996-0441
compQ~
microsystems
P.O. Box 687
224 S.E. 16th Street
Ames, Iowa 50010
DAlm
DAIM is a complete disk operating system for the ROCKWELL INTERNATIONAL
AIM 65. The DAIM system includes a controller board (with 3.3K operating system in
EPROM) which plugs into the ROCKWELL expansion motherboard, packaged power
supply capable of driving two 5 1/4 inch floppy drives and one or two disk drives
mounted in a unique, smoked plastic enclosure. DAIM is completely compatible in
both disk format and operating system functions with the SYSTEM 65. Commands
are provided to load/save source and object files, initialize a disk, list a file, list a disk
directory, rename files, delete and recover files and compress a disk to recover
unused space. Everything is complete - plug it in and you're ready to go! DAIM
provides the ideal way to turn your AIM 65 into a complete 6500 development
system. Also pictured are CSB 20 (EPROM/RAM) and CSB 10 (EPROM programmer)
which may be used in conjunction with the DAIM to provide enhanced functional
capability. Base price of $850 includes controller board with all software in EPROM,
power supply and one disk drive. Now you know why we say -
There is nothing like a
DAlm
Phone 515-232-8187
Why a PET, APPLE, 6502 BASIC
Compiler? A Simple Explanation
BASIC, on almost all 6502 microcomputers, is run with
an Interpreter. A more efficient method of running
BASIC is through a Compiler. This article discusses
what a Compiler is, how it works, and discusses a
BASIC Compiler currently under development.
A group of Canadian PET users are
developing a compiler for the PET that
will also be usable on the APPLE or any
6502 based computer. This may be a very
significant step in regards to the
usefulness of the PET.
This article answers the questions
indicated in its sub-headings. So as not
to waste your, the reader's, time, you
should just go to those sub-headings to
which you do not know the answer.
The Topics Being Covered are:
I. What is a compiler?
2. What is the difference between a compiler and an interpreter?
3. What is the difference between a
direct compiler and a p-code compiler?
4. Why would a BASIC compiler be so
useful on a PET?
5. What is the status of the CAN PET
BASIC compiler?
What is a Compiler?
A compiler is a computer program
which takes a set of instructions, written
according to some set of rules, and
transforms it into a machine language
computer program, a string of binary
characters. This is the real machine
language. Everything actually stored in
the machine can be represented by a
combination of 1 and 0 digits.
January, 1980
Early computers built in the 1950's
were programmed with strings of binary
numbers and it was extremely difficult
to tell where an error had been made in a
long binary string as, 10111010110101.
There are convenient methods of converting binary numbers to other number
bases such as octal, hexadecimal, or
decimal. Thus programmers were able to
use more recognizable numeric strings
such as, 73 (Octal) or A2 (Hex) to represent their Instruction Code, Operations
performed by a computer (such as add,
subtract, or move data from one location
to another) have specific operation
codes assigned to them. Some computers have as many as four hundred different operations (op-codes) in their instruction set.
Because it was still easy for a programmer to become confused about
what the numbers represent, a still more
simplified method of representing programs was developed using what are
called mnemonics (nuhh-monics). For
example, the letters AD might be used
for add, SB for subtract, and LOA for
load register A. This method of writing
programs is sometimes mistakenly called machine language programming; in
fact, together with symbolic addressing,
it is Assembler Language Programming.
A program has to be available that
will recognize the mnemonics of the
assembly language instructions,
translate them into the appropriate opcodes, and allocate actual storage locations for those ..r.epresented by the pro-
MICRO -- The 6502 Journal
Bruce M. Beach
Horning's Mills
Ontario, LON 1JO
Canada
gram mer as symoolic names, Such a
program is called an assembler. If such
a program (an assembler) is not
available and the operating instructions
are written using only numeric code, the
program is said to have been "hand
assembled",
More powerful assemblers keep
track of address locations in programs
and may provide various helpful debugging aids. However, even the most powerful assemblers still require an
understanding of assembly language in
order to use them; and more importantly
still, the more powerful they are the
more likely they are to be untransportable. That is to say they are unlikely to
be able to move from one model of a
machine to another because they usually gain their "macropower" from
features inherent in a particular
machine,
Because a great deal of skill and effort is required to write a program in
assembly language, new languages called higher level languages were designed
to make life easier. The first Widely used
such higher level language was FORTRAN (FOR-mula TRAN-slater) used
mainly by the mathematically oriented.
The FORTRAN compiler allowed the programmer to express his problem in
rather
conventional
looking
mathematical notation and then took
the program SEE BOX and converted it
into assembly language instructions or
directly into Machine Code.
20:9
Another high level language,
COBOL (Common Business Oriented
Language), was developed for accountants and the business community
which allowed these professionals to express their computer programs in expressions easily learned by them. The
COBOL compiler (a program written in
machine language) took the user's program written in COBOL and compiled it
into an executable machine language
program. Other well known languages
which require compilation are "C",
FORTH and PASCAL. Compilers have
been or are being developed for the PET
for the languages "C", FORTH and
PASCAL, but to date there has been no
compiler for the full BASIC language.
The following discussion will point out
the usefulness of such a compiler and
tell you when and where one will be
available.
What is the Difference Between
a Compiler and an Interpreter?
The code which a programmer
writes in a higher level language is called the source code and the output from
the compiler, which processes that
code, is called the object code. In the
process of making the conversion a
compiler may have to make several
"passes", I.e., complete scans through
the source code, so compilers are often
distinguished as being single or multiple
pass compilers. It usually takes a multiple pass compiler longer to compile than
a single pass compiler but the multiple
pass compiler might be preferable if, for
example, the object code it generates is
more efficient.
In any case, once the compiler has
completed its task the object code can
be saved and used over and over again
without recompiling. Interpreters, such
as the BASIC Interpreter found in the
PET and other popular micro-computers,
do not work in this manner. They take
the user's source program, written in the
higher level language (the BASIC
statements), and analyze (interpret) each
statement one at a time to determine its
equivalent machine code, and then execute this code. Moreover, and this is
the chief drawback to interpreters, they
do not save the object code. The next
time that BASIC statement is executed
the machine again has to interpret that
line of code. For example, if there is a
FOR. ... NEXT loop in the program that
contains six statements between the
FOR and the NEXT and the loop is to be
executed 100 times, then each of those
six lines of code will be interpreted
(translated) into machine language 100
times. This results in a total of 600
translations made by the interpreter,
whereas the compiler would have made
only six. In both cases, the machine
code is performed 600 times; but in the
interpretation, the analysis represents a
20:10
significant overhead which is absent in
the compiled version.
Purists may object that this is a
somewhat simplified explanation
because, in fact, the interpreter stores
token (numbers) for the BASIC
keywords, and often jumps to predefined specific runtime routines rather than
assembling new code. However, in principal the interpreter works in this manner and for this reason interpreted programs are 10 to 100 times slower in execution than compiled programs.
Another factor which often slows down
an interpreter is that it must repeatedly
do much error checking that a compiler
does only one time.
The advantage of an interpreter,
however, is that one need not wait for
the compile to take place before execution. So long as high speed in program
execution itself is not needed, an interpreted program may perform Quite fast
enough; and although there may be
other reasons (some of which will be
described later) that may make compilation desirable, it is apparent that an interpreter will reduce the time required
for program development.
There are advantages to an interpreter besides convenience in programming. Source code requires much less
memory than object code. A single concise BASIC statement such as:
If X
= (Y • L) I M THEN R = X + (M - L),
expands through compilation into many
machine language statements. ConseQuently a much longer program can be
written in BASIC and stored in a small
computer that interprets each line and
"throws away" the object code immediately after it is used, than in a
machine that has to store all the object
code before execution begins.
Incidentally, there are many high
level languages that are not general purpose programming languages. RPG's
(Report Program Generators), for example, are high level languages used to format reports. There are also many DBM
(Data Base Management) languages
(such as ADABAS, MARK IV, etc.) that
are used to access large files of data. On
the surface these programs appear very
similar to the languages processed by
compilers as regards the syntactical
rules they require for input. That is to
say the user writes a "program" for his
application that is in many ways like a
computer program that he would write
for a compiler. However, while these
systems do what they are designed to do
very well (Le., access some particular
data base), they are not general purpose
languages and cannot be used efficiently for many purposes that a compiled
language can.
MICRO -- The 6502 Journal
To summarize then, a compiler
translates the source code into object
code one time which is then used over
and over again; whereas an interpreter,
such as PET's BASIC, "throws away"
the object code after each execution and
then must re-translate again from the
source before an instruction can be used again. The advantage of using an interpreter is that it takes much less
memory to store a whole program in
source format rather than in object format, and execution takes place immediately rather than waiting for a complete new re-compile after each program
change. However, among its other advantages, a compiled program can be
executed at more than ten times the
speed of an interpreter and this is often
critical in certain applications.
What is the Difference Between a Direct
Compiler and a P·Code Compiler?
A compiler then, takes the source
language code of a particular high level
language and translates it into object
code--that is to say, into the machine
language op-codes. Because a computer
always automatically executes the next
instruction following the one it is
presently executing (unless there is a
branch), it is much faster not to have any
branches. However, code written
without branches would usually require
more memory than is available internally
to the computer. Also, it would not take
advantage of the "conditional" branching or decision making power of the
computer which is the essence of a program.
Consequently, one of the major
design decisions in designing a compiler is the trade-off between using
memory-consuming repeating code "inline" to save branches and increase
speed, or making time-consuming
repeated branching to the same subroutines in order to conserve memory. A
JSR (Jump-to-Sub-Routine) requires the
computer to save from the PC (Program
Counter) the next address it would have
executed in sequence, and load instead
in the program counter the address of
the sub-routine instruction. On RTS
(Return from Sub-routine) the instruction
address that was originally saved must
then be restored to the PC. If there were
only a few instructions in the subroutine, there will be no saving of
memory and time will be wasted in going
to the sub-routine. The computer instead
simply could have processed the next
couple of instructions. However, if the
sub-routine contains many instructions,
memory will be saved by going there at
the expense of a little time for making
the branches. It all depends on the
relative value of speed and memory in a
particular system.
A compiler designer soon finds that
January, 1980
certain large blocks of code are used
repeatedly. Therefore, every time a
source program requests a certain type
of activity the compiler causes the object code to jump to the specified block
of code that can handle that activity.
Sometimes two activities are similar,
although not identical; but if the code for
each is very long and the differences are
minor, it is frequently more efficient to
generalize the code and then to
distinguish between the differences of
the activities within the block of code.
Now again, there are some trade·offs
most likely requiring some additional
branches for each of the activities that
would not be necessary if they had their
own unique code. We are in fact "inter·
preting" at execution time some of the
code within the compiler·generated
code. This then is not true object code
for what was the source statement but is
in a very limited -sense Pseudo Code
(P-Code).
While this type of approach is present to some extent in almost all compilers, some compilers make heavy use
of this approach. The generalized code
that will interpret the specific
statements generated as object code by
the compiler amounts to an "overhead"
in both usage of memory and in execution time.
Some FORTH and PLM compilers
currently available for the PET are so
heavily dependent on these techniques
that the resulting object code executes
as little as 3 times as fast as the BASIC
Interpreter. These same compilers require several K overhead in memory for
the specialized routines that consequently become a part of all programs,
whether they are actually used or not.
This can be very detrimental in some important situations.
It is possible to write a compiler
that is resident in memory and interprets
all of the code at execution time. In such
a case we have come full circle and have
what we started with--an interpreter.
This is indeed why many of the so·called
compilers perform little better than an
interpreter.
How, then, can one tell whether or
not they have a "true" direct compiler or
a largely P·code simulator? The answer
is by benchmarking. Because there are
different design philosophies behind different compilers, one must take a compiler and compare it to the other alternatives (Le., other compilers or the interpreter). One does this by writing a test
program with statements similar to the
type they use in actual applications.
Perhaps for one user there are lots of
loops and string handling. Another user
may particularly use math functions and
arrays. The particular test program is
then run using both products and the
results are compared. Only in this way
January, 1980
will you know which of the two products
will perform better in terms of compiletime andlor execution-time. Other important
considerations
may
be
maintenance, direct access to the object
code to allow modification, types of
statements available, ease of operation,
documentation, support, expected improvement or obsolescence, etc.
To summarize this section then, a
"direct-compiler" uses relatively less
pseudo-code and executes faster than
straight P-code compulers. Performance
can only be determined by benchmarking for specific applications.
Why Would a Basic Compiler be So
Useful on a PET?
Aside from the considerable speed
improvement that can be obtained from
a well compiled program, are there any
other advantages to using a BASIC compiler? Most definitely, yes. However,
before elaborating let us pursue the
question of speed itself. For many applications the PET's BASIC interpreter's
speed is entirely adequate. It is in real
time applications (such as process control, where the PET is monitoring some
other device attached to it through an in·
terface such as the IEEE-488 Port,
located on the back of the machine) that
greater speed is needed. Since only the
PET among popular personal microcomputers has the necessary IEEE Port
for attaching many laboratory and
technical devices, faster programs are
also more significant to PET users.
There are a number of S-100 bus applications that could benefit from in·
creased program speed and these can
be implemented on the PET through
available S-100 interface boards. Often
only a few specific routines need the
higher speed afforded by assembly
language programming and this could
be accomplished by writing those few
routines in assembly language and doing a SYS call from the BASIC program
to them. This latter approach, however,
still requires that the programmer
understand assembler language;
whereas, by using a BASIC compiler, he
needs only know BASIC.
Where a BASIC compiler can really
shine is in the development of
marketable systems. There are now
available for less than $300, systems
that interface directly with the PET that
can be used for burning PROMS (programmable read only memories) and
E-PROMS (ultra violet erasable proms).
These chips will fit into socket holders
inside the new 16K PETS, or the socket
holders in the expansion boards on the
old 8K PETS, and can hold a machine
language program in readiness for a
user, even when the computer is turned
off--they are called non-volatile.
MICRQ -- The 6502 Journal
This makes it convenient for users
still to be able to use their computer in
just the same way as any other PET user.
But at the same time, they are able to
step up to a PET that contains a PROM
programmed for a specific task and im·
mediately access the special program
without having to wait for it to load from
a tape or disk. In addition to making the
computer easier for the user to use, this
is also a very convenient way for the
developer to distribute his program and
makes copying of it much more difficult
than if it were on tape. The producer's incremental cost of duplicating programs
for distribution using PROMS should be
well under $20 each.
More importantly, we can go one
step further and take a program that has
been written on the PET in BASIC, com·
piled, and stored in PROM and use that
PROM along with a 6502 microprocessor to build up an entirely
separate device that no longer involves
the PET at all. In this way the PET has
become a very powerful development
tool for the garage or basement inventor
that is comparable to similar development systems that have been used in industry for the last several years but that
have cost many thousands of dollars. A
true BASIC direct compiler will therefore
allow serious PET users to develop from
PROMS, faster and more memory efficient object code while using the power
of the present PET BASIC interpreter for
rapid
program
development.
What is the Status of the CANPET
BASIC Compiler?
In June 1979 work was begun on a
PET BASIC direct one-pass compiler.
The language supported by this compiler is intended to be identical with that
supported by the PET BASIC interpreter
with the exception of dynamic array
decl~ration/allocation.
The Co-ordinators of the project,
Mr. Bruce Beach and Mr. Brian Beswick,
have retained the service of a Torontobased consulting firm with nearly 15
years of software experience and expertise in compiler design. Assistance is
also being given by interested and
knowledgeable individuals in the Canadian PET community, such as Mr. Jim
Butterfield.
The first pre-releases of the compiier should be available for use by the
time this article appears in print. Initial
users will be sought in a wide diversity
of applications so that the compiler's
performance can be critically evaluated.
Any persons who feel they would like to
participate in the early evaluation process are invited to contact the Author.
20:11
Article Summary
DO 300 I=1,N
IF CCRCI).EQ.O) GOTO 300
IF (STRTSWCI).EQ.O) GOTO 407
CR(I)=O
C CHECK IF INFORMATION COMING
IF (STEP(I).GT.6) GOTO 301
BFPTRCI)=BFPTRCI)-1
C YES INFOIRMATION
T=STEP(I)
DO 300 J=1.BFPTRCI)
INFOCI,T,J)=BUFFERCI,J)
300
CONTINUE
STOP
END
A BASIC direct compiler that makes
minimal use of P·code is being
developed for the PET and APPLE or any
6502 based computer by a private Canadian group. It is anticipated that the
resulting object code will require more
storage than the source BASIC provided
to the interpreter but less than that
generated by other presently available
compilers.
The chief advantage of the new
compiler is that its resulting code
should execute many times faster than
the speed obtained by using the PET or
APPLE's BASIC interpreter.
The new compiler in combination
with the present powerful PET and APPLE BASIC interpreters should greatly
facilitate the development of new
systems that take advantage of the
PET's and APPLE's 6502 microprocessor
and the PET's IEEE-488 Port compatabilities.
Figure 1:
Serious users who would be willing
to help benchmark and critically
evaluate the performance of this new
Example of Fortran Routine
BASIC compiler are invited to contact
the author, Mr. Bruce M. Beach,
Horning's Mills, Ontario LON 1JO,
Canada, (519)925-6035, or Mr. J. Brian
Beswick, 1755 Rathburn Road, Unit 45,
Mississauga, Ontario L4W 2M8
(416)624-5225.
IF FEHALE GO TO 'WHAN
ELSE GO TO HAN.
Hot'IAN.
IF lJEIGHT
MIN-FEf-1ALE-H'T (J)
SUBTR.'l.CT HEIGHT FRON NIN-FENALE-I.JT (J) GIVING LBS-U (NU)
GO TO SKINNY.
IF HEIGHT> HAX-FENALE-\-lT (J) SUBTRACT HAX-FE~!ALE-\vT (J)
FIWN HEIGHT GIVING LBS-OV (NOV)
GO TO FAT.
GO TO NORl1AL.
VJAN. IF \-lEIGHT
~aN-MALE-\'JT (J)
<
<
Figure 2:
Example of Cobol Routine
Being a spectator is great
...but why not participate?
------1
\, : ~~:~:g
Ii'
LET MICRO MUSIC TURN
yb
\;'"
-;J
.
\
R APPLE ][
VISIT THE APPLE DEALER NEAREST YOU AND ASK FOR A
DEMONSTRATION OF MMI'S MICRO COMPOSER ™
The MICRO COMPOSER LETS YOU• Play up to 4 simultaneous voices
• See all 4 voices at the same time you're hearing the music-a
must for music editing!
• Enter music notes by a fast, simple and well-tested coding
system.
• Program the pitch, rhythm, and timbre of the music. Tempo is
varied by the Apple paddle.
• Choose 7 different tone colors for each voice or create your
own tone color.
• Compose, edit, display, and play music through an interactive,
command-driven language that's easy to learn.
• Save your music on disk or cassette.
TM
• Hear quality music sound at low cost through the MICRO MUSIC
DAC card. No amplifier needed! Designed for MMI by Hal
Chamberlin and Micro Technology Unlimited.
• Select from future MMI music instruction software to accompany
the MICRO MUSIC DAC.
®
• Learn from Specialists
\
INTO A FAhm,\ MUSIC CENTER!
The MICRO COMPOSER is an APPLE II® compatibile, low-cost
music system designed by the folks at MMI. Our music software was
designed by leading experts in music education. A simple step-bystep instruction manual leads you through entering, displaying,
editing, and playing music with up to four voices-soprano, alto,
tenor, and bass. You can change the sound of each voice to reed,
brass, string, or organ sounds and you can even color your own music
sounds!
HAVE FUN! THE MICRO COMPOSER come, complete with an instruction manual,
software di,k or cassette-in either Integer or Applesoft ROM BASIC, and the MICRO
MUSIC DAC mu,ic card. Ju,t plug the MICRO MUSIC DAC into the APPLE exten,ion ,lot
and connect the audio cable to a speaker.
Ask your local dealer for information on MMI products, or contact:
Micro Music Inc
\
Suggested retail price $220.
309 Beaufort, University Plaza, Normal, IL 61761
APPLE II IS a trademark of Apple Compuler Inc
Human Physiological
Parameters
One of the most common complaints about the home
computer is that it does not really do much for the
average consumer. After you balance your checkbook,
then what? Here is a program, based on scientific data
and studies, which calculates the proper weight for an
individual as a function of height, body build, and sex.
Written in Applesoft BASIC, it should be easily adapted
to any other reasonable BASIC.
Introduction
The focus of public interest in nutrition has changed markedly during the
past decade. In the past, the emphasis
was on eating more of everything. Increasingly, the message is to eat less.
The reason for the turnabout is that
many foods are believed to be factors in
causing or promoting such degenerative
diseases as heart disease, diabetes, etc.
Diet is also involved in an especially
prevalent disease, obesity (excessive
weight).
Excessive weight is associated with
cardiovascular and renal diseases,
diabetes, degenerative arthritis, gout,
etc. On the basis of life insurance
statistics, the most nearly ideal weight
to maintain throughout life is that which
is proper at age 25 for one's height and
body build. Thus, height-weight tables
January, 1980
no longer indicate figures beyond ages
of 25-30 years. A deviation of not more
than 10 percent above or below the
desirable weight for a given individual is
not considered significant. The term
overweight is applied to persons who are
10-20 percent above desirable weight;
obesity is applied to persons about 20
percent or more overweight. Underweight generally applies to those individuals who are more than 10 percent
below the established standards. Those
who are more than 20 percent below
such standards are considered to be
seriously underweight.
Height-weight tables provide only
approximations on the degree of
fatness. More accurate measures of
body fatness include measurements of
thickness of subcutaneous tissue at
designated body locations using
calipers or by determination of body
density by means of underwater
MICRO -- The 6502 Journal
Dr. L.S. Reich
3 Wessman Drive
West Orange, NJ 07052
weighing. If has been estimated that
about one-half of all men over 30 are at
least 10 percent overweight and that
one-quarter are obese. The incidence is
higher for women, about 40 percent being obese by the age of 40.
Generally, the percent water in lean
individuals is higher than in obese persons. The opposite is true in regard to
body fat. The human body generally consists of 55-60 percent of body weight as
water, about 17 percent as lipids (which
includes fats), about 15 percent as protein, and about 1 percent as carbohydrates, about 5 percent of other
materials. The total body water relative
to body weight is usually lower in
females than in males. Also, the
predicted total body water has been
found to be closely related to pJedicted
surface area. Generally, the higher the
weight·% of body water, the lower the
weight·% of body fat.
20:15
PROGRAM LISTING
The Program
The program that follows indicates
what a person should weigh based on
height, body build and sex. The ideal
weights given are generally for men and
women of ages 25 and over. Besides
ideal weights, this program estimates
whether a person is obese, the percent
that a person's weight is above the maximum ideal weight, the weight-% of body
fat and of body water, and the body surface area. These physiological parameters are applicable to those over the
age of 16.
2
HOME
3
PRINT "THIS PROGRAM TELLS YOU WHAT YOU SHOULD WEIGH BASED ON
DATA ADAPTED FROM THE BOOK (WEIGHTS IN THIS BOOK WERE SUBTRACTED
BY 3 TO GIVE WEIGHTS IN BED CLOTHING, WHICH WERE USED IN THIS
PROGRAM), 'NORMAL & THERAPEUTIC NUTRITION'
4
(13TH EDITION), ";
PRINT "BY C.H. ROBINSON, 1972, P.848 (MACMILLAN).
HEIGHT
LIMITATIONS ARE, FOR WOMEN: 5~ TO 5-10; FOR MEN: 5-4 TO 6-3
(NO SHOES).
IDEAL WEIGHTS GIVEX jRE FOR BED CLOTHING AND ARE
FOR ";
Obesity is estimated by a critical
obesity index based upon Ouetelet's index (01). This critical index is reached
when the individual's weight is about 18
percent above the maximum ideal
weight. Also, 01 is used to estimate body
fat (BF). The BF via 01 is in good agreement with the value from weight-%
water (BW) using the expression:
100-137'BW (however, another expression for BF is used in this program).
In the program listing that follows,
REM statements are to be found in line
numbers 20, 96, 100, 132, 138, 143, 148,
162,200, and 490. Line numbers 500-600
contain height-weight data for females
only while numbers 750-860 contain
height-weight data for males only. In line
number 50, W$(J,K) denotes an array for
heights and weights corresponding to
small, medium, and large body frames.
Line numbers 97-99 and 137 express the
program limitations for females (must
not have height below 5'0" or above
5'10", and if body frame is small,
physiological parameters will not be
given); while, lines 197-199 and 237 express the program limitations for males
(must not have heights below 5'4" or
above6'3", and if body frame is small,
physiological parameters will not be
given). Line numbers 133 and 233 determine the percent that an individual's
weight exceeds the maximum ideal
weight and, numbers 145, 150-160, 245
and 250-260 calculate 01 which is used
to determine body fat and whether or not
a person is obese.
Line numbers 165, 170, 175, 265,
270, 275 allow the estimation of body fat,
body surface area, and body water both
in men and women. Applesoft II BASIC
in ROM was employed and the program
required about 8.5K free bytes. (It may be
noted here that a BASIC master command list has been published (Recreational Computing, Sept-Oct, 1979))
which is applicable to SOL-20, PET 2001,
APPLE II, and LEVEL II TRS-80 computers.)
20:16
5
PRINT "MEN AND WOMEN OF AGES 25 AND OVER (FOR GIRLS 18-25,
SUBTRACT 1 POUND FOR EACH YEAR UNDER 25)."
6
PRINT "BESIDES IDEAL WEIGHTS, THIS PROGRAM ESTIMATES OBESITY,
BODY FAT, BODY SURFACE AREA, AND TOTAL BODY WATER,
APPLICABLE TO THOSE OVER THE AGE OF 16.
THESE ARE
GENERALLY, THE
% TOTAL
BODY WATER IS LOWER IN FEMALES THAN IN HALES. ";
7
PRINT: PRINT: PRINT "PRESS 'CONT' TO CONTINUE!"; : PRINT: STOP:
PRINT
8
PRINT "FURTHER, THE
OBESE PERSONS.
% OF
WATER IN LEAN PERSONS IS HIGHER THAN IN
ABOUT 55-60% OF THE BODY WEIGHT IS WATER.
A
DEVIATION OF NOT MORE THAN 10% AllOVE OR BELOW THE DESIRABLE
WEIGHT FOR AN INDIVIDUAL IS NOT ";
9
PRINT "CONSIDERED SIGNIFICANT.
THE TERM 'OVERWEIGHT' IS GENERAUi'J
APPLIED TO PERSONS WHO ARE 10-20% ABOVE THE DESIRABLE WEIGHT.
'OBESl'!'Y' IS APPLIED TO PERSONS WHO ARE ABOUT 20% OR MORE OVER,:
'NEIGHT. ";
1
°
PRINT "IN THIS PROGRAM, OBESITY IS DETERMINED BY A CRITI CAL
OBESITY INDEX BASED UPON 'QUETELET'S INDEX' (QI).
THIS
CRITICAL INDEX IS REACHED WHEN THE PERSON'S WEIGHT IS ABOUT
18% ABOVE THE MAXIMUM IDEAL WEIGHT.
11
PRINT "ESTIMATE BODY FAT (BF).
ALSO, QI IS USED TO ";
THE BF VIA QI IS IN GOOD
AGREEMENT WITH THE VALUE FROM TOTAL BODY WATER USING: %BF-100(137* I'!'. WATER/BODY WT.).": PRINT: PRINT "PRESS 'CONT' TO
CONTINUE!": STOP: PRINT
12
PRINT "MORE REFERENCES: HUME & WEYERS, J. CLIN • PATH., VOL. 24,
PP. 234-238 (1971); JAMES, (A DHSS/MRC REPORT) HER MAJESTY'S
STATIONERY OFFICE, LONDON, 1976 (ISBN 0 11 450034 7).
REMARKS
ARE TO BE FOUND IN LINE #'S 20, 96,100,132,138,143,148,162,
200, 490."
MICRO -- The 6502 Journal
January, 1980
13
PRINT: PRINT "PRESS 'CONT' TO CONTINUE!"; :PRINT: STOP
14
PRINT: PRINT
20
DIM WS(30,5): REM THIS IS AN ARRAY FOR HEIGHT & WEIGHTS
130
CORRESPONDING TO SMALL, MEDIUM, & LARGE BODY FRAMES
132
120
IF WS(W,L) -HS THEN PRINT: PRINT "YOUR IDEAL WEIGHT _";
WS(W,F+l);: GOTO 133
NEXT
REM LINE #'S 133& 233 DETERMINE THE % THAT YOUR WEIGHT
30
FOR J-l TO 30
40
FOR K-l TO 4
50
READ WS(J,K)
INT«(PW-SS)*100/SS)*10+.5)/10" % ABOVE YOUR MAXIMUM IDEAL
60
IF WS(J ,1) -"ZERO" THEN J-J -1: GOTO 80
WEIGHT.,,;
70
NEXT K,J
80
PRINT "LIST YOUR SEX (FEMALE-l; MALE-2) ACCORDING TO NUMBERS;
81
EXCEEDS YOUR MAXIMUM IDEAL WEIGHT
133
134
SS
-VAL(MIDS(WS(W~F+l),
5»: IF SS(PW THEN PRINT "---YOU ARE "
GG -INT«(PW-SS)*100/SS)*10+.5)/10: IF GG> 10 AND GG< 18
THEN PRINT "(YOU ARE CONSIDERED OVERWEIGHT)!"
YOUR HEIGHT (NO SHOES) TO NEAREST INCH ";
136
PRINT
PRINT "(E.G., 5-10); YOUR BODY FRAME(SMALL-l; MEDIUM-2; LARGE-3);
137
IF F<:
-I
THEN PRINT: PRINT "BECAUSE YOUR FRAME IS ONLY 'SMALL' ,
ADDITIONAL INFORMATION ON BODY WATER, ETC. DOES NOT APPLY TO
& FINALLY YOUR WEIGHT (IN POUNDS, WITH BED CLOTHING):";
YOU!": GOTO 180
83
INPUT S, HS, F, WT
85
PW-WT
90
ON S GOTO 95,195
95
PRINT: PRINT ,,--------------------------------------":
TV-VAL(MIDS(HS ,I ,1» *12+VAL(MIDS( HS ,3»
96
97
138
'WT'
140
IN KILOGRAMS OF FEMALES & MALES, RESPECTIVELY
H -VAL(MIDS(HS,l,l»*12 + VAL(MIDS(HS,3»: H -H*.0254:
143
REM IN LINE #'S 145 & 245, 'QI' DENOTES 'QUETELET'S INDEX'
REM LINE #'S 97-99 & 137 EXPRESS THE PROGRAM LIMITATIONS FOR
WHICH IS USED FOR FEMALES & MALES RESPECTIVELY, TO DETERMINE
FEMALES WHILE LINE #'S 197-199 & 237 EXPRESS THE PROGRAM
BODY FAT AND WHETHER A PERSON IS OBESE
LIMITATIONS FOR MALES
145
QI - WT/(H*H)
IF F < -I AND TV < 60 THEN PRINT: PRINT "BECAUSE YOUR FRAME IS
148
REM LINE #'S 150-160 & 250-260 DETERMINE WHETHER OBESITY
CAN OFFER YOU NO INFORMATION!": GOTO 180
IF F
< -I
EXISTS FOR FEMALES & MALES, RESPECTIVELY
1~
AND TV> 70 THEN PRINT: PRINT "BECAUSE YOUR FRAME IS
ONLY 'SMALL' AND YOUR HEIGHT IS MORE THAN 5-10, THIS PROGRAM
IF TV <60 OR TV> 70 THEN PRINT: PRINT "BECAUSE OF HEIGHT
155
IF F-3 AND QI
>29.5
THEN PRINT: PRINT "YOU ARE ALSO OVER THE
CRITICAL OBESITY INDEX---START DIETING!": GOTO 165
160
PRINT: PRINT "YOU ARE UNDER THE CRITICAL OBESITY INDEX--CONGRATULATIONS!"
LIMITATIONS, TlIIS PROGRAM CANNOT GIVE YOU YOUR IDEAL WEIGHT!":
GOTO 140
IF F-i AND QI» 27.0 THEN PRINT: PRINT "YOU ARE ALSO OVER THE
CRITICAL OBESITY INDEX-_...TART DIETING!": GOTO 165
CAN OFFER YOU NO INFORMATI ON ! ": GOTO 180
99
V~IGHT
WT - WT* .45359
ONLY 'SMALL' AND YOUR HEIGHT IS LESS THAN 5-0, THIS PROGRAM
98
REM IN LINE #'S 140 & 240, 'H' DENOTES HEIGHT IN METERS &
162
REM LINE #'S 165 & 265 ALLOW;DETERMINATION OF BODY FAT IN
100
FOR W -I TO 11: REM THIS IS FOR FEMALES ONLY
WOMEN & MEN, RESPECTIVELY; #'S 170 & 270 ALLOW DETERMINATION
110
L-l
OF BODY SURFACE AREAS FOR WOMEN & MEN, RESPECTIVELY; #'S 175
& 2'75 ALLOW DETERMINATION OF BODY WATER IN WOMEN AND MEN.
234
WF. 1.48·QI-7: PRINT: PRINT "YOUR BODY FAT. " INT(WF·l0+.5)/10
" %"
170
23'
PRINT
237
IF F
(OR" INT «BS·l0.764)·10 + .5)/10" SQ. FT.)"
" LITERS (CA. " INT «WW·l000/453.6)·10 + .5)/10" LBS. WATER
180
--..oR" INT«WW*IE02/WT)·10 + .5)/10"% BODY WT.)"
PRINT"": PRINT: GO'1'O 80
195
PRII,T: PRINT" --------------------------------------":
1 THEN PRINT: PRINT"BECAUSE YOUR FRAME IS ONLY 'SMALL'.
TO YOU I": GOTO 280
240
H. VAL(MIDII(HS.l.l))*12 + VAL(MIDS(HII.3)): H. H*.0254
WT • WT* .45359
WW • • 183809·WT + 34.4547*H-35.270121
177 . PRINT: PRINT "YOUR TOTAL BODY WATER IS CA. " INT(WW*10 + .5)/10
<.
ADDITIONAL INFORMATION ON BODY WATER. ETC. DOES NOT APPLY
BS. (.007185*WT".425*(H·l00)".725): PRINT: PRINT "YOUR
BODY SURFACE AREA IS CA. " INT(BS·l00 + .5)/100" SQ. METERS
175
< 18
THEN PRINT" (YOU ARE CONSIDERED OVERWEIGHT)!"
RESPECTIVELY
165
GG. INT«(PW-5S)·100/SS)·10 + .5)/10: IF GG >10 AND GG
245 QI • wTj(H*H)
250
IF F • 2 AND QI>27.5 THEN PRINT: PRINT"YOU ARE ALSO OVER
THE CRITICAL OBESITY INDEX---5TART DIETING!": GOTO 265
255
IF F • 3 AND QI >29.9 THEN PRINT: PRINT"YOU ARE ALSO OVER
THE CRITICAL OBESITY INDEX---5TART DIETING!": GOTO 265
TV • VAL(MIDI(HS.l ,1))*12 + VAL(MIDS(HI.3))
197
IF F
<.
1 AND TV
<64
260
CONGRATULATIONS !"
THEN PRINT: PRINT "BECAUSE YOUR FRAME IS
ONLY 'SMALL' & YOUR HEIGHT IS LESS THAN 5-4. THIS PROGRAM
265
IF F
<.
1 AND TV> 95 THEN PRINT: PRINT "BECAUSE YOUR FRAME IS
270
LIMITATIONS. THIS PROGRAM CANNOT GIVE YOU YOUR IDEAL WEIGHT!":
BS. (.007185*WTI\.425*(H·l00)"" .725): PRINT: PRINT"YOUR
METERS (OR" INT«BS*10.764)·10 + .5)/10
CAN OFFER YOU NO INFORMATION!": GOTO 280
IF TV< 64 OR TV >75 THEN PRINT: PRINT"BECAUSE OF HEIGHT
%"
BODY SURFACE AREA IS ABOUT "INT(BS*100 + .5)/100 " SQ.
ONLY 'SMALL' & YOUR HEIGHT IS MORE THAN 6 -3, THIS PROGRAM
199
MF. 1.281*QI-l0.13 : PRINT: PRINT"YOUR BODY FAT' • "
INT(MF*10 + .5)/10 "
CAN OFFER YOU NO INFORMATION I": GOTO 280
198
PRINT: PRINT"YOU ARE UNDER THE CRITICAL OBESITY INDEX---
il
SQ. FEET)"
275
MW • • 296785*WT + 19.4786*H-14.012934
277
PRINT: PRINT"YOUR TOTAL BODY WATER IS ABOUT "INT(MW*10 + .5)/10
" LITERS (ABOUT" INT«MW*1000/453.6)*10 + .5)/10 " LBS.
GOTO 240
200
FOR W • 12 TO 23 : HIM
210
L.l
220
IF WS(W,L) • HS THEN PRINT: PRINT"YOUR IDEAL WEIGHT. ";
WATER--..oR" INT«MW*IE02/WT)·10 + .5)/10 "
THIS IS FOR MALES ONLY
WI(W.F+l);1 GOrO 233
% BODY WEIGHT)"
280
PRINT"--------------------------------------": PRINT: GOTO 80
490
REM LINE #'S 500-600 CONTAIN HEIGHT-WEIGHT DATA FOR FEMALES
ONLY WHILE #'S 750-860 CONTAIN HEIGHT-WEIGHT DATA FOR MALES
230
NEXT
ONLY
233
SS. VAL (MIDI (WI (W.F+l ) .5)): IF SS( PW THEN PRINT"---YOU ARE"
500
DATA
"5-0". "99-107". "104-116". "112-128"
INT«(PW-5S)·100/SS)·10 + .5)/10 " % ABOVE YOUR MAXIMUM IDEAL
510
DATA
"5-1". "102-110", "107-119". "115-131"
WEIGHT ":
520
DATA
"5-2", "105-113". "110-123". "118-135"
TO NOS.; YOUR HEIGHT (NO SHOES) TO NEAREST INCH
CDl
530
DATA
",-3", "108-116", "113-127", "122-139"
r::
540
DATA
"5-4", "111-120", "117-132", "126-143"
(E.G., 5-10); YOUR BODY FRAME (SMALL. 1; MEDIUM. 2;
::II
Dl
~
550
DATA
"5-5", "115-124", "121-136", "130-147"
LARGE. 3); & FINALLY YOUR WEIGHT (IN LBS.-WITH BED
li
o
560
DATA
"5~", "119-128", "125-140", "134-151"
CLOTHING): 7"
570
DATA
"5-7", "123-132", "129-144", "138-155"
580
DATA
"5~", "127-137", "133-148", "142-160"
"
590
DATA
"5-9", "131-141", "137-152", "146-165"
YOUR IDEAL WEIGHT. 139-153---YOU ARE 7.8% ABOVE YOUR
600
DATA
"5-10", "135-145", "141-156", "150-170"
MAX. IDEAL WT.
750
DATA
"5-411 , "118-126", "124-136", "132-149"
YOU ARE UNDER THE CRITICAL OBESITY INDEX---
760
DATA
"5-5", "121-130", "127-140", "135-153"
CONGRATULATIONS!
770
DATA
"5~", "125-134", "131-144", "139-158"
YOUR BODY FAT • 22%
780
DATA
"5-7", "129-138", "135-149", "144-163"
YOUR BODY SURFAC.I!l AREA IS CA. 1.88 sQ. METERS
790
DATA
"5~", 11133-142", "13'::1-153 11 , "148-167"
(OR 20.3 SQ. FT.)
800
DATA
"5-9 11 , 11137-147", "143-157", 11152-171"
YOUR TOTAL BODY WATER IS CA. 41.8 LITERS (CA. 92.2
810
DATA
"5-10", "141-151 11 , "147-162", "156-176"
LBS. WATER-_-QR 55.9% BODY IVT.)
I
820
DATA
"5-11 11 , "145-155", "151-167", "161-181"
-t
830
DATA
"6-0", "149-159", "155-172", "165-186 11
LIST YOUR SEX (FEMALE • 1; MALE • 2) ACCORDING TO
840
DATA
"6-1", "153-164", "159-177", "170-191"
NUMBERS; YOUR HEIGHT (NO SHOES) TO NEAREST INCH
850
DATA
"6....2", "157-168", "164-182", "175-196"
(E.G., 5-10); YOUR BODY FRAME (SMALL. 1; MEDIUM. 2;
860
DATA
"6-3", "161-172", "169-187", "179....201"
LARGE. 3); 8< FINALLY YOUR WEIGHT (IN LBS.-WITH
....
31:
C;
::D
o
RESPONSE:
'2,
5~,
2, 165'
~
--------------------------------
I
::l'
•
~
C-
g
3
!.
1000
DATA
BED CLOTHING) I ? "
ZERO
'I,
RESPONSE:
PROGRAM EXAMPLES
COMMAND:
'RUNI~STATEMENTS
IN LINE #'S
3~ AND
"PRESS 'CONT'
COMMAND:
'CONTI~STATEMENTS
IN LINE #'S 8-11 AND "PRESS 'CONT'
CD
COMMAND:
START DIETING!
YOUR BODY SURFACE AREA IS CA. 1.68 BQ.,METERS
\
N
YOUR IDEAL WEIGHT. 110-123---YOU ARE 20.3% ABOVE
YOUR BODY FAT. 33.1%
BREAK IN 11"
R
....
_
YOU ARE ALSO OVER THE CRITICAL OBESITY INDEX---
7"
TO CONTINUE!
COMMAND:
>
YOUR MAXIMUM IDEAL WEIGHT
TO CONTINUE!
BREAK IN
5....2, 2, 148'
II
ICONTI--iloSTATEMENT IN LINE # 12 AND "PRESS 'CONT' TO
(OR 18.1 SQ. FT.)
CONTINUE!
YOUR TOTAL BODY WATER IS CA. 31.3 LITERS (CA. 69.1
BREAK IN 13"
LBS. WATER---QR 46.7% BODY WT.)
ICONTI~"LIST
YOUR SEX (FEMALE. 1; MALE • 2) ACCORDING
_____________________________________
II
(1
~
r-.
-
Skyles Electric Works
'0
PET 2001-8 PET owners:
Do You Want Your PET
To Be a Word Processor, Too?
Well, it can be ... with Skyles Electric Works' new Word Processing PCB
designed especially for the 2001-8. You'll need Commodore's new Disk
Drive, of course. And you'll need an additional 8K of RAM memory. (We
recommend the Skyles Memory Expansion System, of course.)
Skyles then supplies the interfacing PCB on which you can put the
Commodore Word Processor chip. Or, even better, you can buy from Skyles
the PCB complete with Commodore's Word Processor in place.
But wait: you can add the Toolkit at the same time; the Toolkit with the so
important ten commands. Here's the lineup:
The
The
The
The
The
PCB, to accept the Word Processor only
PCB, to accept both Word Processor and Toolkit
PCB, to accept Word Processor; Toolkit tested and installed
PCB with the Word Processor tested and installed
PCB with both the Word Processor and Toolkit tested
and installed.
$ 30.00·
40.00·
90.00·
140.00·
190.00·
From S. E. W. only: custom designed for your PET 2001-8 to interface with
most memory expansion systems. Or, even better, with the 8KB Skyles
Memory Expansion System.
PET LOVERS SPECIAL:
S.E.W. MEMORY EXPANSIO,\l SYSTEMS
8KB Memory Expansion System $225
16KB Memory Expansion System $425
24KB Memory Expansion System $625
SPECIAL PRICE WITH PURCHASE OF ANY WORD
PROCESSOR OPTION ABOVE
This offer Expires February 14, 1980
2001-8 owners, you can now use your PET for word processing. Skyles
Electric Works didn't forget you ...
·California residents: please add 6% or 6.5% sales tax as required
~
VISA, MASTERCHARGE ORDERS CALL (800) 538·3083 (except California residents)
CALIFORNIA ORDERS PLEASE CALL (408) 257·9140
10301 Stonydale Drive
Skyles Electric Works I =~~~fOrnia95014
Lifetime of a Non-Renewable
Resource
One of the great problems facing the world today is the
conservation of resources, particularly those which can
not be readily renewed. The simple program is a good
model of an interactive BASIC simulation.
Are you interested in doing something
simple, serious, and of educational
value with your computer? Estimating
the lifetime of a non-renewable resource
such as coal, oil, or natural gas is often
a difficult calculation involving calculus
and the use of exponential or
logarithmic functions. The computer
makes it short and super simple, as you
will see. The results have serious impli·
cations. An editorial in our local paper
claimed that we have enough coal to last
for centuries. This mayor may not be
true. Read on.
Suppose there are R tons of coal still
unmined. Also suppose that we use C
tons of coal per year. At the end of one
year we will have R - C tons left. The
next year we subtract C tons again, and
so on until our coal is gone. If we kept
track of the number of subtractions, we
would know how many years the coal
would last. This is the lifetime of the
resource.
However, we must take into account
that, typically, the production and con·
sumption of resources increases over
time. Our demand for electrical power,
fuel oil, natural gas, and gasoline grows.
The gross national product, or GNP, increases in a healthy (?) economy.
Growth implies increases in the consumption of resources, and this must be
taken into account when calculating the
lifetime of a resource.
Assume that consumption of a
resource grows by G percent per year. If
C tons of coal are consumed this year,
then next year we will consume C tons of
coal plus the increase, which is G/100
multiplied times C. Anyone who has
calculated interest compounded annual-
January, 1980
Iy knows how to do the arithmetic. A simple example may help. If we use 500
million tons of coal this year, and our
growth rate in the consumption of coal
is 10 per cent per year, then next year we
will consume 500 million tons plus 10 per
cent of 500 million tons.
Marvin L. DeJong
Dept. of Math & Physics
The School of the Ozarks
Point Lookout, MO 25726
The calculation of the lifetime of a
resource is much the same as outlined
above, except that C increases by G percent each year if the growth factor is
taken into account. A flowchart of the
entire process is shown in Figure 1, and
1~
PRINT "THIS IS A PllOOllAH TO CAIm!.ATE HOW LOm A NON-RE1lEWABLE
RE30URCE WILL LAST."
2~
PRINT "nPE IN THE ESTIMATED llE>ERVES OF THE RE5OURCE."
3~
PRINT "RESERVES-";
4~
INPUT R
5¢
PRINT "nPE IN THE ANNUAL RATE AT WHICH THE RESOURCE IS CONSUMED."
6¢
PRINT "CONSUMPTION RATEo";
7¢
INPUT C
6¢
PRINT "nPE IN THE ANNUAL PERCENT INCREASE IN THE CONSUMPTION RATE."
9¢
PRIN'l' "GROWTH RATE OF CONSUMPTION·";
1¢¢
INPUT G
11¢
G-G/l¢¢
12¢
Y=¢
13~
R~R-C
14~
C~C+C"G
15¢
Y~Y+l
16~
IF R >¢ TIIPll 13¢
17¢
PRINT "YOUR RESOURCE WILL LAS'!"'; Y; "YEARS."
16¢
Em
Table 1:
Resource Depletion Program
MICRO -- The 6502 Journal
20:21
the corresponding BASIC program is
given here. There is only one
approximation in the calculation. I
assumed that the consumption changes
abruptly at the end of a year, whereas it
actually changes more or less continuously throughout the year, much like
interest compounded daily. The approximation has little effect on the results.
The error is usually less than a year or
two.
R
=R-
C
Subtract
Consumption
from Reserve
C = C + C*G
Increase
Consumption
Next we need some data to put into
the computer. This can be a bit tricky
because companies that sell the
resource tend to overestimate the
reserves, while conservationists are probably biased in the other direction. The
truth is most likely somewhere in the
middle. My data (and the inspiration for
this project) came from an article by Professor Albert A. Bartlett in the
September 1978 issue of the American
Journal of Physics. The data, which I
have taken the liberty to round off to one
significant digit, appears in Table 1.
Other references you might want to
check are: Dr. M. King Hubbert, A
National Fuels and Energy Policy Study,
Serial 93-40 (92-75) Part I, U.S. GPO,
Washington, D.C., 1973, $2.35; and Dr. M.
King Hubbert, "Energy Resources of the
Earth" in Scientific American,
September 1971.
Almost any computer should take the
simple BASIC program given here. Mine
ran on my Microsoft BASIC for the
KIM-1. Since almost every step is illustrated in the flowchart, no further explanation of the program is necessary.
Load it and type in the data as they are
requested. When the last item is
entered, hit RETURN and wait for the
answer.
Figure 1:
Flowchart to calaulate
the Lifetime of a Non-Renewable
Resource
Now experiment with the input data.
Suppose the estimate of the reserve was
half as large as it really is. How does this
change the lifetime of the resource?
Does doubling the reserve double the
lifetime? Calculate the lifetime with a 0
per cent growth rate; a 10 per cent
growth rate. Get data on natural .gas,
copper, or other non-renewable
resources and run the program. What
are the actual conditions under which
coal will last for centuries?
Resource
Reserves
Current Consumption Rate
U.S. Coal
U.S. Oil
World Oil
500 billion tons
100billion barrels
2000 billion barrels
0.7 billion tons per yr.
6 billion barrels per yr.
20 billion barrels per yr.
Table 2:
Growth
7%
8%
7%
Data on Reserves, Consumption & Growth of 2 Resources
/,
The Lonellne•• of the Microcomputer
While most of us would agree that the microcomputer is a
pretty great device, it is not without potential problems. One of
the possible drawbacks to the microcomputer which I have not
seen discussed is that of its almost exclusive "one-on-one"
utilization. Much has been said about this type of problem with
television. Instead of getting together with friends, family or
neighbors after dinner, how many people now just sit in front
of the "boob tube"? How much human interaction has been
given up in order to watch TV?
Microcomputers seem to be used in a mode very similar to
TV watching. One person interacts with the microcomputer.
Other people are not required and, unless you are showing off
your latest program, are generally not wanted! Hardly a
socialable device. Think about the things you do with your
micro. How malJY of them involve another human? Balancing
your check book, playing chess or life, solving equations '" the
list goes on. Most of the programs which have been listed in
the Micro Software Catalog and many of the programs
presented in articles have been of the single individual variety.
helping you balance your checkbook. Other areas can be
modified to permit multi-individual use and interaction. The entire games area is open to the generation of games which
several people play, not just one. In a multi-person game, the
micro can be used to generate and maintain a very complex
playing situation, can generate sophisticated environments
and display them in a variety of forms, can be the score keeper
and when necessary the arbiter, can inform and assist the
players, can be a time keeper, and so forth. The micro is this
type of game is not the opponent. I hope that we will see more
games of this type in the near future.
Other multi-person micro applications are starting to appear. A number of systems are being set up which permit in·
dividuals to communicate with one another through their
micros. There should be other areas developed which permit
the multi-person utilization of micros. I feel that it is important
for every computerist to occasionally question how he is using
his equipment, and to determine what the secondary effects of
the uses may be.
Assuming you agree that it would be nice to make the micro
more socialable, how can this be done? Some micro uses are
inherently individual. You do not necessarily want a friend
PO Box 8502
Chelmsford, Mass 01824
817·258-5515
"The BEST of MICRO Volume 1" contains all of the Impor·
tant material from the first six issues of MICRO in book
form.
"The BEST of MICRO Volume 2" contains all of the impor·
tant material from the second six issues [117 to 12) of
MICRO in book form.
"BEST of MICRO Volume:.!"
Surface
Air Mail
$27.00
$33.00
$39.00
$
.
$7.00
$10.00
$
..
$9.00
$13.00
$ ... , .
Back Issues:
Issues 7 to 12: .............................•......
No.
Issues 13 on: .................•............•......
No.
All payments must be In US'doliars.
Make checks payable to: MICRO
Foreign payments in International Money Order or cash.
Surface
Air Mall
Surface
Air Mall
$
$
$
TOTAL
If you are a subscriber, attach label or write subscription number here:
Name:
@ $1.75 each
@$2.75 each
@ $2.25 each
@ $3.25 each
..
..
..
,,
..
,
.
Address:
City:
_
State:
.
Zip:
Country (If not U.S.):
.
Help MICRO bring you the Info you want by completing this short questionnaire.
Microcomputers Owned/Plannln" to Buy: AIM SYM 1<11.4 PET APPLE OSI Other:
Peripherals Owned/Planning to Buy: Memory Disk Video Printer Terminal Other:
.
,
.
Microcomputer Usage: Educational Business Personal Control Games Other:
Languages Used: Assembler BASIC FORTH PASCAL O1her:
Your comments and suggestions on MICRO:
.
.
.
EASYWRITER~ the 1st true Word Processor for the Apple!*
Are you looking for the best Word
Processor for your Apple? Well we are
so sure you'll choose EasyWriter that
we've prepared this ad to help you
make your decision EASY. Check out
these powerful features:
•
Incremental spacing to support your
Qume, Diablo, or Spinwriter
•
Character oriented (No line numbers
to deal with)
•
Menu selectable routines for all
known printers and interfaces
•
Word wrap around on screen for
continual text entry
•
Our own new high speed DOS
(Twice as fast as Apple's)
•
Of course full editing, disk, and
printer commands
•
Subscripting, Superscripting, and
MORE MORE MORE ...
....
III
:
Dr. Memory is a TM of Muse
·Blg Edit
Big Edit is a TM of Gravey. Martin & Sampson, Inc.
·Apple Pie
Apple Pie is a TM of Programma International. Inc.
·Super-Text
Super-Text is a TM of Muse
Apple
Apple is a TM of Apple Computers, Inc.
Whatslt
Whatsit 's a TM of Computer Headware
Q
=
Qj
.~
f
~
Qj
Q,
:;,
(I)
Character Oriented Screen
X
Printer Interface Routines
X
Word Wrap Around
X
Editing Commands
X X X X X
High Speed Disk
X
50 Pages of Text per Disk
X
Subscripting & Superscripting
X
X
X
X
Your Choice
Information
~ Unlimited
ORDER
FORM
'-Softwarelnc.
TM
--------------------------------------------------------------Name:
Company:
Address:
ITEM
·Dr. Memory
a.:
Qj
X
CIty:
1 would like more information on:
EasyWriter is a TM of Cap'n Software
S
.....
..... ir. ~
:a
a:.
f.4J
Incremental Spacing
CUT ALONG DOTIED LINE
·EasyWriter
0
~
:.. ~
146 N. Broad Street •
Griffith, IN 46319
(219) 924·3522
It Isn't Software Until it Works!
~
a.,
Qj
The straight facts make EasyWriter the
only logical choice. By the same people
who brought you WHATSIT. Available
at your local computer store or our new
California office!
793 Vincente
Berkeley, CA 94707
(415) 525·4046
.
.
QUANTITY
Easy Writer (EZ 2)
Whatsit Model A-I (Apple)
Whatsit Model CP-2 (CP/M)
Whatsit Model N5-3 (N Star)
Whatsit Manual
EasyWriter Manual
Subtotal
CA Residents add 6% sales tax
Shipping & Handling
GRAND TOTAL
Master Charge or Visa Number:
Zip:
State:
TOTAL
PRICE
$ 99.95
125.00
150.00
100.00
25.00
30.00
$
$
$
$
2.50
Sweet-16 Programming
Using Macros
Some very useful information is presented about
Macros in general, the APPLE II Sweet·16 Interpreter,
and how to use them together.
The history of computer programming is replete with stories of the
development of new tools. Assemblers
were designed with the purpose of relieving the programmer of the tedium of programming in binary machine language.
Over the course of the past twenty years,
various features have been added to
assembly languages to further ease the
pain. Prime among these inventions has
been the macro capability available in
many assemblers. Macros provide
means for extending the expressive
capabilities of assembly language.
Another software tool developed in recent years is the virtual machine. A virtual machine is emulated, imitated or interpreted by a program. It provides
capabilities not directly available in the
hardware of the real machine on which it
is simulated. This article discusses the
combined application of macro
assembly and virtual machine interpretation on the APPLE II personal com·
puter system.
Macro Assemblers
Macro assemblers extend the
capabilities of ordinary assemblers by
providing ways to abbreviate commonly
used sequences of instructions. Often a
programmer will use sequences of instructions that have identical opcodes
and addressing modes, but differ only in
the memory locations referred to. Consider the following:
January, 1980
INC LOC1L
BNE = +5
INC LOC1H
and
INC LOC2L
BNE = +5
INC LOC2H
where the symbol' =' is used to refer to
the location of the instruction being
assembled. These two sequences both
have the same purpose: to cause the 16
bit quantity stored in two consecutive
memory locations to be increased by
one. For this example we have assumed
that the locations are not in page zero
and are directly addressed. A macro
assembler will allow these sequences to
be abbreviated using a new symbol,
chosen by the programmer. The symbol
must be formally declared in a Macro
Definition, before it is used. Such a
definition is shown below using the
notation of the ASMrrED assembler of
Carl Moser:
Richard C. Vile, Jr.
3467 Yellowstone Drive
Ann Arbor, MI 48105
It is called, in assembler terminology, a
formal or dummy parameter. Even
though our example has only one formal
parameter, macros in general may have
many. The three exclamation marks
preceding the name INCD indicate to the
assembler that the label INCD is the
name of a macro. '.MD' stands for Macro
Definition and '.ME' stands for Macro
End. The sequence of instructions between .MD and .ME is called the body of
the macro. Once a macro definition is
written into a program, the macro may
subsequently be called by using its
name in an instruction, as if it were an
opcode. More sophisticated macro
assemblers allow macros to appear in
any field of an instruction, rather than
just the opcode field. When a macro is
called, the programmer is obligated to
supply actual parameters to replace the
dummy parameters used in the definition. In the example given above, when
(NCO is called, it must be accompanied
by the label associated with an actual
memory location used by the program:
INCD
!!! INC 0
.MD
INC
BNE
INC
.ME
(WHERE)
WHERE
= +5
WHERE+ 1
The symbol WHERE does not represent
a specific memory location, but potentially many different memory locations.
MICRO -- The 6502 Journal
(COUNT)
The actual parameter is substituted for
all occurrences of the dummy parameter
in the macro body and the instructions
in the macro body are assembled directly into the program at the point of the
macro call. This is known as "expanding" the call:
20:25
INC COUNT
BNE = + 5
INC COUNT + 1
Another way of thinking about
macros is to view them as small
subroutines wh.ich are inserted directly
into a program instead of being called.
When a short sequence of instructions
is commonly repeated, it may be
cheaper to make a macro out of it than
to make it into a subroutine. Part of the
reason for this is that it costs extra instructions to pass parameters to a,
subroutine, especially on a micro such
as the 6502, which has a limited number
of registers. In this example, particular·
ly, the difference is significant. In order
to convert the INCO macro into a
subroutine, we would need to figure out
a way to pass the address of the first
byte to be incremented. For example:
LOA "Low byte of address of
COUNT"
LOX "High byte of address
of COUNT"
J S R INCO
INC 0
S T A CL Page Zero Loc
S T X CH Next Page Zero Loc
LOY #00
Assuming Y
available- otherwise
TA Y-PHA first.
INC (CL),Y
B N E = +6
INY
INC (CL),Y
RTS
may form interpretive code which can,
via the macro capability, be interspersed
with ordinary machine code. By using
macros to generate the interpretive
code, the programmer is freed from the
odious task of hand assembly - a task
which could discourage him from using
the interpretive code in the first place.
Sweet·16
The 6502 microprocessor provides
no direct capability for handling 16 bit
quantities. In particular, the machine
has no internal 16 bit registers, save for
the PC. Thus, when it becomes necessary to do 16 bit arithmetic, or to
manipulate pointers or 16 bit addresses,
the programmer is forced to write instruction sequences to simulate the required operations. The APPLE II firmware contains a subroutine known as
the SWEET-16 "dream machine," which
does just that. It operates in an interpretive mode, taking the sequence of
bytes following the instruction which
calls it as virtual or interpretive code.
Here's how it works.
When a JSR (Jump to SubRoutine)
instruction is executed by the 6502 processor, the value of the program
counter, which in that case will be the
address of the last byte of the JSR instruction, is saved on the 6502 stack as
two consecutive bytes. When aRTS
Macros can be used to generate arbitrary bit patterns into the stream of object code produced by the assembly of a
program. There may be subtle reasons
for wishing to do this. One of those
reasons forms the meat of our principal
example: the bit patterns so generated
20:26
The Sweet-16 interpreter takes advantage of the fact that the return address is at the top of the 6502 stack. It
pops the two bytes from the stack and
transfers them to a pair of page zero
locations which it then uses as an indirect address to locate the sequence of
interpretive instructions following the
JSR which called it.
Thus the return address of the
Sweet-16 subroutine becomes the address of the first instruction to be executed by the Sweet-16 machine. As the
Sweet-16 machine executes instructions, it updates this address to point to
the next virtual instruction to be executed. When the Sweet-16 interpreter
finds an interpretive instruction
~
fPCL
This is surprisingly more complicated
than the macro, which is why you pro·
bably never thought of making it into a
subroutine before. In general, if a
subroutine is short and if it involves
manipulating addresses of parameters,
then it may be worth converting to a
macro.
Assemblers vary widely in the
richness of features supported. One of
the more desirable features to use in
conjunction with the macro capability is
that of conditional assembly. This
enables a program to define instruction
sequences and, in particular, macros,
with much more flexibility. We shall see
this in action when we discuss the
Sweet-16 macros later. Conditional
assembly directives allow the programmer to control the actions taken by the
assembler.
(ReTurn from Subroutine) instruction is
executed within the called subroutine,
that address increased by one will be
restored from the stack to the PC, to
enable the 6502 to continue executing
instructions following the JSR instruction. (See Figure 1.) The fact that the
"return" address is saved on the stack
means that the called subroutine can, in
fact, find out where it was called from.
More than that, it can use the return address and the indirect addressing mode
of the 6502 to actually retrieve the sequence of bytes following the calling in·
struction. That is precisely what the
Sweet-16 subroutine does.
PC
H
(PC+1)
~-
(PC+2)
~
JSR
ubroutine
body
ADD\
( PC)-~
ADD~
PUSH~-
~
(PC)
~
(PC)f-POP
0
Stack after GALLO
Figure 1:
RTS
Stack before
(RETURNO
6502 Subroutine Call and Return
MICRO -- The 6502 Journal
January, 1980
"return," it restores the address of that
instruction to the stack and executes a
real 6502 RTS. This causes the processor to continue execution of the
machine code following. Thus, Sweet·16
code and real 6502 code may be mixed
together in sequence, with Sweet-16 being called by a JSR instruction
preceding each "chunk" of Sweet-16
code.
The Sweet-16 processor contains 16
registers, each simulated by two page
zero locations. Register 15 doubles as
the Sweet-16 program counter. As explained above, the actions of the various
Sweet-16 instructions cause the contents of the virtual PC to be updated. The
cycle of execution of the Sweet-16
machine is:
1. Fetch Opcode
LDY #00
LDA (R15),Y
2. Execute Opcode
QE
J1nemonic
In
2n
3n
4n
SETR
LD
ST
LD(~
Transfer control to the appropriate section
of
Sweet-16.
Arguments
(Rn ,Constant)
(Rn)
(Rn)
(Rn)
3. Repeat at 1. or Return to caller (if interpretive opcode was "return".
The following table briefly summarizes the opcodes which the Sweet-16
machine provides. The mnemonics used
in the table are those chosen for the
macro implementation discussed below.
Further details and some examples may
be found in the November 1977 issue of
BYTE magazine.
!!!RELBR
The Macros: How They Work
Listing 1. shows the Sweet-16
macros as defined for the Carl Moser
ASMITED macro assembler. The macros
fall into two groups: the register and the
non-register opcodes. The register opcodes are all assembled to values with a
non-zero ($1 to $F) high nibble: e.g.
LD@(R12) -$4C. The non-register opcodes all have a 0 value in the high nibble of the opcode byte. Most of the nonregister opcodes have a second byte
which indicates a relative branch
Rn <- Constant
RO <- Rn
Rn <- RO
High byte of RO <- 0
Low byte of RO <- (Rn)
(Rn) <- Low byte of RO
RO L <- (Rn); Rn <- Rn+l;RO
7n
STD@
(Rn)
(Rn)<- ROL;Rn <- Rn+l; (Rn) <- RO
8n
POP@
(Rn)
Rn <- Rn-l;RO
9n
STP@
(Rn)
An
Bn
Cn
ADD
SUB
POPD@
(Rn)
(Rn)
(Rn)
RO <RO <Rn <RO
H
Dn
CPR
(Rn)
En
Fn
00
01
INCR
DECR
RTN
BR
(Rn)
(Rn)
02
03
04
05
06
07
08
09
OA
OB
OC
BNC
BC
BP
BM
BZ
BNZ
BMI
BNMI
BK
RS
BS
Set branch conditions as a
result of RO - Rn.
Store
result into R13.
Rn<-Rn+l
Rn<-Rn-l
Return to caller
Relative branch to addr.
(Note: Argument is assembled
as displacement. Source
argument is absolute.)
Branch if No Carry
Branch if Carry
Branch if prior result Plus
Branch if prior result Minus
Branch if prior result Zero
Branch if prior result Non Zero
Branch if prior result = -1
Branch if prior result f -1
Execute 6502 Break instruction
Return from Sweet-16 subroutine
Branch to Sweet-16 subroutine.
addr must be in the range
allowable for a relative branch.
Return address is stored in a
pseudo-stack whose address is
contained in R12.
(addr)
Table 1:
January, 1980
.ME
! ! ! BR
!!!RELBR
(Rn)
(Rn)
(addr)
(addr)
(addr)
(addr)
(addr)
(addr)
(addr)
(addr)
IF M =-LOC
. BY =-LOC+ 1
.MD
(WHERE)
.BY 1
RELBR (WHERE)
.ME
The RELBR macro uses the conditional assembly features of the macro
assembler. Let us examine it line by line:
LDD@
(addr)
.MD (LOC)
f F P = -LOC
. BY LOC- =-1
Effect
5n
6n
ST(~
displacement value, in the style of the
6502 itself. The most interesting part of
the set of macro definitions involves the
calculation of this displacement. Since
the concept of relative branch displacement is common to all the branching
operations, a separate macro is defined
which is used to calculate the displacement. This macro then gets called in the
body of each branching opcode to provide the desired value:
<- (Rn);RO
H
<- (Rn)
H
<- 0
L
H
Rn <- Rn-l; (Rn) <- ROL;Rn <- Rn-l;
(Rn) <- RO
H
RO + Rn
RO - Rn
Rn-l;RO <- (Rn);Rn <- Rn-l;
<- (Rn) L
Sweet-16 Instruction set Summary
MICRO -- The 6502 Journal
.MD
(LOC)
This line indicates to the assembler
that a Macro Definition is being initiated. The name by which the macro
may subsequently be called is RELBR
and the argument which must be supplied when it is called is represented by
the dummy symbol LOC. When the
macro is expanded by a call, the actual
argument which is supplied in the call
will be substituted for each occurrence
of 'LOC' in the body of the definition.
IF P = -LOC
This line contains one of theconditional assembly operations or directives
of the assembler: IFP. The assembler is
directed to evaluate the expression contained in the remainder of the line; in
this. case .. = -LOC". If the result is a
positive number (the mnemonic stands
for IF Positive), then the assembler will
assemble all instructions following the
current line until it encounters a line
containing···, which indicates the end
of the scope of the IFP directive. If the
expression evaluates to a negative
number or zero, then the assembler will
ignore all instructions following the current line until the matching •••.
The expression' = -LOC' is computed by subtracting the value of the actual parameter substituted for LOC in
the call from the value of the
assembler's
location
counter,
represented in ASM/TED by the
20:27
character '= '. The location counter
represents the address of the instruction being assembled.
BY LOC- =-1
45
.Arithmetic may be performed
on dummy arguments:
!!!LD
.MD
(REG)
.BY $20 + REG
.ME
MOVE
56
24
05
04
LD@ (5)
ST@ (6)
LD (4)
CPR (5)
BP
(MOVE)
FA
The directive .BY instructs the
assembler to evaluate the expression
following and to assemble a single BYte
of code from the resulting value. The expression LOC- = -1 computes a value
which is the distance from the symbol
referenced by 'LOC' to the current location in the object code. This value is converted by the expression to a negative
number and adjusted by 1 to account for
the fact that the current byte of object
has not yet been emitted by the
assembler. Note that there is a bug in
the definition: if the value LOC- = -1 is
less than -128 then an erroneous value
will be assembled. This means that the
user of the macro set is responsible for
avoiding relative branches that are out
of range. Note also that the values computed by expressions are in 16 bit, twos
complement representation. If such a
value is assembled using a .BY directive,
the assembler will use the least significant 8 bits (low byte) of the result.
This line marks the end of the scope
of the IFP conditional assembly directive used earlier.
IFM =-LOC
This line has the same intention as the
IFP line, except that it tests the result of
the expression' = -LOC' for a negative
or Minus value. It then does or does not
assemble the instructions following the
IFM line and up to the matching * * *,
depending on the outcome of the evaluation.
.BY
= -LOC+ 1
These instructions are analogous to
the corresponding instructions following the IFP directive. The reason for using both an IFP and an IFM directive is
that the label or location referenced by
the dummy argument 'LOC' may turn out
to be either ahead of (minus result for
= -LOC) or behind (positive result for
= -LOC) the instruction which invokes
the RELBR macro.
The remainder of the macro definitions are simple and straightforward. A
couple of points to note are:
.Defining @SW16 as JSR SW16
makes the macro @SW16
looklike a "new" assembler
directive. It says:
Please switch to Sweet-16
20:28
00
This fact is crucial to the success of the
macros.
Sample Sweet·16 Program
The following program allows the
second text page of APPLE II memory to
be copied into the first text page. The
assembled code is shown to the left.
20 89 F6
15
00 08
14
FF OB
16
@SW16
SETR (5 $800)
RTN
Sweet-16 can also be used more
conveniently with this set of macros.
They make the assembly source easier
to read, and remove the burden of hand
assembly from the Sweet-16 programmer.
The reader is urged to learn more
about the macro capabilities of
assemblers and the labor-saving uses to
which they may be applied.
SETR (4 $BFF)
SETR (6 $400)
00 04
Listing 1.
0002
0003
0004
0005
0006
0007
0(>08
0009
0010
0011
0012
0013
00140015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
.DE
.DE
.DE
.DE
.DE
RO
R1
R'i
.:..
f<3
R4
R5
0
1
2
3
4-
.DE 5
.I1E 6
R6
R7
R8
Rtf
R10
R11
R:l.2
R13
R14
R15
!! !SETR
.DE
.DE
.DE
.DE
7
8
9
10
.DE 11
.DE 12
.DE 13
.DE
.DE
.ES
.MII
.BY
14-
15
( REG ADDR)
$10H\EG
.SE AIiDF<
!LD
!ST
!LD@
! ! !ST@
!LDD@
MICRO -- The 6502 Journal
.ME
• MIl
.BY
.ME
.MII
.BY
.ME
.MII
.BY
.ME
.MII
.BY
.ME
.MD
(REG)
$20H<EG
(REG)
$30tl~EG
(REG)
$40tREG
(REG)
$50tF<EG
(REG)
January, 1980
j
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087
0088
0089
0090
! ! lSTD@
! ! lPOP@
! ! ! STP@
! ! ! AIID
! ! !SUB
! ! (POPD@
! ! !CPR
! 1 !INCR
!! !DECR
! ! !RTN
!!!RELBR
.BY
.ME
.MII
.BY
.ME
• MIl
.BY
.ME
.MII
.BY
.ME
.MD
.BY
.ME
$60+REG
(REG)
$70+REG
( REG)
$80+REG
( REG)
$90+REG
(REG)
$AO+REG
.MD (REG)
.BY $BO+REG
.ME
.MII (REG)
.BY $CO+REG
.ME
.MII (REG)
.BY $ItO+REG
.ME
.MD (REG)
.BY $EO + REG
.ME
.MII (REG)
.BY $FO+REG
.ME
.MII
.BY 00
.ME
.MD (LOC)
IFP =-LOC
.BY LOC-=-l
0091
0092
0093
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103
0104
0105
'0106
0107
0108
0109
0110
0111
0112
0113
0114
0115
0116
0117
0118
0119
0120
0121
0122
0123
0124
0999
.ME
.MD ( WHERE)
.BY 5
RELBR (WHERE)
.ME
.MIt ( WHERE)
.BY 6
RELBR ( WHERE)
.ME
.MII ( WHERE)
.BY 7
RELBR ( WHERE)
.ME
.MII ( WHERE)
.BY 8
RELBf\ ( WHERE)
.ME
.MIt ( WHERE)
.BY 9
RELBR ( WHEI:;;E )
.ME
.MII
.BY $A
.ME
.MII
.BY $B
.ME
.MII (WHERE)
.BY $C
RELBR (WHERE)
.ME
.MII
.JSR $F689
.ME
.EN
! ! !BM
! ! ! BZ
!! !BNZ
! ! ! BMl
! ! !BNMl
! ! !BRK
! ! ! 1=(5
!! !BS
!!!@SW16
***
IFM
=-LOC
.BY =-LOC+1
!! !BR
!! !BNC
***
.ME
.MII ( WHERE)
.BY 1
RELBR (WHERE)
.ME
• MIl ( WHERE)
.BY
RELBR'" ( WHERE)
.ME
.MII ( WHERE)
.BY 3
RELBR ( WHEF<E )
.ME
.MIt ( WHERE)
.BY 4
RELBR ( WHEF<E)
~
!! !BG
! ! !BP
January, 1980
LABEL FILE:
[
J = EXTERNAL
JRO=OOOO
JR3=0003
JR6=0006
JR9=OO09
JR12=000C
IR15=OOOF
110000,0200,0200
MICRO -- The 6502 Journal
]
JR1=00Ol
JR4=OOO4
JR7=OO07
JR10=OOOA
JR13=OOOD
If{2=OO()2
IR5=O()()5
IR8=O()()8
IR11=O()OB
IR14=OOOE
20:29
Screen Write/File Routine
Here is a routine, both useful and instructive, which
makes it simple to Edit the Apple Screen and Save the
Screen Image on Disk.
The screen write/file routine is a
simple 73-byte device to take control
away from the monitor and write directly
to the screen. All of the escape editing
capabilities are supported, so that it is
very easy to enter and modify up to and
including 21 lines of text. It is equally
easy to then save the screen image to
disk after completion of text entry.
The source code is straightforward
and makes liberal use of monitor
routines. Upon entry the cursor is homed
and placed on line 1 (not zero). The block
labeled KEY continually polls the keyboard and outputs characters through
COUT (VIDOUT [$FBFD) could also be
used if printer services are not wanted).
The limited editing facilities of the
monitor are invoked by typing (escape)
followed by one of the command characters. Keyboard entry of (control) Q is
used to exit the routine and return to
BASIC via $3DO. Automatic exit is also
obtained at line 22. Upon exit, the bell
will sound and the BASIC prompt character will appear with the file parameters displayed at the end of the line.
At this point the file must be saved using
the command, (BSAVE File name)
A$0400, L$03CF (RETURN). The parenthetical eXPressions must be typed by
the user; that is, type BSAVE file name,
20:30
then trace over the remainder of the line
with the right arrow to place it into the
keyboard buffer and at the end of the
line press RETURN. Although I do not
find it necessary, a monitor MOVE to
page 2 could be set up and inserted at
line 225 of the source listing. This would
provide back-up in case the BSAVE command is messed up. The object code is
assembled at $0350 and is $49 bytes
long.
B.E. Baxter
6761 King's Harbor Drive
Rancho Palos Verdes, CA 90274
D: Move cursor up
1 line
E: Clear from cur·
sor to end of line
F: Clear from cursor to end of screen
Save Screen Image
[BSAVE file namejA$0400,L$03CF[CRl
[l = typed by user
In summary, the usage commands
are:
Entry to Routine
From BASIC
From Monitor
Call 848
$0350G
Exit to BASIC Mode
User
Automatic
(Control) Q
Line 22
Edit Screen (See APPLE Ref. Materials)
(Escape)
@: Home cursor
(Clear text)
A: Advance cursor
B: Backspace cur·
sor
C: Move cursor
down 1 line
MICRO -- The 6502 Journal
Of course it doesn't make much
sense to idly write to the screen without
some useful purpose. I use the routine to
create instruction and documentation
files. These files are especially valuable
for object code utilities by providing
ready access to usage and entry point
information. Once the file has been
created, it can be handled just like any
other file. BLOADing (file name) will immediately display its contents on the
screen without requiring any otherwise
useful memory. Instruction/print
statements in BASIC programs can
therefore be eliminated; to be replaced
by deferred execution BLOAD disk commands for a very efficient use of main
memory~
January, 1980
0100: 0350
0110: 0350
0120: 0350
0130: 0350
0140: 0350
0150: 0350
0160: 0350
0170 : 0350
0180: 0350
0190:
0200: 0350 20 58
0210: 0353 20 8E
0220:
0230: 0356 20 35
0240: 0359 C9 91
0250: 035B FO OC
0260: 035D A6 25
0270: 035F EO 16
0280: 0361 fO 06
0290: 0363 20 ED
0300: 0366 4C 56
0310:
0320: 0369 A9 16
0330: 036B 85 25
0340: 0360 20 58
0350: 0370 20 3A
0360: 0373 A9 E4
0370: 0375 85 09
0380: 0377 A9 07
0390: 0379 85 OA
0400: 037B AO 00
0410:
0420: 0370 B9 8A
0430: 0380 91 09
0440: 0382 C8
0450: 0383 CO OF
0460: 0385 DO F6
0470: 0387 20 DO
0480:
0490: 038A AO
0500: 038B Cl
0510: 038C A4
0520: 038D B0
0530: 038E 84
0540: 038F BO
0550: 0390 80
0560: 0391 AC
0570: 0392 CC
0580: 0393 A4
0590: 0394 BO
0600: 0395 B3
0610: 0396 C3
0620: 0397 C6
0630: 0398 AO
ID=
*
$0350
$FDED
$FC58
$0025
$FB5B
$F035
$F08E
$FF3A
$0009
JSR
JSR
HOME
CROUT
KEY
JSR
CMPIM
BEQ
LOXZ
CPXIM
BEQ
JSR
JMP
ROCHAF
$91
QUIT
CV
$16
QUIT
COUT
KEY
QUIT
LOAIM
STAZ
JSR
JSR
LOAIM
STA
LOAIM
STA
LOYIM
$16
CV
TABV
BELL
$E4
POS
$07
POS
$00
LDAY
STAIY
INY
CPYIM
BNE
JSR
DATA
=
=
$AO
$Cl
$A4
$BO
$B4
$BO
$BO
$AC
$CC
$A4
$BO
$B3
$C3
$C6
$AO
ORG
COUT
HOME
CV
TABV
RDCHAR
CROUT
BELL
POS
FC
FD
FD
FD
03
FB
FF
03
OUT
03
DATA
*
*
*
*
*
*
*
=
=
=
=
=
=
=
=
=
=
=
=
=
~Nl~~LE
-----
NIBBLE is an unusual new Newsletter
for Apple n Owners. Each Issue will
follow a major theme ... such as:
* DATA BASE MANAGEMENT
* PROGRAMS FOR THE HOME
* TEXT PROCESSING
* COMPUTING FOR KIDS
* SMALL BUSINESS JOBS
* GAMES AND GRAPHICS
* PRACTICAL PASCAL
* etc.
Significant programs will be in each
issue, surrounded by articles which
show how to USE the programming
ideas in your OWN programs.
Examples of Upcoming Articles ...
+01
pes
$OF
OUT
$0300
A
$
o
4
o
o
L
$
o
* Building a Numeric Keypad.
* Home Credit Card Management.
* LO RES Shape Writing.
* Arcade Shooting Gallery Game.
* Random #'s in Assy. Language.
* HI RES Weaving Design.
And many many more. NIBBLE will
literally "Nibble Away" at the mysteries of the Apple n to help Beginning
and Advanced Programmers, Small
Businessmen, and the ~hole Family
enjoy and USE the Apple MORE!
It costs a paltry $15.00 for 8 Issues!
It will invite and publish user ideas
and programs. DON'T WAIT! Send
your check or money order right now,
to receive the January issue! Mail to:
C
F
S.P.A.R.C.
P. O. Box 325
Lincoln, Mass. 01773
)
Software Publishing And Research Co.
ULTIMATE JOYSTICK FOR THE APPLE II
$49.95
The Apple Joystick is a quality crafted dynamic
interactive I/O device engineered specifically for the
apple computer. The stick comes completely wired
for Daddies 0 & 1 and switches 0, 1 & 2. Among the
excellent features of the stick are auto-centering, which
positions the stick in the center of its range whenever
the handle is released, and positive action switches
with tactile feel and audible feedback.
The stick assembly itself is a precision molded unit
originally designed for the ultimate in smooth linear
proportional control required for international
radio-control model competition.
The heart of the stick centers around two cermet
resistive elements with bifurcated wiper contacts, which
provide the smooth continuous change in resistance
not found in wire-wound elements.
As an added bonus, all game I/O connections are
brought out and terminated in the cabinet. This feature
facilitates modification and/or implementation of all
game I/O functions, such as, (example: annunciators,
sound, paddles 2 and 3). Using Gesu's double I/O
extender cable and two joysticks (one modified for
paddles 2 and 3) two player joystick games can be
implemented.
Normally no adjustment is required upon installation
of the stick in your Apple computer. However, if it should
become necessary to adjust the centering, mechanical
adjustment tabs are provided inside the stick cabinet.
Refer to the Apple II reference manual for directions
on how to install the stick in your computer.
GAME I/O EXTENDER
CABLES SINGLE $10.00
DOUBLE $16.00
The single model consists of one foot of cable,
one 16-pin male and one 16-pin female connector.
The extender plugs into the game I/O and the female
end if secured to the outside of the cabinet with the
double-backed mounting tape provided. Installed in
this fashion the extender eliminates the necessity of
opening the apple computer to install or remove the
stick or any other game device.
The double model is exactly the same as the
single model with the addition of a second 16-pin
female connector. This extender has the same advantages as the single extender plus allowing two sticks
or game I/O devices to be installed simultaneously.
Note: When two games I/O devices are installed simultaneously make sure no conflicts exist betwen paddle
assignments. Only one device should be assigned to
each paddle.
COInRulerWorld
6791 WESTMINSTER AVENUE
WESTMINSTER, CA 92683
(714) 891-2587
TELEX 182274
JOIN
RAYGAMCO
NOW!
Become a
member of
RAYGAMCO
Computer
Discount Club.
SAVE
20%
AND MORE!
BIG SAVINGS ON EVERY ITEM!
---l
By being a RAYGAMCO Member you receive substantial discounts on every item you
purchase, including all hardware, software, accessories, even books and paper! You
will also receive a monthly newsletter with all the latest available for your particular
computer system, and much, much more - exclusive to RAYGAMCO Members only!
All the famous brand names, including:
Lear Siegler
APPLE
Alpha Micro Soroc
ATARI
Alpha Pro
Hazeltine Shu·gart
Texas Instruments
EXIDY/Sorcerer Cromemco Sektor
Kim/Commodore Xerox
PET
SAVE 200/0 AND MORE!
Here's how to join.
Fill out the information, and mail. That's· all there is to it. Nothing to buy.
I want to be a RAYGAMCO Computer Discount Club Member. Please send my
J RAYGAMCO Membership card to:
Name
_
Address
City
_
State
Zip
Computer (Brand Name)
_
I would like information on (please specify system, part, accessory, book, program, etc.)
WE HONOR VISA, MASTERCHARGE, BANKA MERICA RD.
Store Hours: Sat 10-6, Sun 12-4, Tu-Fri 11-8
TOLL FREE, EXCEPT CA
800-854-6455
RAYGAM J INC.
6791 WESTMINSTER AVENUE WESTMINSTER, CA 92683
TELEX 182274
(714) 891-2587
- [j~
~
~
I
inc.
BOX 120
ALLAMUCHY, N,J, 07820
201-362-6574
HUDSON DIGITAL ELECTRONICS INC.
THE HDE DISK SYSTEM.
HERE'S WHAT ONE USER HAS TO SAY.
• •
REPRINTED BY PERMISSION FROM THE 6502 USER NOTES· ISSUE NO. 14
PRODUCT REVIEW of the HOE DISC SYSTEM by the editor
A number of you have asked for details
about the HOE lull size disc system.
The system is based around the SYKES 8"
drive WIth the 6502 based Intelligent controller.
ThiS drive is soft sectored, IBM compatible,
and single density which lets you store about
a quarter megabyte of data on a disc.
The system software, called FaDS (File Oriented Disc System), manages sequential files
on the disc much the same way files are written on magnetic tape - one after another
When a file IS deleted, from a sequentially
managed file system, the space that the Ii Ie
occupied is not immediately reallocated, as In
some disc operating systems. As it turns out,
this can be an advantage as well as a disad-
vantage since deleted files on the FaDS system can be recovered after the file has'been
deieted. (ThiS has saved my sanity more than
once!) Of course when you want to recover
some ot the disc space taken up by a number
of these deleted files, you can simply re-pack
or compress the disc and all the active files
will be shifted down untillhere are nodeleted
files hanging around using up space.
FOOS has this ability to repack a disc.
Wren saving and loading In FaDS you work
with named Ides, not track and sector data or
1.0. bytes. ThiS makes Ille a lot easier. I've
se8n some diSC systems where you have to
specIfy track and sector Inlo and/or I. D. bytes.
Whal a pain that can be'
If you Just want to save a source file temporanly. you can do that on what's known as
"scratch-pads" There are two of these on a
dISC. "scratch' pad A" and "scratch· pad B".
each 01 these temporary disc lilescan hold up
to 16 K or II "B" IS not used. "A" can hold one
file UD to 32K In length. The only files that can
be temporarily saved on scratch pad are files
that have been built uSing the system text
editor
Being a dyed In the wool assembly language programmer. I really appreciate the
FODS text editor! ThiS line oriented editor IS
upwards compatible with the MOS/ARESCO
editor but includes about everything you
could ask for In a line edItor. There IS a fUll and
semi-automatic line numbering feature. lines
can be edited while they are being entered or
recalled and edited later. strrngs can be ~o­
cated and substituted. the line numbers can
be resequenced. the file size can be found.
the hex address of a line can be known and
comments can be appended to an assembly
Itle after It has been found correct. Oops! I
forgot to say lines can also be moved around
and deleted. This isn't the complete list cf
FaDS editor commands, just the ones that
immediately come to mind.
Another very powerful feature of the sys-
and read the diSC directory to see;f It can lind
it. If it's on the disc it will read it In and execute
it. Simple right? I've added
sevE~ral
commands
to my system and REALLY apprecIate haVing
thiS ability. Some 01 the things I've added
tem is the ability to actually execute a tile con-
include a disassembler, an expanded ver-
taining a string of commands. For example,
the newsletter mailing list is now being stored
on disc. When I want to make labels. I would
normally have to load each letter file and run
the labels printing program. But wilh FaDS. I
can bUild up a "JOB" file of commands and
execute it.
The job file in turn calls each lettered label
sion of XIM (the extended machine language
monitorfrom Pyramid Data), Hypertape, and a
lets you Interface Microsoft gOlgl1 BASIC to
file in and runs the label printer automatically. The way computers are supposed to operate right?
load the BASIC Inlerpreter itsell from disc as
well as saving and loading BASIC Programs to
Here's a listing 01 the job Ii Ie I use to print
mailing labels:
'L1S PRTLBL
0005 LaD ARUN ""LABELLOD B:JMP.EOOO:
LaD CJMP.EOOO:
0010 LaD D:JMP.EOOO:LOD E:JMP.EOOO:
LaD FJMP EOOO:
0015 LaD GJMP.EOOO:LOD H:JMP.EOOO:
LaD I:JMPEOOO:
0020 LaD J:JMPEOOO:LOD K:JMP .EOOO·
LaD L:JMP EOOO
0025 LaD M:JMP EOOO:LOD MC: JMPEOOO:
LaD N:JMP.EOOO·
0030 LaD O:JMP EOOO:LOD PJMP .EOOO:
LaD R:JMPEOOO
0035 LaD S:JMPEOOO'LOD TJMP EQOO'
LaD VJMPEOOO
0035 LaD SJMPEOOOLOD T JMP EGOO
LaD VJMP.EOOO
0040 LaD WJMP EGOO LaD XYZ JMPEOOO
0045 LaD EXCHJMPEOOOLOO COMP
JMP.EOOO:
Remember the MOS/ARESCO assembler I
reviewed several Issues ago? Well HOE went
and fixed up all the problem areas thai I
mentioned in the review and then look it
several sleps further. The HOE assembler IS
an honest to goodness two-pass assembler
whIch can assemble anywhere in memory us'
Ing multiple source files from the disc. The assembler is an optIonal part of the system.
If you're the kind 01 person (as I am) who
enjoys having the ability to Customize. modi-
fy. and expand everything you L,,,n - you'll
enJOY the system expansion abilities FOOS
has to offer. Adding a new command ;~ as
simple as writing the program. giving It a
unique three letter name and saving it to disc
Whenever you type those three letters the
system will first go through its own command
table. see that its not there and then go out
number of system utilities which make life
easIer By the way, to get back to the system.
all you need to do is execute a BRK instruction.
HOE also provides a piece of sol!ware that
their disc system. The software allows you to
and from the disc. This particLJlar version of
the software doesn't allow lor saving BASIC
data but HOE mentioned that tMis ability may
be possible with a future version
The first thing I do With a new piece of software after I get used to uSing it IS try to blow It
up. I did manage to find a weak spot or two In
the very first verSion of FaDS [a pre-release
version) but the later, release verSion has
beAn very tight
The standard soltware that IS Included with
the system conSists of the diSC driver soft-
ware, the system text editor and the BASIC
soflware interface. Several command extenSIons may also be Included. All the necessary
stulf like a power supply. the KIM·4 Interface
card, and all cables and connectors are In-
cluded. It took me about 45 minutes 10 get
things up and running the first time I put the
system together
Admittedly. a dual lull size diSC system from
HOE IS probably beyond the means 01 most
hobbyists but if you or your company IS look-
ing lor a dynamlle 6502 development sys'
rem. I would recommend thiS one. I've used
the Rockwell System 65 while I was at MaS
and feel that dollar for dollar. feature for
feature. the HOE system comes out on top
The onJy place the HOE system falls short
when stacked up next to the System 65 IS In
the area of packaging. At thiS POint. there IS no
cabmet for the disc drives available from HOE
So far. I've got nothing but 900d things to
say about HDE and their products Everything
I've received rrom them has been industrial
quality. That Includes their documentation
and oroduct support. I·m very Irnpressed wilh
what I've seen Irom lhls company so far and
qUite enthUSiastiC over what my KIM has
become since acquIring the dl:;c system and
ItS assocIated software
ERIC
THANK YOU MR. REHNKE!
HDE PRODUCTS - BUILT TO BE USED WITH CONFIDENCE
AVAILABLE DIRECT OR FROM THESE FINE DEALERS:
JOHNSON COMPUTER
Box 523
Medina. OhiO 44256
216- 725-4560
ARESCO
PO Box 43
Audubon. Pa 19407
215·631-9052
PLAINSMAN MICROSYSTEMS
Box 1712
Auburn. Ala 36830
80C·633·8724
LONE STAR ELECTRONICS
Box 488
Manchaca. Texas 78652
612-282'3570
PERRY PERIPHERALS
PO Box 92"1
Miller Place. NY
',76 . 1
516- 7 .1 ..1 ·6"6.2
SYM·1 Tape Verification
One of the problems with using audio cassettes on any
system is knowing whether or not the data has been
recorded properly. By the time you find the data did not
get recorded properly, it is usually too late to do any·
thing about it. Here is a technique and program to verify
the tape dump on a SYM·1.
Do any of you other SYMMERS ever
wonder if your tape save has executed
successfully? This "problem" began to
haunt me more and more as my tape
library grew. A fair amount of time would
be lost if the data on my tape was in error. It is possible (even though remotely)
two bits could be in error such that they
would "cancel" each other out in the
checksum verification at the end of tape
read. With all this floating through my
mind I decided to write the following
tape verification program.
Atter executing a tape save (high
speed format only) this program will
read the data back and compare it byte
for byte, to the data in the memory which
you just saved. This program needs no
external information (parameters) from
the user. The beginning and ending addresses of the data in memory is extracted from the tape. At the end, the
checksum is also verified. All the user
need do is rewind the tape after a high
speed format save, execute this program
and then start the tape unit in the read
mode.
)
The program is relocatable to any
point in the memory. No alterations are
necessary. This makes it easy to move
the program into any area of memory via
the MOV command. Just remember to
avoid placing any part of the program
near the top of page one or within the
data you just saved on tape. Please note
that this program is compatible with
monitor version SY1.0.
January, 1980
0010:
0020:
0030:
0040:
0050:
0060:
0070:
oOBO:
0090:
0100:
0110:
0120:
0130:
0140:
0150:
0160:
0170:
01BO:
0190:
0200:
0210:
0220:
0230:
0240:
0250:
0260:
0270:
02BO:
0290:
0300:
0310:
0320:
0330:
0340:
0350:
0360:
Jack Gieryic
2041 138th Avenue, N.W.
Andover, MN 55303
SYM - 1 TAPE VERIFICATION
BY JACK GIERY IC
JULY, 1979
oRG
0200
$0200
MONITOR SUBROUTINES
0200
0200
0200
0200
0200
0200
0200
0200
0200
ACCESS
CHKT
MONITR
OUTBYT
RDBYTH
RDBYTX
RDCHTX
START
SYNC
*
*
*
*
*
*
*
*
*
$BBB6
$BE7B
$BOOO
$B2FA
$BDE2
$BE28
$BDDE
$BDB6
$BDB2
CONSTANTS
0200
0200
CLKCoN *
SYN
*
rtF
$16
MON ITOR STORAGE
0200
0200
0200
0200
0200
0200
0200
0200
0200
0200
MICRO -- The 6502 Journal
BUFADH
BUFADL
CHKH
CHKL
DORIN
OISBUF
EAH
EAL
LATCHL
MODE
*
*
*
*
*
*
*
*
*
*
$OOFF
$OOFE
$A637
$A636
$A002
$A640
$A64B
$B64A
$A004
$OOFD
20:35
Messages
If the tape agrees with the data in
memory and the checksum is correct
then the message "good" appears on
the LED's. If the checksum is in error
(even though the data compared correctly) then the message "CSUM" appears
on the LED's. If any data is in error then
the address of the first compare error
appears on the LED's and the program
terminates without checking the remainder of the data on tape.
Programming Hints
I'd like to pass along a few suggestions to you SYMMERS just getting into
programming. Begin your program's
(code) at location '200 (page two). Do not
put anything (code, preset constants) into page one. Any constants you need in
page zero should be initialized by your
program. Do not set constants in page
zero and then store them on tape along
with your code. Do not use spare system
RAM for code, constants, or temporary
data storage. Begin all tape saves at
location '200". Avoid saving page one on
tape. I urge you to follow these suggestions as it will make your programmi
tasks just a bit easier.
20:36
0370:
0380:
0390:
0400:
0410:
0420:
0430:
0440:
0450:
0460:
0470:
0480:
0490:
0500:
0510:
0520:
0530:
0540:
0550:
0560:
0570:
0580:
0590:
0600:
0610:
06ZO:
0630:
0640:
0650:
0660:
0670:
0680:
0690:
0700:
0710:
0720:
0730:
0740:
0750:
0760:
0770:
0780:
0790:
0800:
0810:
08ZO:
0830:
0840:
0850:
0860:
0870:
0880:
0890:
0900:
0910:
0920:
0930:
0940:
0950:
0960:
0970:
0980:
0990:
1000:
1010:
1020:
1030:
1040:
0200
OZOO
86
80
B6
02
BF
02
00
DB
IF
04
82
DE
ZA
06
16
F2
F3
8B
VIAACR *
VIAPCR *
$AooB
$AooC
BEGIN
JSR
LOYIM
JSR
LDA
ANDIM
STA
LOAIM
STA
LOAIM
STA
JSR
JSR
CMPIM
BEQ
CMPIM
BNE
BEQ
ACCESS
$80
START
DORIN
$BF
DORIN
$00
VIAACR
CLKCON
LATCHL
SYNC
ROCHTX
$2A
LOA
ANOIM
STA
JSR
JSR
JSR
STA
JSR
JSR
STA
JSR
JSR
STA
JSR
JSR
STA
MODE
$BF
MODE
RDBYTX
RDBYTX
CHKT
BUFADL
ROBYTX
CHKT
BUFADH
RDBYTX
CHKT
EAL
RCBYTX
CHKT
EAH
RDBYTH GET NEW BYTE
BUFADL IF NOT END - OF - DATA +Jl
EAL
LoADE
BUFADH
EAH
LOAOF
0200
0203
0205
0208
oZoB
0200
0210
0212
0215
0217
o21A
0210
0220
0222
0224
0226
0228
ZO
AD
20
AD
29
80
A9
80
A9
80
20
20
C9
Fo
C9
DO
Fo
o2ZA
022C
oZZE
0230
0233
0236
0239
o23B
o23E
0241
0243
0246
OZ49
oZ4C
o24F
025Z
A5 FO
29 BF
85 FO
2028
ZO 28
ZO 78
85 FE
ZO 28
ZO 78
85 FF
20 Z8
ZO 78
80 4A
ZO Z8
ZO 78
80 4B
0255
0258
o25A
0250
o25F
0261
0264
ZO
A6
EC
DO
E2 eo
FE
4A 86
07
A6 FF
EC 4B A6
Fo 11
LOA DO
JSR
LOX
CPX
BNE
LOX
CPX
BEQ
0266
0269
o26B
0260
026F
0271
OZ73
0275
ZO
AD
01
DO
E6
DO
E6
DO
78 8E
00
FE
3D
FE
E2
FF
DE
LOADE
JSR
LDYIM
CMPIY
BNE
INC
BNE
INC
BNE
0277
0279
o27B
oZ7E
0281
0283
0286
0289
C9
DO
20
CC
DO
20
CD
DO
2F
43
Z8
36
3B
Z8
37
33
LOADF
80
AD
AD
AD
AD
80
80
LoAOA
LoAOB
LoADC
8E
8E
8E
8E
8E
BE
8E
86
8E
8E
A6
8E
A6
BE
A6
o28B A2 CC
0280 8E DC AD
0290 A9 6F
SYN
LOADA
LOAOB
SET MODE = HIGH SPEED
INITALIZE
SET INPUT PORT
SET UP CLOCK
STORE IN LO LATCH
GET IN SYNC
READ CHARACTER
IF NOT START OF DATA
LOAOC
THEN IF NOT IN SYNC
THEN RESTART SYNC SEARCH
ELSE KEEP LOOKING FOR *
ELSE START OF DATA
CLEAR NOT IN SYNC BIT
READ PAST IC
GET SAL FROM TAPE
ADD TO CHECKSUM
SAVE
GET EAL FROM TAPE
ADD TO CHECKSUM
SAVE
GET EAL FROM TAPE
ADD TO CHECKSUM
SAVE
GET EAH FROM TAPE
ADD TO CHECKSUM
SAVE
CHKT
THEN UPDATE CHECKSUM
$00
IF BAD COMPARE
BUFADL
LOADG
[HEN ISSUE ERROR MESSAGE
BUFADL
ELSE INC COMPARE ADDRESS
LOADD
BUFACH
LOAOC
LOOP
ELSE CHECK FOR / CHARACTER
CMPIM $ZF
IF NOT /
BNE
LOADH
[HEN ERROR
JSR
ROBYTX
ELSE IF CHECKSUM IS GoOC
CMP
CHKL
BNE
LOADH
JSR
RDBYT X
CMP
CHKH
BNE
LOADH
THEN EXIT OK
LDXIM $CC
5TOP TAPE
STX
VIAPCR
LDAIM $6F
ISSUE OK MESSAGE
MICRO -- The 6502 Journal
January, 1980
1050:
1060:
1070:
1080:
1090:
1100:
1110:
1120:
1130:
1140:
1150:
1160:
1170:
1180:
1190:
1200:
1210:
1220:
1230:
1240:
1250:
1260:
1270:
1280:
1290:
1300:
1310:
1320:
1330:
1340:
1350:
10=
0292
0295
0297
029A
029C
029F
02Al
02A4
02A6
02A9
80 41
5C
80 42
A9 5C
60 43
A9 5E
80 44
A9 00
BD 45
4C 00
STA
LOAIM
STA
LOAIM
STA
LOAIM
STA
LOAIM
STA
JI-'IP
OISBUF
$5C
OISBUF
$5C
OISBUF
$5E
OISBUF
$00
OISBUF
MONITR
LOAOG
LOA
JSR
LOA
JSR
LOAIM
STA
JMP
BUFAOH OISPLA Y COMPARE ERROR
ADDRESS
oUTBYT
BUFAOL
CUTB YT
$00
OISBUF +01
MONITR EXIT TO MONITOR
LOADH
LOAIM
STA
LDAIM
STA
LOAIM
STA
LOAIM
STA
LOA II-'I
STA
JtAP
$39
OISBUF
$60
OISBUF
$3E
DISBUF
t37
OISBUF
$00
OISBUF
MONITR
A6
A~
A6
A6
A6
A6
8a
02AC
02AE
02Bl
02B3
02B6
a2B8
02BB
A5
20
A5
20
A9
80
4C
FF
FA
FE
FA
00
41
00
02BE
02CO
02C3
02C5
02C8
02CA
02CO
02CF
02D2
0204
02D7
A5
8D
A9
80
A9
80
A9
80
A9
80
4C
39
42 A6
60
43 A6
3E
44 A6
82
82
A6
80
37
45 A6
00
46 A6
00 80
+01
"GOOD"
+02
+03
+04
+05
~ESSAGE
uperboard· .and C"':'1P Users:
. ander; Ufe; 0$1 pOD
vs.bllmp for
ith
mentation, .$8.95 each,
.95 for all. Ask about music
ems .software for live perforance.
.
Soundsmith Software Studio
308 4th Street
CA 93950
.
Pacific
;:Omni PI
kage on disk for.
.:"APPLE C
u ers with Applesoft on
.ROM. Disk and rnanual-$24.00.
. e Software International
CHECKSUM ERROR MESSAGE
+02
+03
+04
+05
+06
EXIT TO MoNI TOR
KIM/SYM/AIM-65-32K EXPANDABLE RAM
DYNAMIC RAM WITH ON BOARDTRANSPARANT REFRESH
THAT IS COMPATIBLE WITH KIM/ SYM / AIM-65
AND OTHER 6502 BASED MICROCOMPUTERS.
ASSEMBLED I {
TESTED
WITH 32K RAM
1419.00
WITH 16K RAM
1349.00
WITHOUT RAM CHIPS
1279.00
HARD TO GET PARTS ONLY (NO RAM CHIPS) . lUlU..
BARE BOARD ANDMANUAL
$49.00
• PLUG COMPATIBLE WITH KIM/SYMI AIM-li5.
MAY BE CONNECTED TO PET USINGADAPTOR
CABLE. SS44-E BUS EDGE CONNECTOR.
• USES +5V ONLY (SUPPLIED fROM HOST
COMPUTER BUS) 4WATTS MAXIMUM
• BOARO ADORESSABLE IN 4K BYTE BLOCKS
WHICH CAN BE INDEPENDENTLY PLACED ON
4K BYTE BOUNDARIES ANYWHERE IN A 64K
BYTE ADDRESS SPACE.
• ASSEMBLED AND TESTED BOARDS ARE
GUARANTEED FOR ONE YEAR, AND
PURCHASE PRICE IS FULLY REFUNDABLE IF
BOARD IS RETURNED UNDAMAGED WITHIN
14 DAYS.
• BUS BUFFERED WITH 1 LS TTL LOAD.
• 200NSEC 4116 RAMS.
• FULL DOCUMENTATION
PET INTERFACE KIT $49.0g
CONNECTS THE AIIIVE 32K EXPANDABLE RAM TO A 4K OR BK PET.
CONTAINS EXPANSION INTERFACE CABLE. BDARD STANDOFFS,
POWER SUPPLY MOOlflCATION KIT AND COMPUTE INSTRUCTIONS.
6502.64K BYTE RAM AND CONTROLLER SET
MAKE"64K BYTE MEMORY FOR YOUR 6lI00 OR
6502. THIS CHIP SET INCLUDES:
• 32M5K4116-3
16KX1,200NSECRAMS.
• 1 MC3480
MEMORY CONTROLLER
• 1MC3242A
MEMORY ADDRESS
MULTIPLEXER AND COUNTER.
.. OATA AND APPLICATION SHEETS. PARTS
TESTED AND GUARANTEED.
1325.00 PER SET
16K X1 DYNAMIC RAM
THE MK4116-3 IS A 16,364 BIT HIGH SPEED
NMOS, DYNAMIC RAM. THEY ARE EQUIVALENT
TO THE MOSTEK, TEXAS INSTRUMENTS, OR
MOTOROLA 4116-3
• 200 NSEC ACCESS TIME, 37S NSEC CYCLE
TIME.
• 16 PIN TTL COMPATIBLE
• BURNED IN AND FULLY TESTED
• PARTS REPLACEMENT GUARANTEED FOR
ONE YEAR
18.50 EACH IN QUANTITIES OF 8
Announcing ...
OPTIMIZED SYSTEMS SOFTWARE
UPGRADE YOUR APPLE II ® WITH A NEW SYSTEMS SOFTWARE PACKAGE
•
•
•
•
•
Unified Operating System
Disk Rle Manager
Commercial Basic
Editor I AssemblerlDebugger
Data Base Manager
Optimized Systems Software does not use Apple DOS®. OSS is a unified and complete systems software
package with its own Operating System and Rle Manager. The Operating System, the Rle Manager and
the Basic combined use only slightly more RAM than Apple DOS ® alone. Requires 48K Apple II ® with
Disk II.
Operating System
• Byte and Block 1/0
• Simple User Interface
• Simple Device Interface
(create your own)
Basic
• Nine Digit Precision DECI MAL Aoating Point
• 32K Byte Strings
• Variable Names to 256 significant characters
• I/O Interface Statements
(no PRINT "control-D...")
File Manager
• Open, Read, Write, Delete, Lock, etc.
• Random Access via Note & Point
• Rle Names of Primary. Ext type
Editor/Assembler/Debugger
• Une Editor
(Edits Basic programs, too)
• Mini Assembler
• Maxi Assembler
• Disassembler
• Step, Trace, etc.
Available NOW at Special Introductory Prices
• Operating System + Rle Manager
• Operating System + File Manager + Basic
• Operating System + Rle Manager + ASM
• Operating System + Rle Manager + Basic + ASM
• Operating System + Data Base Manager
$24.95
$49.95
$49.95
$89.95
(2nd Q)
Order today. Add $2.00 for shipping & handling. California residents add 6% sales tax. Visa/Mastercharge
welcome. Personal checks require 2 weeks to clear.
Note:
Apple II ~ Apple DOS ® are trademarks of Apple Computer, Inc.
Optimized Systems Software
Shepardson Microsystems, Inc.
20823 Stevens Creek Blvd., Bldg. C4-H
Cupertino, CA 95014
(408) 257-9900
Microbes 8 rid
:
R. M. Mottola from Boston, MA writes:
It has been brought to my attention· that my Screen
Dump Software (14:27) will not work with a printer that
can handle more than 40 columns; To correct this,
please make the following changes:
' ....
580 NEXT:PRINT ....:REM Null $
"
Robert A. Peck :Q1 Sunnyvale, CA says:
·eSYMphony in Stereo program in June 1979
. into some difficulties which I have fi
odl wanted to let you know about.
goes ,from 0200-0278, data area,
ctions: Begin \1ataarea at 219r
585 NEXT:NEXT
to 79,"OO05-to,38..
0.,.. :"::>, :",,,
,.:'"
c'_''';''':''''
startlnghi~e
·
"" .. >;
':-C
_
:,:,},(",~:,:,,~
addresses is)'j:
locations: At 0219 and0223/';!;i
ed. TfljswlllPlck uplnedata "
Jack Gieryic of Andover, MN founda
formation in the JUly 1979.issueof
Vritis' article "The First Booko~ ~f'
I have two reasons for urging avoid~~c~of thehar
ware change. First, your program may contalTlabu
elsewhere which Inadvertantly wrftesintosome9r:all
system RAM. Permanently removing thewriteprotec:
feature will make this bug more difUcult to;trace: rn~,
stead of "missing data" in some bUff~r or variable fa,
problem relatively easy to "see" and figureouthou may,
have memory alterations which could be impossiblelo
view as a critipal element of system RAM ,was'
destroyed.
.',
The second reason looks to the fut~fe:abtti,Jf" . . ,
Synertek ever does add a disk opt n 19Jhe;S't'M, '1/
wouldn't be surprisedif critical info
the disk driver were located in tne'
bug which alters this memory Co
disk data to be destroyed. This.
assume quite a bit butJs notou.tsi
possibility.
)
\
Philip L. Bryan suggests that in thElartl(~fe Clf'·.·'R1~bE~rl,.
Carlson's, "Baudot Teletype Driver"
the op-code for RORA shouldbe6A,
..'
,
_", _~-'.' - -'>','
,<'''/r ,:;,\{:j:J'~:~Zfl;%,r:':j'?;:_'i;f:?+S17<};;'-~~'!7;HctfJ
,;,~j~;::f2_,~/,,::-<_~_:,
From LeRoy Moyer of Chariottsville, V:1f.:O;»\.;~;(;,
MICRO contains many articles whichJenj9Y,
ticularly those that deal with machine lan9
routines. In the November issue.ttie AIlPI
. Renumbering program was a very u5etu.ladc:iitio
modification that I made to the prograrrt that
readers may be interested in is to include a
CMP #BC
BEQ $6020
This is put in the vicinity of $6CF7 to 6001
also do the LIST function.
Bob Bishop of Mountain View, CAllas
his article, "APPLE n Hires Picture
. (18:17):
.
. .
On page 23, under listing 2, there sft
AO,. 00, 84, 03,
A2, 40,
8Ej,
04;
98, 91, 03.C8,
DO, FB, EB,Q4,
CA, 00, F6,Eto. ..• ".... ', . . . . . .•••.
Also. If). psti~g 3 ~~t~/H~~
j
8A, 48, 98, 48,
A5,10,80,.Cf11
....,••.
53,A.9" 92>,~i; >
OEiA9,83,~; .
OF,A9, 00, 80,
CO, 83,.85,.00,
85, 01.A5, oi,;>\
4A, 09, 60', ~" ..
T.D.Q.
TAPE DATA QUERY
THE IDEAL SOLUTION FOR PERSONAL AND
VERY·SMALL BUSINESS DATA MANAGEMENT
PET·8K
TRS·80·LVL II
• COMPLETE CASSETTE FILE MANAGEMENT SYSTEM
ENGLlSH·L1KE COMMAND LANGUAGE
REPORT GENERATOR
- UTILITY PACKAGE
- NO PROGRAMMING KNOWLEDGE REQUIRED
- REQUIRES 2 CASSETTE RECORDERS
• T.D.Q. APPLICATION CASEBOOK
- COMPLETE DIRECTIONS TO MICRO·COMPUTERIZE:
elNVENTORY CONTROL
e CUSTOMER DIRECTORY
eACCOUNTS RECEIVABLE
eAPPOINTMENT SCHEDULING
e ORDER PROCESSING
e VENDOR MASTER FILE
e LABEL PRINTING
e PAYROLL JOURNAL
e CHECK PRINTING
e CHECKBOOK JOURNAL
elNVOICE PRINTING
e TELEPHONE BOOK
e RENT COLLECTION
•• SPECIAL YEAR·END SALE PRICE - $100.00·· - INCLUDES:
CASEBOOK; 2 CASSETTES; 3 USER'S MANUALS & REF. CARDS
ORDERS MUST BE RECEIVED BY JAN. 31, 1980
SEND CHECK OR MONEY-ORDER TO:
H. GELLER COMPUTER SYSTEMS
DEPT.M
P.O.BOX 350
NEW YORK, N.Y. 10040
(N. Y. RESIDENTS ADD SALES TAX)
AI M 65
BY ROCKWELL INTERNATIONAL
PROVEN R6500 MICROCOMPUTER SYSTEM DEVICES
Reliable, high performance NMOS technology ...
• R6502 Central Processing Unit (CPU), operating at 1
MHz. Has 65K address capability, 13 addressing modes
and true index capability. Simple but powerful 56
instructions.
• ReadlWrite Memory, using R2114 Static RAM devices.
Available in 1K byte and 4K byte versions.
• 8K Monitor Program Memory, using R2332 Static ROM
devices. Has sockets to accept additional 2332 ROM or
2532 PROM devices, to expand on-board Program
memory up to 20K bytes.
• R6532 RAM-Input/Output-Timer (RIOT) combination
device. Multipurpose circuit for AIM 65 Monitor functions.
• Two R6522 Versatile Interface Adapter (VIA) devices,
which support AIM 65 and user functions. Each VIA has
two parallel and one serial 8-bit, bidirectional I/O ports,
two 2-bit peripheral handshake control lines and two
fully-programmable 16-bit interval timer/event counters.
AIM 65 is fully assembled, tested and warranted. With the
addition of a low cost, readily available power supply, it's
ready to start working for you.
AIM 65 features on-board thermal printer and
alphanumeric display, and a terminal-style keyboard. It
has an addressing capability up to 65K bytes, and comes
with a user-dedicated 1K or 4K RAM. Two installed 4K
ROMS hold a powerful Advanced Interface Monitor
program, and three spare sockets are included to expand
on-board ROM or PROM up to 20K bytes.
An Application Connector provides for attaching a ITV
and one or two audio cassette recorders, and gives external access to the user-dedicated general purpose I/O lines.
Also included as standard are a comprehensive AIM 65
User's Manual, a handy pocket reference card, an R6500
Hardware Manual, an R6500 Programming Manual and an
AIM 65 schematic.
AIM 65 is packaged on two compact modules. The
circuit module is 12 inches wide and 10 inches long, the
keyboard module is 12 inches wide and 4 inches long.
They are connected by a detachable cable.
THERMAL PRINTER
Most desired feature on low-cost microcomputer systems ...
• Wide 20-column printout
• Versatile 5 x 7 dot matrix format
• Complete 64-character ASCII alphanumeric format
• Fast 120 lines per minute
• Quite thermal operation
• Proven reliability
FULL·SIZE ALPHANUMERIC KEYBOARD
Provides compatibility with system terminals ...
• Standard 54 key, terminal-style layout
• 26 alphabetic characters
• 10 numeric characters
• 22 special characters
• 9 control functions
• 3 user-defined functions
TRUE ALPHANUMERIC DISPLAV
Provides legible and lengthy display ...
• 20 characters wide
• 16-segment characters
• High contrast monolithic characters
• Complete 64c character ASCII alphanumeric format
BUILT·IN EXPANSION CAPABILITY
• 44-Pin Application Connector for peripheral add-ons
• 44-Pin Expansion Connector has full system bus
• Both connectors are KIM-1 compatible
TTY AND AUDIO CASSETTE INTERFACES
Standard interface to low-cost peripherals ...
• 20 mao current loop nv interface
• Interface for two audio cassette recorders
• Two audio cassette formats: ASCII KIM-1 compatible
and binary, blocked file assembler compatible
ROM RESIDENT ADVANCED INTERACTIVE MONITOR
Advanced features found only on larger systems ...
• Monitor-generated prompts
• Single keystroke commands
• Address independent data entry
• Debug aids
• Error messages
• Option and user interface linkage
ADVANCED INTERACTIVE MONITOR COMMANDS
• Major Function Entry
• Instruction Entry and Disassembly
• Display/Alter Registers and Memory
• Manipulate Breakpoints
• Control InstructionlTrace
• Control Peripheral Devices
• Call User-Defined Functions
• Comprehensive Text Editor
LOW COST PLUG·IN ROM OPTIONS
• 4K Assembler-symbolic, two-pass $79.00
• 8K BASIC Interpreter $99.00
POWER SUPPLV SPECIFICATIONS
• + 5 VDC ± 5% regulated @ 2.0 amps (max)
• + 24 VDC ± 15% unregulated @ 2.5 amps (peak)
0.5 amps average
PRICE: $369.00
(1 K RAM)
Plus $4.00 UPS (shipped in U.S. must give street address),
$10 parcel post to APO's, FPO's, Alaska, Hawaii, Canada,
$25 air mail to all other countries
We manufacture a complete line of high quality expansion
boards. Use reader service card to be added to our mailing
list, or U.S. residents send $1.00 (International send $3.00
U.S.) for airmail delivery of our complete catalog.
,
)
2967 W. Fairmount Avenue
PhoenIx AZ 85017
(602)265-7564
20:42
MICRO -- The 6502 Journal
January, 1980
Symbol Table Sorter/Printer
for the AIM Assembler
Some information about the AIM Assembler, a program
to print the Symbol Table . sorted alphabetically or
numerically, and some other useful stuff.
When the first Rockwell AIM showed
up at the local computer store, mouths
started watering. For a KIM user, to see
an AIM is to want one. It is hard to resist
that fine keyboard and display, the
clever little printer, and sockets for
Monitor, RAM, Assembler, and BASIC; or
for 2716 EPROM with your own stuff on
it. I've been running KIM with a Memory
Plus board (8K RAM, 8K EPROM, 2716
programmer, and a 6522 VIA), mounted
with power supply and I/O board in an attache case for portable use. This rig
hasaccumulated a half-dozen 2716's full
of KIM software, and I intend to continue
working on KIM applications. Since AtM
provides the same VIA, I bought one with
the justification that it would help me
develop more and better KIM software. If
you write it and debug it on AIM, and
move it over to KIM, you're done, right?
)
Well, yes. After a bit of learning about
conversion from one memory map to
another, it really does work that way.
The mnemonic insert mode ("I" command) is a joy to use. There are no more
op-code lookups and branch calculations and there are fewer typos. And the
disassembler ("K" command) lets you
check your work faster and more accurately. But for clean, patch-free object
code, the assembler is the best of all.
Six-character variable names! No linenumber hassle! Six-character labels,
such as "JMP NEXT," or "BEQ
OUTCHR." Af1d for easy transfer of object code from AIM to KIM, it's the
assembler that really does it. It makes
the writing of relocatable code almost
automatic.
January, 1980
The AIM assembler lacks one feature;
there is no command for printing the
symbol table after an assembly. So here
is a little program that fits on Page Zero
and does just that. After assembling any
program, load this one and start at 10. It
prints two listings of the assembly symbol table; one sorted alphabetically by
symbol name, and the other sorted
numerically by symbol address. The first
list is helpful when going through the
assembly listing. The second is even
more helpful when reading the output of
the disassembler; it lets you know right
away that the cryptic "JSR E9BC," for
example, is a jump to subroutine
OUTALL.
Mel Evans
ERIM, P.O. Box 8618
Ann Arbor, MI 48107
own symbol table. Notice that you don't
have to find and enter the location and
size of the symbol table; the program
finds these from the zero-page bytes
that it conserved while loading.
One note of caution in case you don't
read the following section. When you
assemble this source program, don't
direct the object code to memory. Direct
it to tape. Then load it and start at 10.
AIM·la-KIM Software Conversion
The following assumes that you have
more space in AIM RAM than you will
need for KIM memory. It works well with
a 4K AIM, and even better with 8K.
The sorting algorithm is plain bruteforce; it is desigbed to conserve memory
space, not sorting time. But even so, it
takes much less time to sort a list than it
does to print it. The only tricky feature of
the program is in its allocation of zeropage memory; in loading, it carefully
avoids wiping out the six bytes that
remember sxmbol-table size and location, because it will need them to know
where to work when you hit "Go."
The idea is to use AIM for both
assembly and running of the program
during the debug phase. In the process
of editing source, assembling, and running (and re-editing, re-assembling, rerunning, re-editing, etc., etc.), much time
can be saved by not having to load
source from tape, dump object to tape,
and reload object from tape for the next
run. (If you have disc, this may be less of
a problem. I wouldn't know.) So, build
your source with the editor (the very
good editor), assemble from memory,
and direct object to memory - to any
available memory, n01 necessarily where
it will go in KIM. It will be easy to move
later if you follow one rule: don't use fixed addresses except where really
necessary.
Figure 3 shows, as an example, the
use of the assembled program on its
Look at Figure 1 again. Observe that
the only fixed addresses used are those
The source (assembly-language) version of the sort/print program is shown
in Figure 1. The assembly listing, with
absolute addresses, is shown in Figure
2. A disassembler listing is not shown; if
you can't assemble this one, you don't
need it!
MICRO -- The 6502 Journal
20:43
of the six zero-page bytes containing
symbol-table location and size (STlO
through NSYMHI), the four Monitor
subroutines needed for printing (ClR
through CRCK), the start of the scratchpad block (* = $00), and the start of the
main program (* = $10). All other addressing
is
either
relative
(* = * + 1, * = * + 4) or by label (JSR
SORT, JMP COMPAR, BNE SWAP), with
absolute addresses and branch offsets
assigned during assembly. Therefore,
this whole program could be moved to
KIM by simply changing the scratch pad
start to any convenient spot in KIM zeropage, changing the program start to any
appropriate spot in KIM RAM, and reassembling, with object-output to tape
in KIM format.
That last phrase, "output to tape in
KIM format," is where we hit the first
snag. The AIM User's Manual says the
assembler will do this, but the manual is
wrong. If you try OUT·OBJ = K, the poor
thing locks up in a trance, and the only
recovery is RESET. (If you would like an
explanation from Rockwell on why this
happens, call Dave Sawtelle, AIM Applications, 714-632-0975. This number is
worth writing down; AIM Applications is
a very competent and helpful group.)
So how do you output object to tape in
KIM format? You have your choice of
two ways. The simple way is to output
object to tape in AIM format, load this
back into AIM, and then DUMP it to tape
in KIM format. This works fine, but it is
slow. The faster way, if you have room in
AIM RAM, is to send object to memory
and then DUMP in KIM format. Before
you do either, read on, or you may hit the
second snag.
The above sort/print is a bad example
of KIM-convertible code, for two
reasons. The first is obvious; considering its function, KIM couldn't do
anything with it. The second illustrates
some further precautions.
The AIM editor and assembler use the
top third (and some of the bottom) of
Page Zero, and several pieces of Page
One are used by tape I/O and monitor.
Furthermore, you can't (yet) trust the
momory map, in the User's Manual.
Rockwell is diligently fixing the
mistakes and has already issued Revision 1, but it is still too new to be totally
reliable. For example, look at the equate
list in Fig. 1 again. Notice those zeropage addresses for STlO through
NSYMHI? Does the memory map tell you
they are used by the assembler? No, it
doesn't. STLO, STHI, NSYMlO, and
NSYMHI are mentioned in the chapter
on the assembler (Section 5.2). I found
ENlO and ENHI by accident!
In order to assemble to memory and
run, try to avoid putting either program
or data on either Page Zero or Page One,
20:44
unless you want to discover, by trial and
error, the undocumented portions of the
memory map. It's okay to assign zeropage variables, but don't use the
assembler to initialize them with data.
The data may not survive the assembly.
Now, how about a program destined
for Page Zero, such as the sorter/printer
above? The final version (as listed
above) must be assembled with objectoutput to tape, and can then be safely
loaded and run. But during debug, the
assemble-to-memory-and-run cycle can
still be used by moving program and
data to higher memory. For example,
just before YTAB, change" =
+ 1"
to "* = $200" (to move data to Page 2);
and before START, change" =$10" to
"* = $300" (to move the program to
Page 3). This changes some addressing
modes from zero-page to absolute, but
the assembler takes it in stride. Now
assemble to memory and run. After it all
works, move data and program down to
Page Zero, and assemble to tape.
direction; move blocks to $200-3FF,
dump to tape, load to $200-3FF in the
other machine, and move to wherever.
If all you want is the block-move code,
Fig. 6 gives a disassembler listing and a
hex dump. It can be put anywhere, but
this version needs the bottom six bytes
of zero-page for "From", "End", and
"To".
Figure 1: Source Listing,
Sorter/Printer
* *
*
What if you need to use Page One?
The push-down stack at the top of Page
One is the same in AIM as in KIM, so
there is no problem there. (Simply allow
a bit more room for the deeper-pushing
AIM monitor.) The AIM memory map
shows eleven Page One bytes (106·107,
115-11 D) used by tape I/O, and eight
bytes (168-16F) used by the monitor. The
tape I/O bytes can be handled like Page
Zero bytes; I.e., avoid until assembling to
tape. The eight monitor bytes should
probably be permanently avoided; load .
them into KIM by hand after everything
else is transferred. And as an extra
precaution, check all of Page One for
wipeouts before running in KIM.
Please do not let all these cautions
scare you off. It really is fast and easy
after a little practice. Most programs
grow during debug, and much of the
above only applies if your program has
grown to the point where you are
cramped for memory space.
Fig. 4 shows how simple it is when
there is plenty of room. This is a generalpurpose "move block" program that will
go anywhere in memory (RAM or ROM),
and it will move any size block from
anywhere to anywhere. The assembly
listing (Fig. 5) shows that it occupies 24
HEX bytes of memory, and uses six
bytes of zero-page. Before moving it to
KIM, change that" =$00" to the start
of the six-byte block you want it to use in
KIM. Don't bother to change the
= $200" starting address; after you
have it in KIM, you can use the program
to move itself to wherever you want to
keep it. I keep two copies on tape, one
that loads to zero-page and one to the
top of RAM, plus one more in EPROM
With another copy in AIM, it can be used
for general memory transfer in either
*
"*
MICRO -- The 6502 Journal
--"
'-";"
..
--
... '-
-- . ..,..
::1 ....:; ;
:'_."'l"" .'
.:: : _ u
- ~. ~. r"!,
::: ! h
1
= ~ .:-'.
CPC~:.:=$EA24
I
*=$00
CNTLO
*=:+<+1 '
CNTHI
*=*+1
*=:\(+1
FtDHI
*=*+1
1Y/1
*=*+1
lt2
*::*+1
'r'L I M
*=*+1
'r'TAB
;
; IITAB L)ATA
,DB'I taees., $060E
;
.; MA I N PROGRAM
; JUMP OVER eEl)
ac
January, 1980
;
<TO $10)
*=$10
START
.; SORT
LDA #6
5TR
i
r
LDFt 0:: ADLO). 'f'
LD 'f 'T'l
5TR .: RElLO)., 'r
B't' NRME
LDA STf-iI
5fA ADHI
RTS
PLA
Le"f' 'r2
LIt1
1
5TFt (ADLO)., 'r
LD;:-:; #3
JSR SORT
LDA
INC 't'1
INC 'r2'
; SORT BY ADDRESS
LDA #8
5TFt 't'LIM
LD::<
5TA RDLO
~.::.
1t_.
J5R SDRT
BRK
BRK
LDA 'i1
[:t'lP #8
BNE ~:vJr'l
O!_·:_
ri:X:L I r'~E .J S~:
LD;;
HDLO
"
1-':-
INC
r:;·.: i;ri L·'n 1.
RDHI
BNE SRT2
LDA ADLO
C:r1F: ENLC!
'-1;-'
;::.c.!_"
~~T5
I NA::<
5E:C #:1.
r
5TA CNTLCt
LDA
r-~5:r:r:1H
n
.:.:
.
~ p.j
lj
.;
-!'oT,.
I
!"o.!","" ,-.
1..-'i:. =_"
5TR CNTHI
i
:r:
'-.r:
:-. i'\ ,-.; ...
E:NE
TAE~.: >::
BNE
:_. r-:. Lf··.
BNE GP1.
5~:Tl
;PRINT SORTED
5TR ':'2
J5R C::HP
.J5P
P~:t·JTl
; COMPARE CHAR. Wi)
C:G~~~:E5F'.
L:HHf::~.
IroJ
t·iE>::T L1 NE.
F:~:iR
.
NEXT CHAR.
L [) iT' r1
L[:q=t #$2fi
.J5F~
CdjTRLL
Ea'~E
F'F:1A
Fig. 2:
i
J5F~
iTi
LDii li2
(: rl F: (A [)LC! ).~
1N'r'
i
~i
r·~ >:~ LI r-~ E
8NE S~·JFiP
.'
TABLE
HFTE~:
.'
.; EG!UATE LIST
PRNT3 LDR
i
Br'~E
c: Ot~1PA ~~
5~jAP L[:oA #fi
5TP ii1
LDA #3
STR :r:2
Sl·J F' 1 L [:r ir' 'i 1
January, 1980
l
LDA #$20
J5F: C!iJTALL
I NC li:i.
INC Ti2
Lrqi Irii
eMF' 'T'L It1
L(:;A (ADLO).,
PHA
L[)'i 'T'2
SP5 trl
;SORT ! PRINT SYMBOL
[IUTALL
r'
E~ ::: ~::
Assembly Listing,
Sorter/Pri nter
PRNT2 LDA (ADLO);Y
LDA (A[) Lc~ :::.~
Er'~D
C:L~:
L[)irf #0
• IF A=8.
)
LAST PTS
Lljj
,\
:t:=:t:+4
e: 0 f~1 PA~~
~
LDA #$20
J5F~ CUT ALL
C:NTHI
LL.'ii
sr;:Tl .J5~: 5ETRD~:
5 PT2 L[) A
GAF LD::< #::
I::
~::
::$3E~
==00(10 5TH I
CP'i #;3
BNE PRtnJ:
.J5R C:~:C:K
1 NC:A[:j~:
8MI F'F:t4T1
==0000 ENLO==$::C
8 r-c: r
J5P.
'l
!~.~
'Ti
(ADLO)} Y
J5F rWf'iA
1 NiT'
==0000 ENHI=$JD
==0000 N5YMLO=$0C
FJFJ~Tl
GAP
==0000
N5YMHI=$08
==00~0
CLR=$EB44
RTS
.'
SETA[)R LL)H 5·TLC!
MICRO -- The 6502 Journal
20:45
==0000 OUTALL=$E9BC
==0000 NUMR=$EA46
==0000 CRtK=$EA24.
.'
==0000
:+:=$00
==0000 CNTLO
==0000
*=':4<+1
==f1001 CNTHl
==0£101
*=:¥+1
==0002 ADLO
==0002
*=*+1
.;;:=0003 ADHI
==0003
*=*+1
;;=0004 Iii
==0004
*=*+1
==0005 r 2
==0BeS
*=*+1
==(10e6 ','LIM
==0006
*='t<+1
==0007 :'iTAB
I
E605
)
A504
L[::H
==£1(124 5CiRT
(:90:3
Ct~1F
E:r'~E
irl:1.
*~::~
S~jP 1
E~t'~E
5RT2
A50C
85(10
A508
8501
==00212
20CC00
LDA NSYMLO
CNTLO
LDA N5YMHI
5TA CNTHI
5F.:T1
J5R 5ETADR
5TR
==f1t12F SRT2
8507
8504
B508
8505
LDA CtHLD
SE;C #1
5TA CNiLO
LDA YTAB+1.X
LINE.
; IF A)B.I
A-J:l
1'-"'."
==00J:E
A404
B102
A405
D102
9030
DeeR
E604
ES0S
5~JAP.
r..tI:r.
r-VT
,-·!-jAr:·
~_'r II .~..
COi'lPAR
L[)'r' it'i
LDA (ADLO),Y
Lt)'{
't'2
c~
t:.:,! i:.
BN£ 5~JAP
INC 1r'1
.'
.: r:1R I
r~
PR[H3~~Af:1
(TD $10)
INC '12
.;
SCn~~T
E~fi
D0EA
ENE COM PAR
A9(10
LDA #0
L[)A #6
8506
5TR !iL 1f:1
A2~1f1
LL·~l·1
202400
.j5~: 5Cn~~T
~Ur::;
BiT! A[)[:rRES5
#fi
A9f1:::
LDA #:3
8506
A2f12
5TR 'fL I t'1
LD::< #2
==0022
t~1
S~:lAP
.
~qi4::~
,-'
"-" "-'
NRt;lE
fi9t16
.;
L[)H iii
Ct~lP ir=L I
~~5fI4
:+==$:1.0
==fH3:1.0 START
8(:5 *+4
(:601
DEC Cr·JTH I
==00B8
A50i
LDA CNTHI
[)002
BNE *+4
A500
LDA CNTLD
009(:
BNE SRTi
.i PRINT SOlnED lIST
20(:C00 J5R 5ETADR
20E800 J5R GRP
==0096 PRNTl
2044EB J5R eLF::
Ft004
LD'r' #4
==£1098 PF:1A
-·~ ·)t7t
H
20BCE9 ..T5F~
[)Eit i
88
[)0F8
R0B0
[:5(16
A5~~14
85(10
B002
1_' " . _ "
CMP (ADLO),Y
BCC NXLINE
••- 4":.i"'""
'-J,.'-'-';=
t:,l ot:!C
LDOP COL!NT
SEC
A5;;H)
NE~c:T
..;::
J. 1-
DEC~:ErlEf~T
.~
E9fl1
; ! F· A(B., NE'c:T lINE
.
.;
STR ','1
; CC1MPARE CHAR. "'1/
CORRESP. CHAR. IN
.t
[)0E:2
LDA YTAB}X
4C3E00 JMP COMPAP
==00J:A
*=:+<+4
;
==(11;)7 ;:; t·r-=:L 1NE
20D500 J5R INCRDR
]:;3
5TA 't'2
JUMP elVER 3A-:::W
.i
[)0 E4
L[)'f #0·
==fWA5 PRNT2
B1[12
20BCE9 JSR DUTAll
C·o
·OJ
D0F6
A920
20BCE9
==0084
C:3
PHA
L()ir! r:2
i
I N'r
P~~NT2
#$2~~i
11-:1
...!
~:r:.
P~:NT::
Nt~tt1R
I r·~:i
[)0F6
2024EA
20[)500
==0f1C4
6:3
PLA
Ft405
L(::iri ii2
~=006C
9102
STR
(ADLO),Y
30D0
8M! PRNTl
F0CE
BEG! PFaHl
20EE~00 ']5~~
60
MICRO -- The 6502 Journal
GAP
P.TS
.'
==00CC
20:46
BNE PRiA
2046ER .JSR
4;::;
A4f15
OUT ALL
'5ETAD~~
January, 1980
A5J:A
LDA STLC!
8502
5TR
8503
5TA FlDHI
00E8
03ED
INA;<
0eEA
INCADR 00D5
SET AD?
I NCAN~:
I NA::-{
GAP
==(10[)5 I NC A(:;J~,
:-.: ,-,
1°
NS'/MH I 0008
GPl
00EFt
00E8
f10E[:i
LAS1
00FE~
NS'/MLO 000C
69(18
NXLINE 007S
OUT ALL E9BC
OUTALL E9BC
Cr::CK
EA24
NU~1A
EA46
CLR
EB44
ADLO
L[)A 5TH!
A5J:B
60
~~T5
LA5T
"
I_.~!_.
'J
LE)H A[)LO
FiDe #r.c·
5TR FlDLO
A5f;2
85£12
E'-"-'
:L·!__
:+:+4
9002
E6~}:
I t~C ANiI
L[:iFt ADHI
CrlP ENHI
A50J:
(:5J:D
[)f}04
BNE
==f10E6
INA~<:
A5~)2
L[)H
C~i'r'
..J_, ....
Ct~1P
ADLD
ENLO
==00EA I t·~ Ft;<
60
PTS
,i
==00E8 GAP
A2f13
#,'
-'
L[);"::
=*00EC' GF 1
2044E8 JSR
A920
LDA
208CE9 JSR
2024EA .J5~:
DE::<
CA
J
CLR
#$20.
DUTALL
CRCK
[)0F2
. .I
==00FE:
LAST
i=:ddr
fCC.
60
GP1
F:~TS
ERF.:OF.~S=
GAP
GPl
END
0000
NUMA
EA46
PR1A
009B
0096
PF.~NTi
PRNT2 00Ft5
PRtnJ: 0084
5ETADR 00CC
SORT
0024
SRT1
002C
(G),/
0010
0038
S~JAP
0054
'rll
1-12
'/L! M
eee4
0005
0006
'/TAB
0007
CNTLC
0000
.'
C:t'~TH I
0f10:i
A[)LD
(1002
:¥=$0(1
ADHI
000:1:
SWPl
:r 2
!ri L I
000::
0002
EB44
C:NTH I
00€il
c:~:c:~:~
)
January, 1980
EA24
-:;
I ZE
; BLOCK OF ME.MORY
; TO ANYPLACE IN RAM
B0jA
PUT 5TAPT OF
005C.
0005
i
[:1
00G6
.~~fiff?
I (i00E:
I N FPDr:1 H.:
ENE:: [;F BLOCK I r·~
E~L·DCK
:i
I:
Et·~ [:; H.
1
Rr~ [:: F
[,EST I r~RT I Dt·~
.;
EG~UHTE
~~ 5 T
N
L I 5T
F~:LO
*=:10=+1
F~:HI
*=:t:+:i.
ENLO
:~=:f:+l
ENHI
*=:t:"':1
SDF:T
5TLO
5THI
ADHI
ADLO
(:LR
i
START
5THI
STLO
5~~Tl
5~~T2
(*}=10
"
.; COP I E5 At'(r
002F
JT;TAE~
Example Run showing
Dual Sort
Fig. 4: Source Listing,
Block-Move Program
SRT2
t,~Silt;lH
Fig. 3:
O&FB
00[:C
00D5
0024
002C
(i02F
003:A
0f}3E~
ENLO
0fi3C
ENHI
00JD
COt-1PFH~~
5~JAP
5~~P:1
r~ ::<L I r'~E
p~~r·~T1
F:~:lA
003E
F~~:riT 2
0tiR5
PPr~T:~
~]0B4
TOLD
*=:«+1
TOHI
"
,i
MA I t~
F'~:C!GRAf~l
*=$2'~!0
START
.. I NCPH1ENT "EN[)"
INC ENLO
0~354
BNE :t:+4·
005C
00 7 ~3
0096.
L[:ZJri
f109E~
MICRO -- The 6502 Journal
INC ENHI
#a
MO',/E
LDA .: FRLD::';. ;(
STR : : TC~LD:::.,
l~
;1NCREMENT "FROM"
20:47
;:=0004
INC FF:LO
BNE :+:+4
0214 D0 BN"E 0218
INC Fi=::HI
; INCPH1ENT HTOH
INC TOLO
BNE :+:+4
INC TOHI
==0005 TOHI
,; CHECK I F DONE
SEC
LDA
F~:LO
0223: 00 BR-t:::
0224 0£1 B~:K
BCC: MOVE
; ALL C,ONE
BRK
LAST
9104
SIR (TOLO }Y
j INCREMENT
aiFROM
8R~::
END
D002
E601
::.,,-
or~C.
T ~::-.
J. !1 i...
*+4
FF:HI
(M:>=0200
( ) 0204
~: ). 0208
<") 020C
~: ) 0210
E6
E6
81
E6
.. ~ •... l1~:!.4
[;0
:8
02
0]
00 45 4D
0218
( ." 02iC
-( :> 0220
(
0224
! r~CF::Ef'lEt'~T HTG H
E604
I t4C TC;LCI
Fig. 5: Assembly listing,
Block-Move Program
I"I":~I_
--t:!~!t;.!t:J
,-·r·r" T,
", __
.~Ir
)
CCi P ! E5 ANif - 5 ! ZE
; BLOCK OF MEMORY
j
TO ANYPLACE IN RAM
,.
.~
BEF C!~~E
~:Urit·~
I r·~G.:
PUT START (iF
BL C!C~:: I r·i iI FRCit:l H .:
Eti[) OF E:LDC:K I r~
ii
EriC) ii .:
Ht~[:;
F! R5T
(:;002
Ft501
E50i:
90E5
(15
£5
E5
00
4F
i"
ENHI
8ee MOVE
c
" •• tI••
i.,. -e
t
lip,." •••
o_.loto
BF::K
8"Ot...
lli •• tl ••
••• r.a I I , a.u.olly .11_
00
1 •• ot lbe ""1.8 II
I1:
1••• r ••••
•••••DO• • • b., ••• r.-
..y.O.....
or u,.
obitt 110". to b. . . . .d
'tho " . r '•• r • •11I • • • • • 0 • '. . .-vir • • • •1rl.atl.0 .itl!l
• • • • •1 •• 1' po.ot.
==£1224 LAST
'1'110 ••' t • • • • • • • 1/411 t ••".p., ... t
••.,lII1 •• 1•••••••••• t ••• '
, ••'tte
All A.,L• •1I.,act • • • • •d ,.'It ••,
tI• • • o".to •.
".y•• r • • • lat.i".d.
C.p ••d .1I.ft L_II • • • • • • J•••••• •••• d ••• l.y opt10 ..
'••••d... e ••••
•
'.y••,'.
e
.'
t:1II •• ,lII".
t
d•• pl.yl ••
",eu
LCA ••• ,IIp,l.· . . . . . tr.but • • • 1 •••
e.,•• a ....... TO..
'l'ot.l., cOO,.tUI • • • • tl'l 001,
.110.'.' ••• of GIL •• '1'.::1'1' '.1 •• , '.J_'I' .ad .... ot•• e-
•••t.,
.~ EG!UATE LI 5T
DOl f . l •
••••• ,
.... J _ . l ••• _d ••
nO.Ga
Fig. 6: Block-Move, Disassembled
and Hex Dump
'lDft'AGI
CiaRuiM
I~
IDD'ICI.
....U...l.
II.,..
==fl0.00
",.n
,.oIMt
130.00
DrIED IYJe protr. CIIU_
,.,t: oil! AII'UlIIIJft. tM fU.t _ _rcl.U)'
_in aU.....
I
01 tM U.LI n .,.Ut
aa.e_UJ r.. l....
M.Utl•• ,
la_ Uah_ •
oces•• nt· ~
_ •• _, .... prl"tUoog
dU. . ~ CIIIl •• ~ ...... I~~ 11.... of
all_ _ try, . .h . . . . .u
. . . . . . )'aI" . - . ,r.at.r
II . . . . .t.uJ . . . . .11'. . 3'0 . . .
:+:=:+:+1
.,.t_.
"VULYU 1tU.L'I' .,e.
QUI'I,;I
(K>*=2f10
COIIpl.c.. _
.. proca._ lRcl..... D!'IOUIIl aPJlIIEXm . . . . . tuU
.r..-a
_iu.. '" .r. tMlRt • p
1-.r _
tl_ t6 . . . .lGfl til. .
- . e - _ _ r.Jta f.r.t
t6 ••• r.Jta "'It
FF.:H I
I.
tao lIodl ,.,.1.1111 MIl ...,. t6 _ .
. . ....L&SI.IPh N)' tao •• t . . . . . _
==3001
aIloIIL-Ta. cux::I
D!'IOUIIl
EIP~,
.-ellltlJ.1
I. I..,.. to
!'DTPN:b •
c... lt tCllfa," 0IU'ft0I.
oW'oULYLI 1tU.L'I' I'"
hr 1".00
=:~ca1;=11 -:~=.:.:~_~~..: ~t::::l~ APtJl~~~~.
==0002 EtiL Ci
==3002
:+:=*+1
ENHI
-UI'LE
0204 E6
0206 80 LI:/r' #00
".
:;
1.cll1••d, •• tt.Oll. p,Q.ld.d on dl.c
t •• c.pt to" ClacllJ.
0208 81 LDA (00:)}li
0208 91 5TR --" .., .
(i:i~
1. 0 .... l.tor" u..s-.:1l of appl. CCIaPIt., Inc:.
.ull docua.ar..t.oa
."."
*=*+1
==0004 TCiLC!
20:48
02
00
04
02
04
:rJ!
i t'=.. n l
;iTC;H.
==(1\303
D0
A0
91
00
E6
E6
00
01
E5
£605'
==02:1.8
.i CHECK
___ w
I~l:'r'
3:8
L[)R
A5£10
F~:LCJ
E502
ENLO
[:·E5T I NAT I Dt~ I t'4
==f10~}1
02
03
00
00
01
02
A5
A5
90
co
(
.~
4~
~3~3
02:1.F E5 :;8C 0::::
sac ENLO
LDFt FRHI
sac ENHI
__
3:;3 :;EC
021:=~
0219 A5 LDA
MICRO -- The 6502 Journal
i~;
:
oil .. l,lIIt. r ••• " •• d.
cb.cll OT
Our p,,".ct. 0". cap)' .. J.,ht.d .1 tl'l
0" •• "., .cI;0.,&1I1 •• by
_ . , Dr • • • • • "'otlld b. a.at
eOrl:l!l.d
tD'
ClH "'CRO
P.O Box 2q9
CUfTO. PAR., IlY 12065
January, 1980
I
.111111111111111111111111111111111111111111111111111111111111111111I11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111.
I--
---
• • • AIM· 65 •
~ A SPECIAL NOTE TO OUR CUSTOMERS
PIN
~ •
A65-1
A65-4
A65·A
A65-B
Special.
~
•
- •
~
_
~ •
~
I
EXCERT, INCORPORATED
Thanks to you we have moved to larger quarters.
We have also expanded our product offerings and
deleted others.
H
f
h
d
d
d 'II d
ope ully, we ave serve your nee s an WI
0 so
again.
We believe a customer is not an interruption of our
work, but the purpose of it.
~
Let Us Serve You Again!
~_ Thanks,
_
~ Laurie Root
~ Vice President
~
~
~ PIN
~
~ Power Supplies
~ PRS3
+ 5V at 3A, + 24V at 1A
•
-
~
~
•
!!!!
OTY 1 . 9
A65-K
OTY 1 • 9
w/mtg hardware, cord, etc. .
, $65
~ PRS4
+ 5V at 2A, + 24V at .5A
~
w/mtg hardware, cord, etc.
$50
~ From The Enclosures Group
~ ENC1
AIM-65 case w/space for PRS3/PRS4 . $45
~ ENCL1A AIM-65 case w/space for PRS3/PRS4
~
and one expansion board
. ..
$49
~ Cases with Power Supplies
~ ENC3
ENC1 w/PRS3 mounted inside
$115
$119
~ ENC3A ENC1A w/PRS3 mounted inside
~ ENC4
ENC1 w/PRS4 mounted inside
$100
~ ENC4A
ENC1A w/PRS4 mounted inside
$104
_
.
I
- From The Computenst, nco
~ MCP1
Mother Plus™ Dual 44 pin mother card
~
takes MEB1, V1B1, PTC1, fully buffered,
~
5 expansion slots underneath the AIM
$80
_ MEB1
Memory PIUS™ 8K Ram, 8K Prom sockets,
~
6522 tlO chip and programmer for 5V
~
EPROMS with cables
$200
~ PTC1
Proto Plus™ Prototype card same size
~
as KIM-1, MEB1, V1B1
$40
~ V1 B1
Video PluS™ board with 128 char, 128 user
~
char, up to 4K display RAM, light pen and
~
ASCII keyboard interfaces w/cables
$245
PIN
OTY 1 . 9
~
~__
~
--
Little Buffered Mother™ Single 44 pin
~
(KIM-4 style) mother card takes MEB2,PGR2,
~
PTC2 and P102. Has on board 5V regulator for
~
AIM-65, 4 expansion slots. Routes A&E
~
signals to duplicates on sides
$139
~
with 4K RAM
$189MEB2
SEA 16TM 16K static RAM board takes 2114L
~
with regulators and address switches
~
Blank
$125
~
8K . . . . . . . . . . . .. $225
~
16K
$325
~
PGR2
Prommer™ Programmer for 5V EPROMS
~
with ROM firmware, regulators, 4 textool
~
sockets, up to 8 EPROMS simultanously, can
~
execute after programming
$245
_
PI02
Parallel I/O board with 4-6522's
$260PTC2
Proto/Blank™ Prototype card that
~
fits MCP2
$39
~
PTC2A
Proto/PopTM with regulator, decoders,
~
switches ... . . . .. . . . . . . . . . . . . . . . .. $99
~
~
~
From Beta Computer
~
MEB3
32K Dynamic Memory Card w/on board DC to
!!i
DC converters (5V only .8Amax)
$419
~
with 16K
$349
~
with OK
$279
~
Miscellaneous
TPT2
~ We specialize in assembled and tested systems
i :i~,d~ef~~~ t~t~,a~~:~ei~~~~,Np~~~;'~o~hro~rice
MEM6
-
Approved Thermal Paper Tape
5/165' rolls
6/2114 RAM Chips .'
~
,
,....
~ shipping, insurance and handling. Please call or write
~
Higher quantities quoted upon request.
~ COD's accepted.
~ Add $5.00 for shipping, insurance and handling.
$10
$45
~
_
~
~
~
~ for exact prices or if questions arise.
~
~
~
MEP2
~ Systems
~
-
$40
$65
$40
$40
From Seawell Marketing, Inc.
-
~ Minnesota residents add 4 % sales tax.
~
Printer. . . . . . . . . . . . . . . . . . . . . . . . . ..
Complete Display Board
w/Exchange of Old Board
Keyboard
........................
~
~
---!
--
$375
~
$450
~
$85!!!!
$100!!!!
~
!!!!
$595
~
AIM-65 w/1K RAM
AIM-65 w/4K RAM
,.....
Assembler ROM .. . . . . . . . . . . .
BASIC ROM . . . . . . . . . . . . . . . . .
A65.4AB
AIM·65 w/4K RAM, Assembler & BASIC ROMs
Spare Parts (When Available)
A65·P
A65-D
~
~
~
~
~
!!!!
--~
Mail Check or Money Order To:
. EXCERT, INC.
P.O. Box 8600
White Bear Lake, MN 55110
(612) 426·4114
~
~
ii
i
_
~
!!!!
,,~IIIIIIIII ~IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 It
APPLE II SOFTWARE
CURSOR PILOT
gives any Apple II game-paddle control of the video cursor. Activate
by touching 'ESC'. lhen edit or copy with game-paddle. Supports
normal keyboard controls, is transparent to your programs.
on c...." • . . .
GREAT
PET
SOFTWARE
DATA HANDLER
data base management system. Supports infinite dala bases on the
Apple n disk drive. Structure data to meet your own needs, up to 255
fields per entry. Advanced data processing allows searching and math
to generate reports, extensions, and ledgers. Use for inventory, checks,
phone numbers, stocks, lab data, etc. Requires 32K & a disk drive.
on dl....". with manual . . .
ACCOUNTS RECEIVABLE/PAYABLE - A complete, yet simple to use
accounting system designed with the small businessman in mind. The
United Software system generates and tracks purchase orders and
invoices all the way through posting "controlled" accounts payable and
accounts receivable subsystems.
Keyed Random Access file methods makes data access almost
instantaneous. The low-cost solution for the first time computer user
with up to 500 active accounts. Requirements - 32K PET, Dual Disk, any
aO-column printer. ... Cost $175
CASH RECEIPTS & DISBURSEMENTS - Makes it a breeze to track all
outgoing payments made by any type of business operation. Checks
are tracked by number and categorized by type of expense. Sorting,
summary, and audit trails make it easy to post to general ledger. This
system also categorizes incoming receipts. Uses KRAM file access
method. Requirements - 32K PET, Dual Disk (printer optional) ....Cost
$99.95
KRAM - Keyed Random Access Method - The new, ultra-fast access
method for the PET Disk, provides keyed retrieval/storage of data, in
either direct or sequential mode, by either full or partial key values.
Written by United Software in 6502 machine code, and designed with
the PET in mind, it exploits all the benefits of the PET Disk, allowing full
optimization of your system. Eliminates the need for "Sort" routines!
KRAM provides flexibility never seen on a micro before. KRAM is
modeled after a very powenul access method used on large-scale IBM
Virtual Storage mainframes. So "KRAM" all you can into your PET - it
will love you for it. .. Cost $79.95
(Sublicenses available to software houses.)
PROGRAMS FOR
ENTERTAINMENT
Super Startrek. . . . . . . . . .. 14.95
PET Music Box
29.95
Space Intruders
("Best Game of 1979") .. $19.95
Jury/Hostage
12.50
Kentucky Derby/Roulette
9.95
9.95
Alien I.Q.lTank
Tunnelvision/Maze Chase 14.95
Submarine Attack....... 9.95
Battle of Midway........ 7.95
Laser Tank Battle. . . . . . . . 9.95
Swarm
14.95
UNITED SOFTWARE
PROGRAMS FOR BUSINESS
Checkbook
$15.95
Mortgage
15.95
Finance
12.95
Bonds
12.95
Stock Analyzer
22.95
Stock Options
" 24.95
49.95
6502 Macro Assembler
Look for the RED-WHITE-BLUE United Software Display at
your local computer dealer, or send check or moneyorder,
plus $1.00 shipping to:
UNITED SOFTWARE OF AMERICA
750 Third Ave.
New York, N.Y. 10017
Dealer inquiries invited
$4995
TYPESETTER
a complete HI-RES graphics character generator and editing system.
Allows colors, scaling. upper/lower case, inverse, and can HPLOT
letters to any point on the screen. Outputs through regular PRINT
statements. Use it to label graphs, create ad displays, or print lower
case. System includes 35 utility programs and character sets. When
ordering, specify if for disk Or POM Applesoft. Needs 32K with ROM.
48K wi th disk.
"Precise, humanized, well documented an excellent
value" are the applauds now being given to United
Software's line of software. These are sophisticated
programs designed to meet the most stringent needs of
individuals and business professionals. Every package
is fully documented and includes easy to understand
operator instructions.
DATABASE MANAGEMENT SYSTEM - A comprehensive, interactive
system like those run on mainframes! Six modules comprising 42K of
programming allow you to; create, edit, delete, display, print, sort,
merge, etc., etc. - databases of up to 10,000 records. Printer routines
automatically generate reports and labels on demand. 60 pages of
concise documentation are included. Requirements - 16-32K PET and
2040 Dual Disk (printer optional) .... Cost $125
$595
on diskette with manual, ..
$2495
HIRES UTILITY PACK
Why sweat over HI-RES graphics? Shape Generator lets you build
graphic shapes with game paddles, see them at all scales, colors, and
rotations. Save them to disk, and Shape Adder puts up to 255 shapes
togelher into a table. Ulilily Subroutines let you position without
plotting, find your last plot, and look at the screen 10 see if a point is
on. Requires 16K with Applesoft ROM.
on disk.tt• . . .
-+-
$1495
AVAILABLE AT YOUR LOCAL DEALER, OR CALL DIRECTLY AT,
ANDROMEDA COMPUTER SYSTEMS ?!:~~i~],:;NC "...
• Zl
VIsa and MasltrcharQe QJadly accepted
Appl. "and App/eJoff or. trade marb 01 'he Appl. Compuler Company, Inc.
RECYCLE(D)
COMPUTERS
•••••••••••••••••••••••••••••••••••••••••••••••
BUY 1:r SELL 1:r SWAP
Hardware
& Software
NEW PRODUCT ANNOUNCEMENTS
32 pagts
or lIIort
Mailed 1st Class every 3 Weeks
1yr. (18 issues) 1:1 $3.75
..............................................
ON LINE
Jhbt Jltttlt,lhbIisbtr cfstabIisbtb 1975
24695 Santa Cruz Hwy.• Los Gatos, CA 95030
THt: II!ST WAy TO OETUMINE If ON_LINE CAN 8E
a
VALUE TO YOU IS TO TRY Ii< ....
The MICRO Software
Catalogue: XVI
Name:
System:
Memory:
Language
Hardware:
IRR
PET
16K
BASIC
PET(8K) with Cassette
Description: IRR is designed to provide
the potential real estate investor with a
detailed breakdown of the projected annual cash flows for the first four years of
ownership based on 19 input datum. The
second portion of the program prOVides
the projected cash proceeds from the
sale, broken down by its various com:
ponents and tax considerations. The
third portion of the program provides the
partitioning of the Internal Rate of
Return into the three components: Cash
Flow, Tax Shelter, and Cash Proceeds
from the sale. It then indicates the present value of each component, the
percentage of the total return, and the
partitioning of the total Internal Rate of
Return into the three components. An
excellent tool to evaluate prospective
real estate purchases.
Copies:
Price:
Includes:
Just Released
$18.95
Cassette and Instructions
Author:
D.J. Romain
Available from:
D. J. Romain, P.E.
405 Reflection Road
Apple Valley, MN 55124
Name:
System:
Memory:
Language:
DUNGEON CAMPAIGN
APPLE II
16K (32K for disk version)
Integer BASIC
Description: Dungeon Campaign is a
game of high adventure wherein the
player directs an expeditionary force as
it ventures into an underground
labyrinth. The catacombs are filled with
treasures and hazards, poisonous
vapors and evil necromancers, stairways
and pitfalls, sorcerous devices and in incredible assortment of monstrous inhabitants.
The dungeon's monsters may pursue
or wait in ambush. They have a variety of
powers, strengths, and modes of attack,
and they become increasingly
dangerous in battle as lower levels are
reached. As the secrets of the dungeon
are uncovered by your force, a color coded map is generated until you find your
way safely out with your treasures.
Copies:
Price:
Author:
Available:
Name:
System:
Memory:
Language:
Hardware:
Many
$12.50 cassette, $15.00
disk.
(WA residents add 5.3
percent sales tax)
Robert C. Clardy
Synergistic Software
5221 . 120th Ave. S.E.
Bellevue, WA 98006
(206) 641·1917
Paper Tiger Graphics
Software
APPLE II OR APPLE II
PLUS
32K
Integer Basic or Ap·
plesoft
APPLE II, Disk II, and IDS
440G Printer
Name:
System:
Memory:
Language:
Description: The Data Handler is a data
base management system. It can support up to 255 fields/entry. Disk based, it
can support infinite data base sizes. Programs allow formatting, editing, sorting,
searching, and data processing. Can be
used for checkbooks, inventory, stocks,
etc. Includes sample files and manual.
Copies:
Price:
Author:
Available:
10
$49.95 on diskette.
N.C. residents add 4 percent sales tax.
Joe Budge
Andromeda Computer
Systems
P.O. Box 19144
Greensboro,N.C.27410
(919) 852-1482
Name:
System:
Memory:
Language:
Cursor Pilot
APPLE II or APPLE II Plus
Any Size
Machine
Description: The paper tiger graphics
software is a set of programs which
allow printing of anything that can be
displayed on the Apple II high resolution
pages. Any picture, graph, text, or
diagram which is displayed can be saved and dumped to the printer. Serial versions of the printing programs are listed
on the diskette. The names of the programs indicate which language is used
to execute the program. Pictures can be
expanded to twice the size and can be
inverted to give a black on white or a
white on black picture.
Copies:
Price:
Price:
Includes:
Authors:
Author:
Available:
$34.95
One diskette plus user
pamphlet
David K. Hudson
Local Apple Dealers or
Computer Station
12 Crossroads Plaza
Granite City, IL 62040
Data Handler
APPLE II or APPLE II Plus
32K with ROM - 48K
without
APPLESOFT II
Description: The cursor pilot gives game
paddle control of the video cursor. Activate by pressing escape, then edit or
copy with the game-paddles. All standard keyboard cursor controls function
normally. Transparent to Basic programs. Relocatable program works on
any APPLE II with or without disk.
Available:
Just Released
$5.95 on cassette
NC residents add 4 percent sales tax
Joe Budge and Jeff
Schmoyer
Andromeda Computer
Systems
P.O. Box 19144
Greensboro, NC 27410
(919)852·1482
Software Cataloq Note
)
Do you have a software package you want publicized? Our Software Catalogue is a good opportunity to receive some free
advertisement: This regular feature of MICRO is provided both as a service to our readers and as a service to the 6502 industry which
is working hard to develop new and better software products for the 6502 based system. There is no charge for listings in this
catalog. All that is required is that material for the listing be submitted in the listing format. All info should be included. We reserve
the right to edit and/or reject any submission. Some of the submissions are too long. We might not edit the description the same
way you would, so please, be brief and specific.
January, 1980
MICRO -- The 6502 Journal
20:51
(:commodore
PRINTERCOM
2001 . 32N
$1295
$795 00
2001 - 8N
2001 . 168
PET to IEEE Cable
IEEE to IEEE Cable
C2N CASSETIE
8K DIAGNOSTIC KIT
DISKETTES:
DVSAN [Business Quality]
VERBATIM
00
$995
$995 00
$129500
$22500
$2995
2001 - 16N
2001 . 328
16/32K DIAGNOSTIC KIT
AUDIO AMPLIFIER PET
2022
2023
00
$995 00
$849 00
$39 95
$4995
$95 00
$3000
5/$24 50
10/31 95
N DENOTES GRAPHICS ON LARGE KEYBOARD
B DENOTES NO GRAPHICS ON LARGE KEYBOARD
BUSINESS SOFTWARE
OSBORNE General Ledger Disk
$295
Accounts Payable Disk
$19500
Accounts Receivable Disk $19500
Word Processor 16/32K Disk $9900
CBM General Ledger Disk
Accounts Receivable Disk
Accounts Payable Disk
Payroll Disk
MIS
Inventory Disk
Job Cost/Bid Disk
Customer Information
[Mailing List] Disk
$12000
$12000
$12000
$12000
CBM - MIS Complete 7 Module Set
CMS
Inventory Control Disk
$19500
[Available 12·1-79]
Mailing List Disk
$9500
Payroll Disk
$29500
[Available 1·15-80]
Word Processor Tape
$2495
00
$120 00
$12000
$12000
$79500
All 16N/16B Upgrade to 32K
$310 00
Ship computer and check to:
HrJmE LClmpUTEA5
1775 E. Tropicana
(Liberace Plaza)
Las Vegas, NV 89109
702/736 . 6363
FREE Software
LAS VEGAS series with any PET
computer purchase or upgrade
to 32K, valued at $200 00 or
more, including other software.
.
PROGRESSIVE SOFTWARE
Presents
Software and Hardware for your APPLE
SALES FORECAST provides the best forecast using the four
most popular forecasting techniques: linear regression, log
trend, power curve trend, and exponential smoothing. Neil D.
Lipson's program uses artificial intelligence to determine the
best fit and displays all results for manual intervention. $9.95
CURVE FIT accepts any number of data points, distributed in
any fassion, and fits a curve to the set of points using log
curve fit, exponential curve fit, least squares, or a power curve
fit. It will compute the best fit or employ a specific type of fit,
$9.95
and display a graph of the result. By Dave Garson.
UTILITY PACK 1 combines four versatile programs by Vince
Corsetti, for any memory configuration.
• Integer to Applesoft conversion: Encounter only those
syntax errors unique to Applesoft after using this program
to convert any Integer BASIC source.
• Disk Append: Merge any two Integer BASIC sources into a
single program on disk.
• Integer BASIC copy: Replicate an Integer BASIC program
from one disk to another, as often as required, with a
single keystroke.
• Applesoft Update: Modify Applesoft on the disk to eliminate the heading always produced when it is first run.
• Binary Copy: Automatically determines the length and
starting address of a program while copying its binary file
from one disk to another in response to a single keystroke.
$9.95
MISSILE·ANTI·MISSILE display a target, missile, anti-missile,
a submarine and map of the U.S. on the screen. A hostile submarine appears and launches a pre-emptive nuclear attack
controlled by paddle 1. As soon as the hostile missile is fired,
the U.S. launches its anti-missile controlled by paddle O. Dave
Moteles' program offers high resolution and many levels of
play.
$9.95
TOUCH TYPING TUTOR teaches typing. Indicates speed and
errors made. Finger Bldrs, Gen. Typing, Basic Language and
$19.95
User Supplied. Diskette. Written by Wm. A. Massena.
APPLE MENU COOKBOOK index·accessed data
storage/retrieval program. Recipes stored, unlimited lines per
entry. Easy editing. Formulated after N.Y. Times Cookbook.
Other useful features included.
Written by Wm. Merlino, M.D.
$19.95
MAILING LIST PROGRAM maintains complete record of name,
address, phone no., mailing labels accommodates parallel
card or built-in printer driver, easy data entry.
Diskette. 32K.
$19.95
BLOCKADE lets two players compete by building walls to
obstruct each other. An exciting game written in Integer
BASIC by Vince Corsetti.
$9.95
TABLE GENERATOR forms shape tables with ease from directional vectors and adds additional information such as starting address, length and position of each shape. Murray Sum·
mers' Applesoft program will save the shape table anywhere in
usable memory.
$9.95
OTHELLO may be played by one or two players and is similar
to chess in strategy. Once a piece has been played. its color
may be reversed many times, and there are also sudden
reverses of luck. You can win with a single move. Vince Corsetti's program does all the work of keeping board details and
flipping pieces.
$9.95
SINGLE DRIVE COpy is a special utility program, written by
Vince Corsetti in Integer BASIC, that will copy a diskette using
only one drive. It is supplied on tape and should be loaded onto
a diskette. It automatically adjusts for APPLE memory size
$19.95
and should be used with DOS 3.2.
SAUCER INVASION
SPACE MAZE
STARWARS
ROCKET PILOT Written by Bob Bishop
SAUCER INVASION lets you defend the empire by shooting
down a flying saucer. You control your position with the paddle while firing your missile at the invader. Written by Bob
Bishop.
$9.95
HARDWARE
LIGHT PEN with seven supporting routines. The light meter
takes intensity readings every fraction of a second from 0 to
588. The light graph generates a display of light intensity on
the screen. The light pen connects points that have been
drawn on the screen, in low or high resolution, and displays
their coordinates. A special utility displays any number of
points on the screen, for use in menu selection or games, and
selects a point when the light pen touches it. The package includes a light pen calculator and light pen TIC TAC TOE. Neil
D. Lipson's programs use artificial intelligence and are not
confused by outside light. The hi-res light pen, only, requires
$34.95
48K and ROM card.
TO ORDER
POSTAGE AND HANDLING
Please add $1.25 for the first item
and $.75 for each additional item.
)
• Programs accepted for publication
• Highest royalty paid
Each $9.95
Send check or money order to:
P.O. Box 273
Plymouth Meeting, PA 19462
PA residents add 6% sales tax.
U.S. and foreign dealer and distributor inquiries invited
All programs require 16K memory unless specified
STOCK MARKET ANALYSIS PROGRAM
OJI WEEKLY AVERAGE 1897-1980
TR5-BO PET 5100
APPLE KIM AIM65
INEXPENSIVE CONTROL SOLUTION FOR
HOME SECURITY. ENERGY CONSERVATION
GREENHOUSES • ENVIRONMENTAL CONTROL
INDUSTRIAL CONTROL· LABORATORIES
CmC's I-'DAC system now includes an interfac~lo the BSR X-1 0 remote
control modules. These low-cost modules allow control over lamps,
motors and appliances. With the CmC X-1 0 interface your computer can
control 256 separate devices. Lamps can be turned on or off, dimmed or
brightened. Aiarms, kitchen appliances, hi-fis, TVs, motors, pumps,
heaters and more can be put under your computer's control.
Direct plug-in and software for most computers.
Circle the reader service number, call or write for our latest catalog.
CONNECTICUT
APPLE@) II. 48 K, APPLESOFT
ROM CARD, DISK II DOS 3.2
ANA1 DISK & MANUAL ••• 149.95
ICA residents add 6% sales taxI
microCOMPUTER, Inc.
150 POCONO ROAD
BROOK~ELD.CONNECT~UT~~
TEL: (203) 775·9659
ANA 1 (ANALYSIS 1) is a set of BASIC Programs wnlcn enables tne user to
perform analyses on tne Dow Jones Industrial weekly average data. From 6
montns to 5 years of user selected DJI data can be plolled on tne entire screen
in one of 5 colors using Apples' Hign Resolution capabilities. Tne DJI data can
be transformed into different colored grapnic representations called transforms.
Tney are: user specified moving averages, a least squares linear fit (best stralgnt
line); filters for time, magnitude, or percentage cnanges; and user created relationsnips between tne OJI data, a transform, or a constant using ·,·,x./ operators.
Colored lines can be drawn between grapnic points. Grapnic data values or
tneir dates of occurrence can be displayed in text on tne screen. Any grapn or
text can be outputted to a users printer. Tne Grid Scale is automalically set to
tne range of tne grapns or can be user cnanged. As many colored grapns as
wanted can be plotted on tne screen and cleared at any time. Tne user can code
routines to operate on tne OJlltransform data or create nis own disk file data
base. ANA 1 commands can be used witn nis routines or data base. An Update
program allows tne user to easily update tne OJI file witn current DJI weekly
data.
Tne ANAl two leller user commands are: CA = Calculate, no grapn. CG = Clear
Grapns, leave Grids. CK = Cnecking out program, known data. CO = Color of next
grapn (red, green, violet, wMe, blue). CS = Clear Screen OL = Draw Line between
points. FI = Filter data for time, magnitude. or percent cnange. FU = Data. transform, or constant Function witn ·,·,x./ operator. GO = Grapnic mode. display
all Grapn Data on screen. GR =Grapn data to screen. GS =Set Grid Scale HE =Help.
summary ot any commands usage. LD = Load Data from disk file Irom inputted
date to memory. LG = Leave Grapns. automatic Grid rescaling. LO = Look, select
a range of the LD data and GR; All commands can now be used on tnis range.
LS = Least squares linear fit of tne data. MA =Moving Average of tne data. NS =
No Scale, next grapn on screen does not use Grid Scale NT = No Trace. PR = User
implimented Printer routine. TO = Text mode, display Text Data on screen. TI =
Time number to date or vice versa. TR = Trace TS = Text Stop for number 01 lines
outpulled to screen wnen in TO. U1/U2 = User 1/2 implimented routines. VD =
Values of Data outputted In text. VG = Values of Grid; low/nign/delta VT = Values
of Transform outputted in text.
GALAXY
DEPT. Mil
P.O. 80X 22072
SAN DIEGO, CA 92122
TWX: 710·456·0052
************************~
:
:
:
KIMSI
:
FLOPPY
:
DISKS-:
*
PERRY PERIPHERALS HAS
*
•
•••
THE HOE MINIFLOPPY TO KIMSI
ADAPTER
:
• MINIFLOPPY S-1 00 ADAPTER: $15
: . FODS and TED Diskette
• • FODS and TED User Manuals
• • Complete Construction Information
•·OPTIONS:
...~.
FODS Bootstrap in EPROM (1st Otr'SO)
• • HOE Assembler (ASM) $75
• • HOE Text Output Processor (TOPS) $135
.
*
*
**
*
*
:
*
*
**
*
:
•
(N.Y. State residents, add 7% Sales Tax)
*:
•
Place your order with:
*
:
PERRY PERIPHERALS
:
•
P.O. Box 924
•
•
Miller Place, N.Y. 11764
;
(516) 744-6462
:
: Your "Long Island' HDE Distributor
!
~**********************~*
*
PET Word Processor
8K
and
16/32K
PET
versions
This program permits composing and printing letters,
flyers, advertisements, manuscripts, etc., using the
COMMODORE PET and a printer.
Printing directives include line length, line spacing,
left margin, centering and skip. Edit commands allow
you to insert lines, delete lines, move lines and
paragraphs. change strings, save files onto and load
files from cassette (can be modified for disk), move up,
move down, print and type.
Added features for the 16/32K version include string
search for editing, keyboard entry during printing for
letter salutations, justification, multiple printing and
more.
A thirty page instruction manual is included.
The CmC Word Processor Program for the 8K PET is
$29.50. The 16/32K version is $39.50.
Order direct or contact your local computer store.
YISA AND IIle ACCEPTED - IBID ACCOUNT NU"BER, EXPIRATION DATE AND SIGN ORDER.
ADD .1 PER ORDER FOR StflPPlHO. HANDLING - FOREIGN ORDERS ADD 10C1. FOR AIR POSTAGE
CONNECTICUT
microCOMPUTER, Inc.
150 POCONO ROAD
BROOKF~LD.CONNECT~UT~~
TEL: (203) 775·9659
TWX: 710·456·0052
Search/Change in Applesoft
It is often useful to be able to search a file for a par·
ticular string and then to change the string for a new
one. This paper presents a Search/Change capability for
Applesoft.
A program to produce a crossreference table for all the variables in a
program under development is a useful
tool; such a table enables one to determine whether and where a variable label
has been used. Unfortunately, a
variable's cross-reference program in
BASIC is not available in the literature
although the development of one was
recently reported by William and Alice
Englander, Nybb/es: BAS/C CrossReference Tab/e Generator, Byte, v4,
4:190 (April 79). About as useful in pro·
gram development though not as neat
for complete documentation purposes is
the FIND program of Jim Butterfield, /nside PET BAS/C, MICRO, 8:39,
(December78-January 79). Butterfield's
paper inspired the present SEARCH/FIND program, one that does the same
function as Butterfield's but also, allows
one to change the found item (within
limits).
)
SEARCH/CHANGE is about seven
times as long (1.5 Kbytes) as
Butterfield's FIND and runs at about half
the speed. It takes about 2.5 minutes to
search 8.5 Kbytes. On the plus side, the
extra length and sacrifice in speed buys
1. the option not to search or
only to search strings,
2. the option to have listed the
lines that contain the sought
item, and
3. the option to replace the
sought item by anything of equal
length.
January, 1980
Because of the limitation on length in
the CHANGE function, this feature is not
really a general purpose program editing
tool. Nevertheless, it is quite useful in
dressing up variable labels or changing,
say, a real variable to an integer variable.
Demonstration
To do a search/change, the
SEARCH/CHANGE program must be appended to the program to be searched.
Either use the merge feature of the 3.2
DOS renumbering program or the
machine language APPEND program
and proceedure given by Chuck
Carpenter, Renumber App/esoft, MICRO
12:45 (May 79). Once the programs are
wed, enter the search item as line 1 and
the change item, if any, as line 2. Then a
RUN 63000 starts the works.
To demonstrate the workings of
SEARCH/CHANGE, we use the rather
nonsensical program listed in Figure 1.
We enter the search item DOG as line 1
and run 63000. The print-out of this run is
given in Fig. 2. Every appearance of the
three consecutive letters DOG is listed.
Had we asked for the lines to be listed, a
given line would have been listed only
once.
We can search for anything; Fig.
3(a) shows the result of a search for
equal signs. However, we do have to be
careful of Applesoft's reserved words.
MICRO -- The 6502 Journal
J.D. Childress
5108 Springlake Way
Baltimore, MD 21212
Figure 3(b) shows what happens if we try
to search for CAT. Applesoft recognizes
the reserved word AT in CAT. This makes
clear the need of having the program list
for verification the search and change
items.
The reserved word problem is a
relatively minor nuisance. A little in·
genuity can get us around it. In the CAT
case, we could search for CA; if that
gave too many other items, we could
then search for TS and only consider the
lines that appear in both lists.
The CHANGE function, as weil as
the line listing feature, is demonstrated
in Fig. 4. Again caution is wise. What if
we had already used the DGS label in our
program? There would be no way later
that we could separate the old DGS from
the new DGS. If in doubt in changing a
label, first make a search to see if the
new label is already being used.
In changing the variable label from
DOG to DGS, we did not want to change
the word DOG inside strings, hence did
not search strings. The capability of not
searching strings or only searching strings provides all the flexibility we ever
need.
We note that we can only change an
item to one equal in length (as AP·
PLESOFT sees the length). Extra length
in the change item entered as line 2 is ig·
nored. If the replacement is shorter than
20:55
Fig. 2:
the search item, things go awry. The
result is a muddle, correctable in general
only by a start over from scratch.
Design
)RUN 63000
DOG
1
A few comments on the design of
the SEARCH/CHANGE program are of·
fered here in lieu of remark statements
in the program itself.
First the program identifies the
search item, FOR loop lines
63040·63070. Then it identifies the
change item, if any, FOR loop line 63110
and preceeding line. The search is car·
ried out by FOR loop lines 63130-63170.
To get the best operating speed, we
close the FOR loop within a single line
(line 63130) if no byte of significance is
found. Even so, the testing for up to
three conditions takes time. If one of
these conditions is not met, then the
following lines either pass to subroutine
line 63300 to complete the item identification test and make the item change
(if one. is entered), or set the string's
search flag, or strart the search of the
next program line, whichever is in·
dicated. Line 63120 determines that the
search is over when line 62999 Isreached
and passes to output. The routine lines
63220-63290 accomplish the line listing
feature. Note that the search for the
LIST command is backwards from the
. end of the program (we know that the
one we want is the last one). Also note
that the line number has to be poked in
so that there should always be five digits
following LIST. After use of the program,
the actual number that appears here
when line 63270 is listed is the last
number poked in. There should be
leading zeros if that number had less
than five digits. The Applesoft Interpreter preserves these leading zeros
whereas the 3.2 DOS renumbring program does not. If you want to renumber
SEARCH/CHANGE, remember to check
this line and, if you want to, change the
62999 in line 63120.
SEARCH Demonstration
)1 DOr,
PL~~~E VEPIFY IF THE COMPUTE~ TArF~
TH I S A~ YOU H'TEN!"E[l. Df' YOlt ~"ANT
TO C()~'T I NlI F (YES n" Nt')? YFS
[\0 Yn" \'IANT Tn SFAPrH INcqnF ~Tl)'~!r,~
(YFS M ~'n) '? YES
On YOU W~~IT Tn c; F~qCH STP I Nr,c; I)~I LY
(YFe; f'R NO)? Nn
THE I TE~
1 DOr,
IS FOUND IN THE FnLLnWINR LINEc;:
20
50
60
90
140
60
70
60
110
lnn
flO YOU
\oIANT
Fig. 3:
(a)
THE ITEM
1
140
THF~F.
L1NFS
(yr:~
L1~TFn
OP NO)? NO
Other SEA~CH Demonstrations
Search for equal signs
•
IS FOUND IN THE FOLLOWING LINES:
5(1
10
70
50
80
DO YOU WANT THESE LINES LISTEO (YES OR NO)?
(b)
Attempt to search for CAT
~O
>l CAT
)RUN 6300(1
Figure 1:
listing of Demonstra·
tlon Program
10
20
30
40
50
60
FOq I • 1 TO 5
D~I~T
"ro~s
A~r
r~TS
FI~HT.
";: ~FXT : PRI~T : PRINT
H1PIJT "r,IVE Tll< f!l''''AFP OF rAT
c;
";rTC: DIlINT
I"PIIT "r:IVF THE NII",qF~ nF DOt:
5 ";nor.: DIlINT
IF CTS • 0 ANn nor: • 0 TH<N FMO
PDINT: PDINT "THF PIlORAqlF ~
IMNFQ IN A CAT-nOr. FIr.HT": PRINT
U\iITH It;nnG;1I 00(;$ A~n ";crc:
7D
ao
;" CATe; WNlln !'IF"
IF ror. • 0 THEN PPINT " •••••
rAT5
: EN"
IF CTC • (l THFN PDP'T " •••••
Dn~$
00
IF
:
I='''fn
ONI'! (1) • CTc; I nor: > .c THF"
'1 ••••• rAT~ ••••• ": FNr
1 C AT
PLEASE VERIFY IF THE COMPUTER TAKES
THiS AS YOU INTENDED. DO YOU WANT
TO CONTINUE (YES OR NO)? YES
DO YOU WANT TO SEARCH INSIDE STRINGS
(YES OR NO)? YES
DO YOU WANT TO SEARCH STRINGS O~LY
(YES OR NO)? NO
THE
ITEM
1 CAT
IS FOUND IN THE FOllOWING
L1"~S:
PPI~T
NONE.
20:56
MICRO --
The 8502 Journal
January, 1980
Fig. 4:
63030
PRINT "I'/) YOU WANT TO ~FAR
CH INSIDE STRINGS": INPUT "(
YES OR NO)? ";YY~: PPINT "DO
YOU WANT TO $EA~CH STRINGS
ONLy lI : I~PllT "(YF.S OR NO)? "
i YZS: IF YB = "YES" THEN SO
• l:YY$ • "NO"
630~0
FOR I • 0 TO 255
63050 SEEK(I) .. PEEK (START + 4 +
CHANGE Demonstration
) RU~I 63000
1 nOG
2 f)GS
VERIFY IF THE
Pl~ASF
rn~PUT~o
TH I S AS YflU I NTr:NnEn. N' Ym'
TAK~~
'4A~IT
Tn cnNTINUE (YFS nR NO)? YES
no ynu WANT Tn ~FAnrH I~SlnF ~TPIN~~
(Y~S n[\ Nn)? NO
Of) ynu WA~'T Tn ~PPCH c;nlMr,~ MllY
(YFS nR WI)? '!I)
I)
63060
THE ITFM
1 D0C
IS FI)UNn 1M THE
Fl)lln~'II"G
40
50
<:)0
70
no YOli 1'/MlT
T'"!ES~
! !'IEe;
t1"'ES:
LI~Tf'n
(YES Or'?
~l('l)?
YES
THER~ ~Ill RE ~ WAIT AFTEo EArH llNF
U'IT'L YOU HIT !" r:TIIR" Tn CO'IT HillE.
40
,"'PIIT "riVE THr: fI""'Fl~P flr: nor
~
"; res: PP I MT
50
IF
60
PR I'IT : DR "IT "THF P~('lIlAfllr: '.1
IN',ER pi A rAT-rOG F"~HT": PPI'!T
=0
CT~
~~"
"WITH ";nr.s;"
aA<;
=r
nnr.~ ANI"
TH~N
Efln
";CTC:
;" CAT~ "IOIIl" RE"
70
IF (lGS .. 0 THF'1
CAT<;*****": PH'
<:)0
IF
f'lO'
'!T "*****
PM" (1) * eTc; I D~S > .~ THEN
"*****CAT<;*****": FNn
PPI~IT
Fig. 5:
62999
Listing of SEARCH/CHANGE Program
END
53000
DIM SFEK(10n),NT(100),L(10
O):START • 256 * PEEK (104)
+
PEFK (103):~INI • 25~ *
PEEK (106) + PtEK (105)
63010 IF 256 * PfE~ (STAPT + 3)
+ PF.E~ (START + 2) < > 1 THEN
PPINT "YOl) MUST ENTER YO"q
SEAPCH ITH1 AS LIN!:": PPH'T
"1 BEFORE YOU RUN 63000.": ENn
63020
J
L1C)T 0,2: PPINT "PLfASF VE
RIFY IF TI-IE CC'MPUTEl? TAKES":
PRINT "TI-IIS AS YOU INTHJnF['
• DO YOU \-rANT": I NPllT "TO cn
NTINUE (YES OR ..'O)? "iY$: IF
Y$ < > "YES" THEN END
January, 1980
IF SEEK(I) = 0 THEN N • I 1: GOTO 63080
63070 NEXT
63080 M • START + N + F
63090 CH • 0: IF 256 * PF.EK (M +
3) + PE~K (~ + 2) < > 2 THEN
CH .. 1: GOTO 63120
63100 IF N • 0 THEN NT(C) = PEEK
(M + 4): GOTO 63120
63110 FOR I = 0 TO N:NT(I). PEEK
(M + ~ + I): NF.XT
63120 LM • 256 * P~F.K (M + 3) +
PEEK (~ + 2): I F L~ > .. fi2
999 THEN 6318(1
63130 FOR I • ~ + 4 TO ~ + 255: IF
PEEK (I) < > 0 ANn PEEK (
I) < > SEEK(O) AND PE~K (I
) < > 3~ THEN NEXT
63140 IF PEEK (I) • 34 AND YY$ ..
"NOll THEN SO .. SO + 1: I F SO
• 2 THEN SO • 0
63150 IF PEEK (I) • SEEK(O) ANI'
SO < > 1 THEN GOSUB 63300
63160 IF PEEK (I) • 0 THEN ~ ..
I + 1: COTO 63120
63170 NEXT
63180 HOME: PRINT: PRINT: PRINT
liTHE ITFM": PRINT" ";: LIST
1: PR INT "I S F('ltJ~1D I N THE ~O
LLOWING LINES:": PRINT: IF
L(1) • 0 THEN
PRINT II
NONE-": EN"
631QO FOR I .. 1 TO K: PRINT L(I)
,: NEXT : PR INT
63200 PRINT: 1~'PtlT" [In YOU W'I1Il
T THESE LINES LISTEO (YES OR
NO)? ";V~: IF Y$ .. "NO" THEN
END
63210 PRINT: PRINT IITHERE \'JILL
BE A W~ IT AFTER EACH II NE": PR I ~IT
"UNTIL YOU HIT RETURN Tn rON
TINUE.": PRINT
63220 FOR I .. 1 TO 1000:W .. FINI
- 2 - I: I F PEEK (W) .. 188
THEN 63240
63230 NEXT
63240 FOR I .. 1 TO K: IF L( I) •
L( I - 1) THEN 63290
63250 LS • 110000" + STR~ (L( I»:
L$· RIGHTS (L$,5)
63260 FOR J • 1 TO 5: POKF W + J
MICRO -- The 6502 Journal
20:57
,48 + VAL ( Mln$ (l$,J,l»:
NEXT
63270 LIST 12345: INPUT IIII;Y$
63280 IF K < 2 THEN ENn
63290 NEXT
END
63300 IF N • 0 THEN K • K + l:l(
K) • lM: IF CH • 0 THEN PflKE
I,NT(O): RETURN
63310 IF N • 0 THEN RETURN
63320 FOR J • 1 TO N: IF PEEK (
I + J) < ) SEEK(J) THEN RETURN
63330
BACLAN would like to know if you
WANT TO PROCESS DATA
ON YOUR APPLE?
•
NEXT
63340 K • ~ + l:L(K) • L~
63350 IF CH < ) 0 T~EN RETURN
63360
FOR J • 0 TO
, NT( J): N EXT
63370 RETURN
~:
POKf I
if so you should be looking for
efficient tools to assist with data
entry, (i.e. building files) and file
handling (i.e. scanning, sorting,
printing and copying files).
and
+ J
•
if you are also looking for economy,
we think you will be pleasantly
surprised by the low price of the
BACLAN FILE HELPER
available at your Apple Computer Dealer
in both Applesoft and Integer Basic versions
Apple-Doc
By Roger Wagner
An Aid to the Development
and Documentation of Applesoft Program.
t!Sl BACLAN
(301) 997-9610
MIGHTY BYTE IS HERE
PROGRAM-APPLE II
This 3 program set is a must to anyone writing or using programs
in Applesoft! It not only provides valuable info. on each of your
programs, but allows you to change any element throughout the
listing almost as easily as you would change a single line!!
With Apple·Doc you can produce a list of every variable in your
program and the lines each is used on, each line called by a GOTO,
GOSUB, etc., in fact, every occurance of almost anything!
You can rename variables, change constants and referenced line
II's, or do local or global replacement editing on your listing.
In fact, we guarantee that after purchase, if you don't feel
APPLE· DOC is one of the most valuable programs in your library
we will even refund your money! (Upon return 0/ product.)
Unheard of? Yes! But that's how good APPLE·DOC really is!
That's not all!! Send lor free info. or visit your nearest Apple
dealer.
Only $19.95
P1eaae .pecify diskette or tape.
(Calif. raident. add 6% Salee Tax)
PO B d
Columbia, MD. 21045
Bowling League Secretary
Lisa Interactive Assembler
Master Catalog
Apple Pie 'Ver 1.0
Dr. Memory
Disk Magic
Format 'Ver 1.0
3-0 Animation
Super Dungeon
U-Draw
U-Draw II
Three Mile Island
Escape
Tank War
Phasor Zap
3-D Ducking
Strata Laser
Depth Charge
Super Othello
Canter Downs
Super Star Wars
Many many more programs
(Req
(Req
(Req
(Req
(Req
(Req
48K &
32K &
32K &
32K &
32K &
Disk)
Disk)
Disk)
Disk)
Disk)
Disk)
(Req 48K & Disk)
(Req 32K)
(Req 48K)
COMPANY
MFG
LIST
Mighty Byte
Programma Int.
Programma Int.
Programma Int.
Muse Co.
Programma Int.
Programma Int.
Programma Int.
Programma Int.
Muse Co.
Muse Co.
Muse Co.
Muse Co.
Muse Co.
Programma Int.
Programma Int.
Programma Int.
Programma Int.
Programma Int.
Programma Int.
Programma Int.
24.95
34.95
29.95
24.95
49.95
24.95
24.95
24.95
24.95
17,95
39.95
39.95
12.95
12.95
15.95
15.95
15.95
15.95
15.95
15.95
15.95
available.
Hardwara Section
Centronics 730 Printer
Heuristics H200 Speechllnk
Comprlnt 912 Printer (Parallel)
Comprlnt912 Prlnter/Serlall
Heath WH-14 Printer
995.00
259.00
660.00
695.00
895.00
Available from your local computer store or:
Vinyl loose-leaf Diskette Pages (Pack of 10)
Southwe.tem Data Sy.tema
P.O. Box 582·M
Santee, CA 92071
(714) 562·3670
(Dealer inquiries invited)
Viae & Mastercharge accepted
To Introduce you to MIGHTY BYTE take
~
8.50
@)'I. off any order.
MIGHTY BYTE COMPUTER INC.
P.O. Box 213
HO-HO·KUS, N.J. 07423
(201)445-8258
SYM·1 Staged Loading
Technique for Segmented
Programs
The gYM cassette tape 1/0 can not load continuously
from 0000 on. The end of page zero and the end of page
one can not be directly loaded. A program and technique
are presented which simply get around this situation.
The basic SYM-1 comes equipped
with IK of user RAM, most of which can
be used for program material. This RAM,
however, because of usage by the
system monitor, is not contained in a
continuous block.
To store the complete program on
tape, we must store the segments independently, since that is the only way
we can properly retrieve them. Just as an
example, let's say that the first segment
has an 10 byte of "02", covering
OOOO-OOfF, the second segment an 10
byte of "03" (0100-01CF) and third an ID
of "04", (extending from 0200 to the end
of the program).
This program would load a program
with an ID equal to "01". Because we did
a jump to the tape load routine rather
than a "JSR", an interesting thing happens. When the tape load routine is done
it executes an "RTS", a return from
subroutine. This causes the last two
bytes pushed onto the stack to be pulled
back off and loaded into the program
counter.
Likewise the SYM manual indicates
that the page zero locations from OOFO
to OOFF are used occasionally by the
monitor program.
Then to reload the program from
tape, we must issue three sets of commands, specifically: Load 02 (CR), Load
03 (CR), Load 04 (CR). We must wait for
the tape load in between entries. Then
we must issue the command which
starts the program. If the start location
is 0200, we must enter: Go 200 (CR).
Using the SYM tape dump routines,
we are able to dump a continuous block
0000 to 03FF to the tape but it is not
possible to reload this block in the same
manner because of the monitor usage of
the areas specified above.
It would be much simpler if we were
able to enter all of the commands at
once and have the machine load all the
segments in the right places and then to
auto-jump to the start of the program on
completion of the load.
Therefore when we complete the
load of program "01", we will execute a
jump to location 0200 because this is the
two byte address we pushed onto the
stack before the tape load routine was
ordered. Program "01" is, in this case, intended to be loaded into loctions
0200-0210 and is shown in Figure Two,
described below.
In order to make as full use of the
memory space as possible then, we
must segmentthe programs, storing one
segment in the area from 0000 to OOfF,
another from 0100 to 01CF and the third
from 0200 to 03FF (or higher if additional
memory is installed).
Well there is an easy way to set this
up with the SYM-1. A 16-byte program
entered by the user into any 16 consecutive locations will act as the initial
loader program. This is shown in Figure
One.
Specifically, the area from roughly
01 D1 to 01 FF is used as a stack area.
Any data or return addresses pushed onto the stack during program (or monitor
routine) execution will erase and replace
any program material which one might
attempt to store in these locations.
)
Robert A. Peck
P.O. Box 2231
Sunnyvale, CA 94087
January, 1980
MICRO -- The 6502 Journal
This program will load the segment
"02" into locations O-CI, then "03" into
locations 100-1C1, and finally segment
"04" into locations 0200-03FF. Note that
program segment "04" writes over the
area where program "01" was loaded.
However, since we were under control of
the monitor program at the time, it did
not matter at all. Besides this, once the
third segment is fully loaded, we no
longer need the loader program in
memory.
20:59
After the load, we execute the RTS
in the tape loader routine. Since we did
not jump to it as a subroutine for the
load of the last segment, all it does is to
pull 0200 off the stack and uses this as
the location of the next instruction to execute.
Therefore by loading those initial 16
bytes in the first program described, we
cause the machine to load program 1
which began automatically to load in
turn programs 2, 3, and 4. Then it began
the execution of our loaded segmented
program at location 0200.
The only cautionary note in using
this type of sequenced loading is to be
certain that the load control segment is
located in the area of memory which is
overlayed last by the final program segment to be loaded (04 in this case).
Otherwise you will erase the loader
before the entire group of segments is
brought in.
The 16-byte setup program you will
note is fully relocatable, and could eventually be linked as a part of your monitor
routines. However to make it more
general in that case, the instructions
now specified at 0208 could be, for example, A5 EE, or reference any other
zero page location so that the 10 byte
could be preloaded there by the user and
retrieved by this routine for use later.
This also assumes that the user has
committed this routine to ROM.
This sequenced loading technique
has other uses as well, but that is
another subject and may be the subject
of a future article.
Figure 1:
The Bootstrap Program
(Load and start Segment Loader)
0200
0203
0205
0206
0208
0209
0208
0200
20
A9
48
A9
48
AO
A9
4C
86
00
88
02
00
01
78 8e
JSR
LDA
PHA
LDA
PHA
LDY
LOA
JMP
ACCESS
#$00
,11$02
1$ 00
.1ISOl
LOADT
;UNPROTECT SYSTEM RAM
:STACK LO BYTE OF
;PROGRAM 01 START ADDR.
,STACK HI BYTE OF
; PROGRA ~ 01 START ADOR.
:T APE MODE ( 80 IF HI spo.
:PROGRAM 10 SE ARCHED
:LDAD PHDGRAM 01.
)
Figure 2: The Segment Loader Program:
Loads segments 02, 03. ]4 then starts execution at location 0200.
0200
0203
0205
0206
0208
0209
0208
020D
0210
0212
0214
0217
0219
021B
20
A9
48
A9
48
AO
A9
20
AD
A9
20
AO
A9
4C
~6
fB
00
02
00
02
78 EC
00
03
78 BC
00
04
78 8e
JSR
LDA
PHA
LDA
PHA
LDY
LOA
JSR
LOY
LOA
JSR
LOY
LOA
JMP
ACCESS
#$00
#$02
#$00
#S02
LOADT
#$ 00
#$03
LOADT
#SOO
#$04
LOADT
; UtoolPROTECT SYS TEM R.AM
;STACK LO BYTE OF PRCGRJlM
;START ADDRESS
;STACK t..n BYTE OF PRCGRJM
;S TART ADDRESS
;KIM MODE: (80 FOR HI SPC. J
;PROGRA1lI 10 02
:JSR TO TAPE LOAD SUEROUT I NE
,TAPE MCDE
;IO 03
; JSR TO TAPE LOAD
;T APE MODE
aD 04
:T APE L CAD *JUMP * t BEG INS
; PROGRA~ AT 0200 'III HEN LOAD DONE.
r
Missing MICRO Information?
'"'"
MICRO is devoted exclusively to the 6502. In addition, it is aimed at useful, reference type material,
not just "fun and games". Each month MICRO
publishes application notes, hardware and software tutorials, a continuing bibliography, software catalog, and so forth. Since MICRO contains
lots of reference material and many useful programs, most readers want to get the entire collection of MICRO. MICRO grew very rapidly, and it
very quickly became impracticle to reprint back
issues for new subscribers. In order to make the
older material available, two collections ot
reprints have been published.
The BEST of MICRO Volume 1 contains all of the
significant material from the first six issues of
MICRO, covering October/November 1977 through
August/September 1978. This book. form is 176
pages long, plus five removeable reference cards.
The material is organized by microcomputer and
almost every article is included. Only the ads have
$7.00
been omitted.
Surface
Air Mail
$10.00
A limited number of back issues are still available
for number 7 through current.
Use the convenient Order Form on Page 23 to
place your order.
The BEST of MICRO Volume 2 covers the second
six issues, from October/November 1978 through
May 1979. Organized by microcomputer, this
volume is 224 pages.
Surface
$9.00
Air Mail
$13.00
6502 Bibliography: Part XVI
514. Call -
Apple 2, No.5 (June 1979)
Kotinoff, Jeff, "LaRES Color Picture", pg. 19
Two color programs for the Apple Il.
Garson, Dave, "Programmer's Aid Notes", pg. 19
How to use the XDRAW command omitted from the programmer's aid ROM. Two other DEMO progrms using the
PA ROM of the Apple.
Golding, Val J., "Book Review", pg. 20
"The Apple II Monitor Peeled" is a very good book by
William E. Dougherty, 46 pp $9.95 available from the
author at 14349 San Jose St., Los Angeles, CA 91345
Aldrich, Darrell, "Scrunch", pg. 21
Discussion and listing of Neil
SCRUNCH
Konzen's
program
Aldrich, Darrell, "Zero Page Usage by Monitor", pg. 27
A list for Apple Users.
Lewellen, Tom K., "Integral Data/Parallel Card Fix", pg. 28
Modification of the card solved the problems on the Apple.
Paymar, Dan, "Prime Factors", pg. 28
A program is listed to compute the prime factors of a
given number on the Apple.
Aldrich, Darrell, "The Apple Doctor", pg. 30
All about the ASCII character set on the Apple.
Smith, Ken, "HEXIDEC Conversion Program", pg. 30
Convenient Utility Program.
Ray, R.E., "Fireworks", pg. 31
Two graphics programs.
Garson, David B., "MOD Function", pg.31
A routine to simulate the "MOD" function in Integer
Basic.
515. Contact No.5 (June, 1979)
Anon, "Out of the Mist", pgs. 4-6
Subroutine calls for the Apple, Peeks and Pokes
Anon, "Color Killer Mod for Early Apples", pg. 6
How to modify Apples with serial numbers below 6000.
Anon, "Shifting Programs from Integer to Applesoft", pg. 6
Routine to automatically shift programs.
516. Interface Age 4, Issue 4 (April 1979)
Nabers, Steve, "6502 Comprehensive Memory Test
Program",pgs.140-145.
Memory diagnositc set-up for 6502 and implemented on
KIM-1.
January, 1980
518. The Target, (Jan/Feb 1979)
Anon, "Binary Indication of the Status Register," pg. 2.
A program for the AIM to print labels for each bit and
display the bit in binary.
Anon, "Bits and Pieces," pg. 3.
Gives info on loading sync characters trom tape and lists
seven subroutines not included on the AIM Summary
Card.
Anon, "A Program Idea - Soft Memory Expansion," pg. 3
How to get better utilization of your AIM memory.
Golding, Val J., "Constructing a Menu", pgs. 25-26
Details of how to put a menu in your program.
)
517. The Computing Teacher 6 No.4 (May 1979)
Harder, Monty J., "Bargraph-A Program for the PET
Microcomputer," pgs. 45-46.
A simple program for bargraphs - written for ease of
adaptation into other programs.
Anon, "A Pseudo Waveform," pg. 5
An AIM program to generate a pseudo waveform.
Anon, "Some of the Printer and Display Routines
Explained," pg. 4.
This article supplements the AIM manual in explaining
routines.
Anon, "Disassembly to the User VIA," pg. 5
The program for the AIM gives a quick indication of programs in memory.
519. The Target (May/June 1979)
Anon, "Symbol Generator," pg. 2.
A symbol generator for the AIM which produces symbols
which are user definable.
Anon, "Enhanced Disassembly to the User VIA," pg. 4.
An extension of the program published earlier. For the
Aim.
Anon, "Sound Generators," pg. 5.
A description of several sound generators for the AI M.
Riley, Ron, "BAP.", pg. 6.
Expand the input/output for the AIM.
Anon, "Poor or Lazy Man's RegUlator," P(J. 6.
A simple regulator for the AIM.
Riley, Ron, "AIM 65 Physical Connections," pg. 7.
Connections for the Display and Printer.
520. Interface Age 4, No.7 (July 1979)
Kirschenbaum, Jack, "Need a System Cabinet? Build it!"
Build a cabinet to transport your Apple microcomputer.
521. The Target (Mar/Apr 1979)
Anon, "AIM 65 Poster," pg. 2_
A program to print a large poster with the AIM.
MICRO -- The 6502 Journal
20:61
Anon, "Software Design-Slow Step," pg. 4
Development of a program for slow stepping the AIM.
Roland, Don, "AIM 65 Monitor Subroutines," pg. 9.
A numerical listing of the subroutines.
Riley, R.J., "Regulator Circuits," pg. 9.
Several useful regulators are described.
Fisher, Ted. "Checkmate in Five," pg. 5
Amaze your friends! Beat Peter Jenning's Microchess 1.5
in five moves!
Lindsay, Len, "How to Fool Around With Your PET,"pg.
24-26.
A bouncing ball program with tutorial value.
Anon, "Using Existing Software," pg. 10-11.
Adapting KIM and other software for the AIM.
Anon, "Lunar Landing Patch," pg. 11.
Modification of this popular program for the AIM 65.
522. Byte 4, No.7 (July 1979)
Smith, Stephen B., "Graphic Input of Weather Data",
pg.16-30
Uses an OSI computer and a BIT Pad.
Bishop, Robert J., "Apple Kaleidoscope," pgs. 52-53.
A fast moving color display for the Apple.
523, Creative Computing 5, No.7 (July 1979)
Chatterjee, Rabin, "Picking at 'Peeking and Poking'," pg. 12
Corrections for a previous article (February 1979)
Petry, Jerry, "Memory Transplants Updated,"pg.10
Comments on memory for the PET and TRS-80.
Friedman, SI, "Diagnostic Program for Your PET...from
Com-modore," pg. 32·33.
Discussion of the use of several diagnostic routines.
Kuska, Henry A., "Educational Use of the OSI 1P," pg. 40
Discusses use of a tutor program.
Milewski, Richard A., "Apple Cart," pg. 116-117.
3-D Graphics on the Apple.
Yob, Gregory, "Personal Electronic Transactions," pg.
118-122.
Discusses floating point routines and screen gymnastics.
524. Abacus Newsletter 1 Issue 6 (June 1979)
Anon, "Disc Space Summary," pg. 2
Program for showing sectors available. For the Apple.
Anon, "Strings and Things," pg. 3.
A routine to concatenate the file name on the end of the
file commands, a routine to find what the first and last
records of the file are, etc. For Apple.
Anon, "Create Exec Files, It's Easy... ", pg. 5.
Program with two examples to help. For Apple.
Saal, Harry, "SPOT-The Society of PET Owners and
Trainers," pg. 54-55.
New Commodore products for the PET, BASIC Programmer's Toolkit, some common basic programs (on tape).
526. Apple Peelings 1, No.1 (July 1979)
Anon, "Disk of the Month, July, 1979," pg. 3
The July DOM includes B/BSTAT a version of 81NADR
which works with either 3.1 or 3.2 DOS. Apple Peelings is a
new newsletter from the Apple Core of San Francisco and
will alternate on every other month with the CIDER
PRESS.
527. Kilobaud Microcomputing No. 32 (August 1979).
Lindsay, Len, "PET Pourri," pg. 6-7,12.
New PET ROMs are not compatible with the old ROMs.
Discussion of Skyles new PAL printer, the programmable
character generator, automatic line numberer program,
etc.
Ascolillo, Carol and Schwartz, Nancy, "Cover Up," pg. 26-37.
Home decoration software for the PET.
Brown, A.W., "Apple Ciphers," pg. 90-92
The role of the Apple in the development of a medicaloffice package.
Lloyd, Kenny, "Taking AIM," pg. 102-104.
Discussion of the Rockwell International 6502·based AIM
65.
Hayek Tom, "PET Wrap-up," pg. 110-11:2.
Haul out the wire-wrap tool and relieve the memory
crunch in your PET.
Badgett, J. Tom, "Visit to OSI," pg. 118·123.
All you ever wanted to know about OSI.
528. MICRO No. 14, July 1979.
Carlson, Lt. Robert, USN, "A Baudot Teletype Driver for the
Apple,", pg. 5.
Use an expensive Baudot teletype with your Apple.
Abrahamson, Robert, "Structured BASIC Editor and PreProcessor," pg. 7-14.
A versatile preprocessor for the OSI Challenger, makes it
possible to enter, list, modify and resequence BASIC programs.
Anon, "X·Y Plotter," pg. 6.
Apple program to plot curves.
Anon, Password Program," pg. 7.
How to secure your Apple programs.
Anon, "N<;>w You Can Have Lower Case Characters Too," pg.
7
Short program for lower case.
McCann, Michael J., "How About a (Basic) Disassembler,"
pg.8-9.
This program will literally take apart a BASIC program and
convert it to machine language. For PET or APPLE II.
Wilkerson, David, "Lower-Caseing It On The Apple II," pg.
10-11.
Lower case with Integer Basic.
Bishop, Robert J., "Apple Speaks...Softly," pg. 12·13.
An inexpensive talking Apple II.
Crossman, Craig, "The Micromodem II," pg. 14.
All about this interesting Modem and the special features
it provides for the Apple.
Wine, Hal, "Applesoft Stop-List," pg. 15-16.
A short machine language program convenient to use.
20:62
525. Recreational Computing 8, No. 1,lss.40 (July/Aug 1979)
Hertzfeld, Andy, "Intercepting DOS Errors from Integer
BASIC," pg. 17-18.
Integer Basic programs can trap errors from DOS,
diagnose problems, and take remedial action with no intervention from the operator.
Evans, Melville and Larrowe, Vernon, "AIM Your Spouse
Toward Success at the Supermarket," pg. 19-20.
A grocery list generator. For the AIM.
Christensen, Alan K., "Boolean Equations Reduced on the
PET," pg.23-26.
This Basic program trains the PET to perform computeraided logic design.
Mottola, R. M., "Screen Dump to Printer for the APPLE II,"
pg.27-28.
With this program, print a screen full of information on
your printer after you have reviewed it on the screen.
Taylor, William L., "OSI Memory Test in Basic," pg. 29.
Find that hidden bug in the many K's of Ram.
MICRO -- The 6502 Journal
January, 1980
STANDARD FEATURES
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
single key cursor control
automatic word overflow
character, word and line insertion
forward and backward scrolling
automatic on screen tabbing
single key for entering "the"
auto paragraph indentation
character, word and line deletion
ditto key
multiple text windows
block copy, save and delete
advanced file handling
global (multi-file) search and replace
on screen math and column totals
column decimal alignment
chapter relative page numbering
complete printer tab control
line centering
superscripting and subscripting
two color printing
underscoring and boldface
user defined special functions
The
Professional
Word
Processor
for the Apple II
M US ETU
THE LEADER IN QUALITY SOFTWARE
FAST EDITING
ADVANCED FILE HANDLING
Super-Text was designed by a professional writer
for simple, efficient operation. A full floating
cursor and multiple text screens facilitate editing
one section of text while referencing another.
Super-Text's advanced features actually make it
easier to operate, allowing you to concentrate on
writing rather than remembering complicated
key sequences.
Single key file manipulation and complete block
operations allow the user to quickly piece together
stored paragraphs and phrases. Text files are
listed in a directory with a corresponding index
for fast and accurate text retrieval.
FLOATING POINT CALCULATOR
A built in 15 digit calculator performs on-screen
calculations, column totals and verifies numeric
data in statistical documents.
PRINTER CONTROLS
Super-Text is compatible with any printer that
interfaces with an Apple. Print single or multiple
copies of your text files or link files and they will
be automatically printed in the specified order.
User defined control characters can activate most
special printer functions.
EXCLUSIVE AUTOLINK
MODULAR DESIGI\I
Easily link an unlimited number of on-line files
on one disk or from disk to disk. Autolink allows
you to search or print all on-line files with a single
command. Typical files of items that can be stored
in this way include personnel files, prospect files,
maintenance records, training records and
medical histories.
This is a modularly designed system with the
flexibility for meeting your future word processing
needs. The first add-on module will be a form
letter generator for matching mailing lists with
Super-Text form letters. The form letter module
will be available in the first quarter of 1980.
SUPER-TEXT, requires 48K ($99.95)
Available TODAY at Computer Stores
nationwide. Dealer inquiries welcome. For more
information write:
/
MUSE SOFTWARE
330 N. Charles Street. Baltimore, MD 21201
(301) 659-7212
HIGH RESOLUTION GRAPHICS
LOOK TO MTU. WE SUPPORT HIGH RESOLUTION GRAPHICS ON:
PET - AIM - KIM - SYM
Micro Technology'Untimlted
p.o.
Box 4596, 841 Galaxy Way
Manchester, N.H. 03108
603-627-1464
Gall Or Write For Our Full Line Catalog
~
t
t
t
••••••••••••••••••••••••••••••••••••••*
NOW PRESENTING. · ·
Apple® software
...
~
f(J.r your Entertainment" Business" Education :
~*••••••••••••••••••••••••••••••••••••••
*
SIll' AII'IId/tllls:
FILEMASTER 2 programs: FORMAT&RETRIEVAL comprise
a powerful data file manager. Great for everything from phone lists
to legal abstracts. Needs 32K. Design your own data structure. Up
to 500 characters per record. Up to 15 searchable fields in any combination. On Disk. " ..........••..•.•...... $34.95
SPACE MUlti-faceted simulation of life in interstellar society. You
and opponents must make life & death decisions. I(eeps track of
your progress from one game to next. Needs 48K and Applesoft
ROM. Disk ............•...•..•...•..•. $29.95
Pot O'Gold I or our All N'ew Pot O' Gold II A collection of 49 programs for 16K Apple. Everything from Logic to action games. Only
a buck a game. Specify I or II. Price each: Tape $49 .... Disk $54
ADVENTURE Fight off pirates and vicious dwarfs. 700 travel options, 140 locations, 64 objects. Needs ROM & 48K. Disk•. $29.95
16K CASSETTE INVENTORY Use item number, description,
stock amount, reorder amou nt, restock date, cost & sell price. Holds
up to 140 items. Tape ......•...•.•...•.•..... $35
32K DISK INVENTORY: Use stock numbers description, vendor,
record of purchase and sales date, amount on hand, cost & sell price,
total value. Holds up to 300 items. Disk •.. , .•.•...... $40
With Parts Explosion: Disk ....•••.•....•••..... $50
32K DATA BASE Cross file for phone lists, bibliographies, recipes.
Run up to 9 lines of 40 columns each. Search by item anywhere.
Disk. . . . . . . . . . . . . • . . . • . . . . . . . • . . . . . . . . . $20
24K HI-RES L!IFE SIMULATION Conway's equations on 296x180
screen. A mathematical simulation to demo population growth with
birth, death and survival as factors. Tape .•..•........ $10
16K CIRCUIT LOGIC DEVELOPMENT AID Evaluate circuits of
up to 255 gates, including AND, OR, NOR, NAND, XOR, XNOR
and INVE RTER. Tape . . . . . . • . . . . . . • . . . . . . . . . . $10
16K MORSE CODe TRAINER Learn Morse Code, and transmit or
receive over radio. Tape . . . . . . . . . . . . . . • . . . . . . • . $10
16K DEVIL'S DUNGEON: Adventure through dark passages where
monsters, demons, poisonous gas, dropoffs threaten ... all to discover fantastic treasures. Comes with instruction book. Tape ... $10
16K PACIFICA: Discover the floating island and rescue the beautiful princess. To win you must recover the enchanted crown, but you
face the threat of magic spells and demons. Tape
$9.95
RAINBOW'S CASINO 9 gambling games: Roulette, Blackjack,
,Craps, Horserace, and a few originals that Vegas hasn't heard about.
Needs 16K. Tape. . . . . . . . . . . . . . . . . . . . . . . . . $29.95
16K SPACE WAR: You in your space capsule battle against the
computer's saucer
in hi-res graphics. Tape
$12
16K MEMORY VERIFY Diagnostic routine to check range of memory. Indicates faulty addresses, data in memory cell, and faulty data.
Tape,
,,
,
, •.......... $5
16K APPLEODION Music synthesis composes original Irish jigs.
Enter your own music and save on tape or disk. Includes 3 Bach
fugues. Tape • • . . . . . . . . . . . . . . . . . . . . . . . . . . . . $10
16K APPLEVISION Demo for Hi-Res graphics and music.
Tape .•••..•.••........................ $10
32K COMPU-READ 5 programs to teach you speed reading, in
stages. Includes synonym and antonym identification. You control
your rate of speed, or keep up with the computer's pace.
Disk•...••... , . . . . . . . . . . . . . . . . . . . . . . . $24.95
48K PERCEPTION I, II, III random shapes and sizes must be
matched. In III, you control format and display time and get
weighted scores. Needs ROM. Each Disk.... , .. , .... $24.95
32K STO RY TEL LER Use your bizarre imagination and input key
words for fantastic and funny tales. Never the same story twice.
Tape
,.,
, . . . . . . . . . . . . . . . . . $12.95
32K WAR/RESCUE Engage in 10 battles with your infantry against
the Apple robots. Calculate Apple's strategy and win more battles
than the computer. Tape. . . . . . . • . . . • . . . . . . . . . $12.95
24K POLAR PLOT Plot polar equations in Hi-Res Graphics.
Tape . . . . • . . . . . . . . . . . . . . . . . . . ,
$10
32K SHAPE SCALER Utility to generate and animate Hi-Res
graphic shapes. Simple routine provided to inspect position of
shapes, and specify precise XIV coordinates and scale. Needs ROM.
Disk.•....•...•••.................... $13.95
32K ZINTAR/PR OPH ET Great party game. Under control ofthe
mighty Zintar's edict you take a very special trip to the world of
Krintar. Heightened visual graphics. Needs ROM.Disk .... $16.95
APPLE MONITO R PEELED Everything you wanted to know about
the Apple Monitor but couldn't figure out. User-written manual in
plain English clears your confusion. Only
$9.95
Don't see what you've been looking for, here?
Then write for our FREE SOFTWARE CATALOG.
We're saving one just for you!
}
To order, add $2 shipping. California residents add 6%
sales tax. Sorry, we can not ship to P.O. Boxes. VISA/
MASTERCHARGE and BANKAMERICARD Welcomed!
•
Garden Plaza Shopping Center, Dept. 11 A
9719 Reseda Blvd., Northridge, Ca 91324
Telephone: (213) 349-5560
E
BLITZKRIEG
0I0u[nEiE~
,
,
Z9
©J
@J
J]J
'",
,." "" ,.I' z,"" ".. ""
" " "
"
Ii ~~ llil :: ¥ A~:~C; ;vJGvD....
,
$ 9.95
FRUSTHATION
198.
IV..
6
$1595
19]
J]J
"
"
"
~s;t:~'tl~no~I~~,'''D>
r lOl.lftt. tl~"''''AIl rNI£HU"~l!Il'" 11\1' flrrf; - TCJ~j:l2
_... ------ ..
-----_
._-------_
---------_
...
----------..
_-----.._.---------_----------------------._----------...
_---------------------
SQU
H~
S C U[
1DU E
,
OU:
~
~
~
~
UJ
WOHDWACKEY
HI-SCORE-
0
SCORE-
$
695
40
...........
---.. _--_ _--..
•
"'"'~!.-rtt~~!JIIIlt!Jllllt'!/JlitWflW
...........................................
...
...... ... ...
APPLE INVADER
$1595
.,1]
o
PROGRAMMA
INTERNATIONAL, Inc.
3400 Wilshire Blvd.
BOXING
S 9.95
Co
c:
Angeles. CA 90010
n
384·0579
384-1116
3841117
Dealer Inquiries Invited
.,m
1]
.,o
.,m
3
Apple II is a trademark of Apple Computers, Inc.
(2131
"m~
U]
All orders must include 3% postage and handling with a minimum of $1.00. California residents include 6% sales tax.
VISA
MASTERCHARGE
LOS
o
~
rt
III
STAR VOYAGER
S15.95