# 198305 Byte Magazine Vol 08-05 The Electronic Office — source transcripts, page 2

[Canonical transcript page](https://www.vintageapple.net/transcripts/media/va-198305-byte-magazine-vol-08-05-the-electronic-office-4e01b2/2)

## Transcribed source material

Machine transcriptions and image descriptions; uncertain copy may be marked [illegible]. Verify against the linked originals. Historical rights remain with the original owners.

These are transcribed excerpts, not the full publications. Open the originals for remaining pages.

### PDF page 12

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-198305-byte-magazine-vol-08-05-the-electronic-office-4e01b2/2#scan-ed07547fa1cfb449f1c41771cbd9a14e151a6ef7270bb06894b9b1e90f47c9bc)

Transcribed text:

Letters------------------------------------------------------------------
"'   OURllF'R tME N
[ 1J   P ~N pB ~l   •   N S ~L e   . 5 •N   e.5
[ 2]   Li   . 4(NS   C   B~B   <DtP 1• 1 ) fl 2
l ' l   f'   • · P~   Bp1 ),fHN1r•· <-   J;1 H   1 ¢•Li
•1.1   L2   p   ~ P/\N
9
When we set ou r function loose on the
first 8191   integers   it   req uired   aro und 57
milliseconds to   find   all   primes (approx
imating the time required for the first   0
iterations would thu   be   57   X 10   +   57   =
22 milliseconds) . Artificially stopping our
solu tion at 10 iterations (ra ther than let
ting it stop al the square root of N ,   I.he
largest integer) produced processor times
around   30   milliseconds .
Our solution reduces the execution time
by :
"l .   working primarily with a bit siring,
N   bits long, rather than the entire list
of N integers. This reduces both the
execution   time and   the memory re
quirement   (note:   we   were   able   to
sea rch the list of primes up to 792353
in only 300,000 bytes of work space ,
including space taken up by the pro
gram ).
2 .   working   with   more   efficient   and
fewer   bit-string   ge nerators   a nd
primitives, and
3.   taking the square root   of   th e ending
integer (used   to   test end   of   iteration)
only once before the loop rather than
taking   the   square   of   ~ach   newly
found integer.
We hope that   we.   have saved the name.
of APL by showing that akhough it is an
interpretive language. (and our processor
rime   represents   both   interpretation   and
execution   time),   it   can   produce   a   fast ,
memory-efficient , and succinct solution.
One addi ional benefit is the flexibility of
this   solution -   without   modificalion   (or
recompiling, linking, or loading)   it   may be
used to locate primes in variable lists of in
tegers from 1 to N where N   :S 792353.
MkhaeJ C. Rowe , Ph.D .
Donald   f .   Stoneburner, Ph.D.
The Upjohn Company
7000   Portage Rd.
K.alamal.00   1  Ml 49001
You   might   like   to add   the   following
data   to   your   prime-number   benchmark
data ba e (see   the September 1981 BYTE,
page 180. and   the January   1983 BYTE.
page 283). l ran the Sieve   of   Eratosthenes
program on the Apple ll in Micromotion
10   111av   J9BJ It) BYTE   Publlc>~om   In ~
FORTH (200 seco nds) and Manx C   tai
lored for Apple DOS (400 seconds). O n a
Data General MV / 8000, using FORTRAN
77, l got a benchmark time of 2.2 seconds .
The Manx version of C that l used em
ploys a p-code interpreter .
John Figueras
65   Steele   Rd .
Victor,   NY 14564
BCD Conversion
Better   by   a Bit
I am a programmer specializing (for the
moment)   in   Apples and working mostly in
assembly   language,   and   I   find   the
machine-code program examples in your
magazine a   fascinati ng so urce   of enter
tainment . I always look forward   to   the
chance   to   analyze   them.   However.   I
found a few irregularities in listing 1 of Pat
Coghlan   and   Geo rge   White's   "Another
Binary   to   BCD   Conversion   Routine"
(January   1983   BYTE ,   page   387).   Un less
the user has some code located at   hex
adecimal   1003,   line   1440   (JMP   $1003)
should be ch anged.
The use of indirect indexed addressing
would have eliminated   the need for   the
use of   location   hexadecimal   56   in   lines
1740 and 1750, Une 1750 cou ld have been
replaced   with   ADC   (BCD), Y   and   line
1740   could   have   been   eliminated.   This
wou ld also save two clock cycles per itera
tion . Also , the comments in lines 2040 and
2050 state that the incoming carry will be
added   to   the entire   BCD   (binary-coded
decimal) field ,
The incoming carry is the most signifi
cant bit from the last state of the binary
fie ld . However, the PBCD rou tine   (li nes
2070 through 2140) deals   with on ly   lhe
least   significant   byte of   the   BCD   field.
Furthermore,   on   the   First   call   to   this
subroutine,   the   BCD   field   is   cleared   to
zeros,   and   for   all   other calls   the   BCD
field has just been added to itself . This
means that the BCD field will be either
lero or an   ven numhf r. a nd in either case
th e least significant bit will be zero .
Becau e the maximum value added to
the BCD field by this routin   is one and
the least significant bit   is   a lways zero, no
carry is ever possible. The BCC (branch
on   carry   clear) following   the   add   will
always   be   taken.   Th is   causes   the   BPL
(branch on sign flag equaJs zero) in   line
2130 to be always bypassed . I have   im
plemented   this   routine with   the indirect
indexed addressing in line 1750 and with
lines   2120   and   2130   deleted ,   and   the
routine still seems to work accurately .
Carl Haddick
Rte. 1, Box 215
Mexia, Tex.as 76667
Apples and Fords
In   the letters column of the February
1983   BYTE   (see page   24 ),   Fred K. Fox
draws an analogy between the Model   T
Ford and the microprocessors   of   today.   I
Found an automotive approach   relevant
to   the   Apple   Ile   and   Lisa   compu ters
reviewed   in   that issue .
Apple's Jobs and Wozniak (like Henry
Ford) detected a huge, untapped market
and produced a general-purpose machine .
With little competi tion. it swept the field.
As   the   public   gol   used   lo   the   new
machine,   however,   people   began   to
develop more   foC\l.sed ideas about what
they   wan ted   rom   it.   Other   makers
brought out models   designed to deliver
specific   packages of   features   to   specific
market segmenls, at prices tailored to the
market.
But   Ford   and   Apple   misread   the
resulting   erosion   of   their   markets as   a
need to incorporate the specific fe atures of
their   competitors   into   their   "universal"
machines. Hence Ford tinkered   with the
Tm Lizzie, an d Apple came up with the
Apple lI Plus and now the Apple Ile. But
still ,   when   most   people   look   at   the
market,   there   a !ways   seems   to   be   a
specialized machine that delivers features
a little better suited   to   their specific needs,
and / or   at   a   little   better   price .   The
machine that sets out to be a jack-of-aJl
trades winds up being the m<ister of none .
Lisa,   on   the   other   hand ,   seems
analogous   to   the Delorean .   Both   were
designed as "machines of lhe future," em
bodying aU sorts of bells and whistles that
technophiles had been daydreaming about
for some   time.   Most   people agree   that
they're   mighty   fine   machines,   with
features that it would sure be nice to have.
Then they look at the price. After   picking
their   jaws   up   off   the   showroom   floor,
they decide that   they can somehow live
another few )'ears without those features,
and go buy some ot.her model .
Erwin S. Strauss
9850 Fairfax Square #232
Fairfax, VA 22031 •
Circle 239   on   Inquiry ca.rd . __,.

Reading notes: Garbled OCR in opening section ("OURllF'R tME N", "P~N pB ~l") makes the first lines unreliable Several words are split or altered by OCR in the body text (e.g., "Micromotion 10 111av J9BJ", "Une 1750", "fC\l.sed"), so exact spelling is uncertain Reading order of the letters is uncertain because multiple unrelated letters are concatenated

Printed product names: Lisa · Model T Ford · Apple DOS · Manx C · FORTRAN 77 · Data General MV/8000 · Micromotion · FORTH · DeLorean · BYTE

Printed dates: September 1981 · January 1983 · February 1983

Languages: English

[Original PDF page 12](https://www.vintageapple.net/files/07eda4dcd701e53f5eb82eecade972cb0d41ef0f703cab6a9370a17414bfe1b6/198305_Byte_Magazine_Vol_08-05_The_Electronic_Office.pdf#page=12)

[Previous transcribed scans](https://www.vintageapple.net/transcripts/media/va-198305-byte-magazine-vol-08-05-the-electronic-office-4e01b2/1.md)
