re-run 1984 07-12

95
Y o u r F a v o r i t e P r o g r a m s f r o m V O L U M E D i s k $ 1 9 . 9 7

Upload: cubemanpdx

Post on 08-Apr-2018

222 views

Category:

Documents


0 download

TRANSCRIPT

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 1/94

Y o u r F a v o r i t e P r o g r a m s f r o m R U

V O L U M E T W D i s k $ 1 9 . 9 7

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 2/94

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 3/94

C - 6 4

" S P R I T E C D 1 "

" S P R I T E C D / D E M O "

" 6 4 F I L T E R "

" 6 4 S Q U E E Z E R "

" 6 4 E X P A N D E R "

" D A T A F I L E "" D F M A I L "

" D F R E P O R T "

" B A T T L E S H I P "

" S L I D E "

" S L I D E M O D "

" M A N O R "" M O N E Y "

" M O N E Y M O D "

" 6 4 T O U C H D O W N "" S P E L L E R "

p a g e

1

1 2

2

3

4

4

4

5 5

V I C - 2 0 p a g e

" 2 0 F I L T E R " "

" 2 0 S Q U E E Z E R " " *

" 2 0 E X P A N D E R " 1

" M U L T I C O L O R " " 5

" S C R E E N R E L O C A T O R 1 " * *

" P O N I E S " 6 " S P A C E " 6

" S P A C E M O D "

" P R E S I D E N T " " * 6

" 2 0 T O U C H D O W N " * * 5

" N I M B O T S " * " 7

" F R I E N D " ' * 7

' M u s t b e l o a d e d w i t h L O A D " S P R I T E C D " , 8 , 1" R e q u i r e 3 e x p a n d e r

' " R e q u i r e a 8 e x p a n d e r

( r e m e m b e r t h e a s t e r i s k s a r n o p a r t o f t h p r o g r a m n a m e )

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 4/94

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 5/94

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 6/94

I n t r o d u c t i o n

T h l o n g - a w a i t e d 2 n e d i t i o no R e R U N i f i n a l l y h e r e . T h r e s p o n s e t t h f i r s t e d i t i o nw a s p o s i t i v e t h a t w a r w o r k i n g o n u m b e r o f s p e c i a lR U p r o j e c t s b e g i n n i n g i 1 9 8 5 . T w r a p u o u f i r s t y e a rw a r p u t t i n g a m a n y o t h b e s t p r o g r a m s w c o u l dp o s s i b l y s q u e e z e o t h 2 n e d i t i o n R e R U N t a p e s a n d i s k e t t e s . G a m e s t a m u s ey o u , u t i l i t y p r o g r a m s t h e l py o g e t h m o s t o u o y o u rC o m m o d o r e c o m p u t e r , a n e d u c a t i o n a l p r o g r a m s f o y o u n ga n o l d . A y o u k n o w , t h e r ew e r e l o o g o o d p r o g r a m s i R U m a g a z i n e f r o m J u l y t D e c e m b e r , a n w t r i e d t t a k et h b e s t o t h l o f o R e R U N ,b u w j u s t c o u l d n ' t f i t h e m a l i n W e e k s w e n t i n t o t h s e l e ct i o n p r o c e s s w i t h v a r i o u s s t a f fm e m b e r s f i g h t i n g f o r t h e i r p e s o n a l f a v o r i t e s . W t h i n k t h a tt h p r o g r a m s s e l e c t e d a r a m o n g t h v e r y b e s t , a n h o p e y o u a g r e e .

F o y o g a m e s t e r s , t h e r e a r j o y s t i c k g e m s s u c h a M o n e yG r u b b e r ( C - 6 4 ) , a n L o s t I S p a c e ( V I C ) . Q u i c k - k e y b o a r d

c o n t e s t s l i k e B a t t l e s h i p W a ( C - 6 4 ) , f a s t - p a c e d b a t t l e o t h s p r i t e l y h i g h s e a s . A n f o a n y o n e w h e v e r w a n t e d t c a l lt h p l a y s b u a v o i d t h b r u i s e s ,t h e r e i T o u c h d o w n ( C - 6 4 a n V I C ) . F o t h t h i n k i n g g a m e rt h e r e a r n u m b e r o a m u s e m e n t s . N i m b o t s ( V I C ) i a a n c i e n t t a k e - a w a y g a m ew i t h s o m e n e t w i s t s . S l i d e( C - 6 4 ) m a b o n o t h t o u g h e s t c h a l l e n g e s y o e v e rs l i p i n t o . H e a d f o t h t r a c k i P l a y i n g t h P o n i e s , a n e n j o yh o r s e r a c i n g a c t i o n w i t h o u t l o i n y o u r s h i r t . T h e n , s o m e w h e r eb e t w e e n j o y s t i c k a c t i o n a n d e d u c t i v e r e a s o n i n g t h e r e i M y s t e r y o L a n e M a n o r , m u l t i -p l a y e r s o l i t a r y d e t e c t i v e g a m ef o e v e r y a m a t e u r s l e u t h i y o u rh o u s e . A n j u s t f o f u w i n c l u d e d A t h e P r e s i d e n t( V I C ) , h u m o r o u s c o n v e r s a t i o nw i t h a i n f a m o u s e x - p r e s i d e n t .

F o t h u t i l i t y - m i n d e d C o m o d o r e u s e r s , w h a v e p r g r a m s t h a t w i l l m a k e y o u rp r o g r a m m i n g l i f e e a s i e r . S p r i t eC o n t r o l ( C - 6 4 ) g i v e s y o f o u rn e B a s i c c o m m a n d s f o m a n i p u l a t i n g s p r i t e s . T h

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 7/94

M a n y - C o l o r e d V I C h e l p s t a k et h f r u s t r a t i o n o u o m u l t i - c o l o rc h a r a c t e r p r o g r a m m i n g . L i s t e rF i l t e r ( C - 6 4 a n V I C ) w i l l l e y o p r i n t o u t h o s e l i s t i n g s ,a u t o m a t i c a l l y t r a n s l a t i n g a l t h o s e g r a p h i c s a n c o n t r o lc h a r a c t e r s i n t o f o r m t h a th u m a n s c a u n d e r s t a n d .

L i n e S q u e e z e r L i n eE x p a n d e r ( C - 6 4 a n V I C ) a r et w o p r o g r a m s f o t h p r i c e o o n e , t s q u e e z e t h o s e l o n g p r g r a m s d o w n t s i z e o r t a k et h o s e s c r u n c h e d p r o g r a m s a n ds p r e a d t h e m o u t . F i n a l l y ,D a t a f i l e ( C - 6 4 ) , f u l l - b l o w nd a t a b a s e , o f f e r s f e a t u r e s f o u n di p r o f e s s i o n a l s o f t w a r e .

N m a t t e r w h a t y o d w i t hy o u r C - 6 4 o V I C - 2 0 , t h e r e i s o m e t h i n g o n R e R U N t u s e ,a m u s e , f a s c i n a t e , e d u c a t e ,e n l i g h t e n , s o l v e , b a t t l e , h e l p ,p r o v o k e , h e a r , s e e , p l a y , a n v a l u e . N t y p i n g , n t r o u b l e .L o a d t h e m i n t o y o u r C o m o d o r e c o m p u t e r a n e n j o y t h b e s t f r o m R U m a g a z i n e J u l y -D e c e m b e r 1 9 8 4 .

G u W r i g h tT e c h n i c a l E d i t o rR U m a g a z i n e

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 8/94

H O T L O A D

D I S K :T l o a d a n o t h p r o g r a m s t y p e :

L O A D p r o g r a m - n a m e " ,

t h e n p r e s s t h R E T U R N k e y .T h d i s k d r i v e s h o u l d ' w h i r r ' w h i l e t h s c r e e n p r i n t s S E A R C H I N G F O R p r o g r a m - n a m e .T h s c r e e n s h o u l d t h e n p r i n t L O A D I N G a n t h e n f i n a l l y R E A D Y w i t h t h f l a s h i n g c u r s o rb e n e a t h . T y p e R U a n p r e s s t h R E T U R N k e y . T h p r o g r a m w i l l t h e n b e g i n .

C A S S E T T EI n s e r t t h c a s s e t t e t a p e i n t o t h D a t a s e t t e r e c o r d e r w i t h t h e p r o p e r s i d e f a c i n g u ( C o m m o d o r e 6 s i d e u i y o o w C o m m o d o r e 6 a n V I C - 2 0 s i d e u i y o o w V I C - 2 0 )M a k e s u r e t h a t t h t a p e i r e w o u n d a l t h w a t t h b e g i n n i n g .T y p e

L O A D " p r o g r a m - n a m e "

t h e n p r e s s t h R E T U R N k e y . T h s c r e e n w i l l d i s p l a yP R E S S P L A Y O T A P Ey o s h o u l d t h e n p u s h t h e p l a y b u t t o n o y o u r d a t a s e t t e r e c o r d e r .

W h e n t h p r o g r a m h a b e e n f o u n d t h s c r e e n w i l l d i s p l a yF O U N D p r o g r a m n a m eo s o m e C o m m o d o r e c o m p u t e r s y o u m a t h e n h a v e t p r e s s t h e ( C o m m o d o r es y m b o l ) k e t t h e n l o a d t h e p r o g r a m . O o t h e r C o m m o d o r e m a c h i n e s t h p r o g r a mw i l l l o a d a u t o m a t i c a l l y . C h e c k y o u r o w n e r ' s m a n u a l f o s p e c i f i c l o a d i n g p r o c e d u r e s .W h e n t h p r o g r a m h a f i n i s h e d l o a d i n g y o w i l l s e t h R E A D Y p r o m p t a n t h f l a s hi n c u r s o r b e n e a t h . T y p e R U a n p r e s s t h R E T U R N k e t s t a r t t h p r o g r a m .

N O T E S :Y o s h o u l d u s t h e n t i r e p r o g r a m n a m e a l i s t e d t a v o i d l o a d i n g p r o g r a m s t h a t h a v es i m i l a r t i t l e s .M a k e s u r e t h a t i y o a r l o a d i n g V I C - 2 0 p r o g r a m s y o u h a v e t h c o r r e c t m e m o r ye x p a n s i o n c a r t r i d g e ( o n c a r t r i d g e i t h a t i r e q u i r e d ) p l u g g e d i b e f o r e l o a d i n g t h ep r o g r a m .S o m e p r o g r a m s a r e d i v i d e d i n t o t w s e c t i o n s , t h m a i n s e c t i o n ( t h e o n y o s h o u l dl o a d f i r s t ) a n t h M O D U L E s e c t i o n t h a t i e i t h e r a u t o m a t i c a l l y l o a d e d w h e n t h f i r s ts e c t i o n i r u n o r i l o a d e d m a n u a l l y a f t e r t h f i r s t s e c t i o n i r u n .C o m m o d o r e 6 p r o g r a m s w i l l N O n o r m a l l y r u o C o m m o d o r e V I C - 2 0 a n b t h s a m e t o k e n V I C - 2 0 p r o g r a m s w i l l N O u s u a l l y r u n o C o m m o d o r e 6 4 E v e n t h o u g hy o m a b a b l e t l o a d p a r t i c u l a r p r o g r a m i n t o t h w r o n g c o m p u t e r i i u n l i k e l yt h a t i w i l l r u p r o p e r l y .A L W A Y S r e f e r t o t h a r t i c l e i t h e b o o k l e t f o o p e r a t i n g i n s t r u c t i o n s , m e m o r y r e q u i r em e n t s , e t c .

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 9/94

B M . J . C L I F F O R D

G e a f i r m g r i p o y o u rs p r i t e s w i t h t h i s p r g r a m t h a t l e t s y o m n i p u l a t e t h e m q u i c k l ya n e a s i l y .

T h e r e a r m a n y a r t i c l e s a n p r o g r a m s f o t h C o m m o d o r e6 t h a t d e a l w i t h s p r i t e s . T h p u r p o s e o m o s t o t h e s e i t m a k e i e a s y f o y o t d e s i g nt h e m . H o w e v e r , o n c e y o u ' v ed e s i g n e d t h s p r i t e s , t h e y s t i l lc a b d i f f i c u l t t h a n d l e i B a s i c .

Y o u m u s t k e e p t r a c k o f e i g h td i f f e r e n t p o i n t e r l o c a t i o n s ,e i g h t y - c o o r d i n a t e r e g i s t e r s a n n i n e x - c o o r d i n a t e r e g i s t e r s , a w e l l a t h v a r i o u s c o l o r a n p r i o r i t y r e g i s t e r s . T h n i n t hx - c o o r d i n a t e r e g i s t e r a n t h r e g i s t e r t h a t t u r n s t h s p r i t e so a n o f r e q u i r e y o t h a d l s i n g l e b i a t i m e . B i m a n i p u l a t i o n r e q u i r e s t h a t y o k n o w l i t t l e a b o u t b i n a r y n u b e r i n g a n t h l o g i c a l A N a n O o p e r a t i o n s . T h i s c a b l o t h a n d l e e v e n f o t h e p e r t , n e v e r m i n d t h n o v i c e .

i I G H T

S p r i t e C o n t r o l

C o m m a n d Y o u r P r o g r a mT h e p r o g r a m i L i s t i n g

a d d s t B a s i c f o u r c o m m a n d st h a t t a k e c a r e o a l t h e s ed e t a i l s . T h c o m m a n d s t u r ns p r i t e s o o o f f , m o v e t h e m ,a u t o m a t i c a l l y h a n d l e t h p r o bl e o b e i n g g r e a t e r t h a n 2 5 a n p u t h p o i n t e r s , c o l o r s , e p a n s i o n a n p r i o r i t y i n f o r m at i o n i n t o t h p r o p e r r e g i s t e r s .

T h n e c o m m a n d s a r a d e t B a s i c b y m e a n s o t h S Y c o m m a n d , w h i c h t r a n s f e r sc o n t r o l t m a c h i n e l a n g u a g er o u t i n e . T h M r o u t i n e t h e nr e a d s t h r e q u i r e d v a l u e s f r o mt h B a s i c p r o g r a m . O n c e t h v a r i a b l e S i s e e q u a l t 4 0 0 8 0 , t h f o l l o w i n g c o m m a n d sa r a v a i l a b l e :D e f i n e s p r i t e : S Y S S P . D ,

n , l , m , ( c 1 , c 2 , )c 3 , x e , y e , p

S h o w s p r i t e : S Y S S P , S , nH i d e s p r i t e : S Y S S P , H , nM o v e s p r i t e : S Y S S P , M , n , x , y

B a s i c n e v e r s e e s t h D , S ,a n s u b c o m m a n d s , s o y o um a u s t h e s e l e t t e r s e l s ew h e r e i t h p r o g r a m . O c o u r s e , S m u s t n o b c h a n g e d f r o m i t v a l u e o 4 0 0 8 0 .

C o m m o d o r e 6

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 10/94

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 11/94

5 5 — M o v e s s p r i t e t p o s i t i o nX , ( 1 7 0 , 1 4 0 ) a n s h o w s s p r i t eZ o n l y s p r i t e w i l l b e s e e n a f i r s t , s i n c e t h o t h e r s e v e ns p r i t e s a r b e h i n d i t 7 0 - 1 2 0 — M o v e a l e i g h t s p r i t e sa w a y f r o m t h c e n t e r , e a c h i d i f f e r e n t d i r e c t i o n :

m o v e s r i g h t a t h c o o rd i n a t e i i n c r e a s e d b y

m o v e s r i g h t a n u p a s i c r e a s e s a n d e c r e a s e s

m o v e s u a d e c r e a s e sm o v e s l e f t a n d u p a b o t h

a n d e c r e a s em o v e s l e f t a d e c r e a s e sm o v e s l e f t a n d o w n a

d e c r e a s e s a n i n c r e a s e sm o v e s d o w n a i n c r e a s e sm o v e s r i g h t a n d o w n a

b o t h a n i n c r e a s e1 3 0 — H i d e s a l s p r i t e s .1 4 0 — M o v e s s p r i t e t t h u p e l e f t c o r n e r a n s h o w s i t 1 5 0 — M o v e s s p r i t e d i a g o n a l l ya c r o s s t h s c r e e n f r o m u p p e rl e f t t l o w e r c e n t e r .1 6 0 — H i d e s s p r i t e 2 1 7 0 - 2 3 0 — D e m o n s t r a t e e x p a ns i o n a n c o l o r c h a n g e s .1 7 0 — P u t s s p r i t e i n t o t h c e n t e r o t h s c r e e n a n s h o w s i t 1 8 0 — R e d e f i n e s s p r i t e i l o c at i o n 1 a m o n o c h r o m e w i t hc o l o r a n e x p a n d e d w i d t h .

1 9 0 , 2 1 0 , 2 2 5 — U n e x p a n d e d .2 0 0 — E x p a n d e d h e i g h t .2 2 0 — E x p a n d e d i b o t h h e i g h ta n w i d t h .2 3 0 — D o e s i a g a i n i t h r e em o r e c o l o r s , t h e n h i d e s i t 3 0 0 - 3 8 5 — U s e m o u s e t m a k e s e l e c t i o n s f r o m a m e n u .3 0 0 — D e f i n e s s p r i t e a i l o c a t i o n 1 4 m o n o c h r o m e , c o l o r1 5 u n e x p a n d e d a n w i t h o u tp r i o r i t y o v e r t e x t3 1 0 - 3 4 0 — P r i n t m e n u .3 4 5 — S e t s Y c o o r d i n a t e o s p r i t e a c c o r d i n g t t h v a l u eo C 3 5 0 — M o v e s s p r i t e t o l o c a t i o n2 4 , Y .3 5 5 — W a i t s f o k e y p r e s s .3 6 0 — I f f i p r e s s e d , i n c r e a s e s C 6 5 — I f f i p r e s s e d , d e c r e a s e s C 3 7 0 — I f t h r e t u r n k e i n o p r e s s e d , g o e s t 3 4 5 .3 8 5 — I f t h r e t u r n k e i p r e s s e d , i t h v a l u e o t h o p t i o n c h o s e n .1 0 0 0 — T i m e - d e l a y s u b r o u t i n e . ®

A d d r e s s a l a u t h o r c o r e s p o n d e n c e t M . J . C l i f f o r d ,2 3 2 3 W B a n c r o f t S t . , T o l e d o ,O 4 3 6 0 7 .

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 12/94

L i s t e r F i l t e r

B A L E J A N D R O A K A P A U A N

C o n v e r t t h o s e c u r i o u sC o m m o d o r e c u s t o mc h a r a c t e r s i n t o s o m et h i n g w h u m a n s c a u n d e r s t a n d , a n y o w i l l g e e a s y - t o - r e a d ,p r o f e s s i o n a l - l o o k i n gl i s t i n g s .

l i s t i n g - t r a n s l a t o r p r o g r a m ,L i s t e r - F i l t e r , a l l o w s y o t p r i n te a s y - t o - r e a d l i s t i n g s s i m i l a r t t h o n e s i t h i s p u b l i c a t i o n . I f i l t e r s o u a l C o m m o d o r eg r a p h i c s c h a r a c t e r s o u t p u t t t h e s c r e e n , p r i n t e r o R S - 2 3 2 d v i c e s ( d e v i c e n u m b e r s 3 a n 2 r e s p e c t i v e l y ) a n r e p l a c e st h e m w i t h e a s y - t o - r e a d n o g r a p h i c e q u i v a l e n t s .

F o e x a m p l e , t h e c l e a r - s c r e e nc h a r a c t e r w i l l p r i n t a [ C L R ] i s t e a d o a s r e v e r s e - v i d e oh e a r t c h a r a c t e r . s h i f t e ds p a c e w i l l p r i n t a [ S H F T S P C ] ,w h i l e t h e c h a r a c t e r y o p r d u c e b h o l d i n g d o w n t h C o m -

u n i tI G H T

V I C - 2 0C o m m o d o r e 6

m o d o r e l o g o k e a n t y p i n gw i l l p r i n t a [ C O M D A ] I a d d it i o n t t h e s e f e a t u r e s , L i s t e r - F i lt e a l s o c o m p r e s s e s l o n g r p e a t e d s e q u e n c e s o g r a p h i c s ,c u r s o r c o n t r o l o r b l a n kc h a r a c t e r s i n t o s i n g l e s t r i n g .

s t r i n g o f 2 c u r s o r - r i g h tc h a r a c t e r s w i l l p r i n t a [ 2 R I G H T ] . s i n g l e s p a c e w i l lp r i n t a s p a c e , w h i l e t w o m o r e s p a c e s i s e q u e n c e w i l lp r i n t a [ S P C ] , w h e r e i t h n u m b e r o s p a c e s . T h p r o g r a mi e s p e c i a l l y u s e f u l f o m a k i n gp r i n t e d l i s t i n g s i y o u r p r i n t e r o p r i n t e r i n t e r f a c e h a n g r a p hi c c a p a b i l i t i e s . E v e n i y o d h a v e g r a p h i c s p r i n t e r , l i s t i n g sp r o c e s s e d b t h i s t r a n s l a t o r a r m o r e r e a d a b l e t h a n r e g u l a rg r a p h i c s l i s t i n g s .

L i s t e r - F i l t e r w a o r i g i n a l l yw r i t t e n f o t h e x p a n d e dV I C - 2 0 , b u i w i l l r u w i t h o u tm o d i f i c a t i o n s o C o m m o d o r e6 4 I i w r i t t e n e n t i r e l y i m c h i n e l a n g u a g e a n d u s e s 6 3 b y t e s o y o u r R A M . H o w e v e r ,y o d o n ' t h a v e t k n o w m c h i n e l a n g u a g e t u s t h p r g r a m a n y o d n o e v e n n e e d

m a c h i n e l a n g u a g e m o n i t o r t t y p e i i n T h B a s i c l o a d e r p r g r a m ( s e e L i s t i n g 1 w i l l d t h p r o p e r l o a d i n g a n r e l o c a t i o no t h L i s t e r - F i l t e r p r o g r a m .

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 13/94

U s i n g t h P r o g r a mT y p e i t h B a s i c l o a d e r p r o

g r a m c a r e f u l l y . T h i s m a b l i t t l e d i f f i c u l t b e c a u s e o t h n m e r o u s D a t a s t a t e m e n t s ; h o e v e r , c h e c k s a r p r o v i d e d i t h p r o g r a m s t h a t y o c a e a s i l yl o c a t e t h e e r r o r s i t h d a t aw h e n y o r u i t A f t e r t y p i n gi t h p r o g r a m , m a k e s u r e t s a v e i t

W h e n y o r u n t h e p r o g r a mf o t h f i r s t t i m e , i m a c o n t a i ns o m e e r r o r s . I t h e r e i S y n t a xe r r o r , e x a m i n e a n c o r r e c t t h o f f e n d i n g l i n e . I y o g e m e s a g e D A T A E R R O R N E A R L I N En e x a m i n e l i n e f o r e r r o r s , o p o s s i b l y t h e l i n e b e f o r e i t . I fy o g e a n O u t o D a t a e r r o r , i i l i k e l y t h a t y o j u s t l e f t o u D a t a s t a t e m e n t . M a k e t h n e e s s a r y c o r r e c t i o n s a n s a v e t h p r o g r a m a g a i n .

O n c e t h l o a d e r p r o g r a m e e c u t e s t c o m p l e t i o n , a n t h s c r e e n d i s p l a y s F I L T E R I S T A L L E D , t h e n a l o u t p u t d r e c t e d t t h s c r e e n , p r i n t e r o R S - 2 3 2 d e v i c e w i l l b t r a n sl a t e d . Y o m a t y p e N E t d e l e t e t h e l o a d e r p r o g r a m , b u t h L i s t e r - F i l t e r p r o g r a m w i l ls t i l l b t h e r e . T m a k e l i s t i n go a n o t h e r p r o g r a m , j u s t l o a d i i n t o y o u r c o m p u t e r a n d l i s t i i t h n o r m a l m a n n e r . T d i s a b l et h e t r a n s l a t o r w h e n y o n l o n g e r n e e d i t y o u c a n w a r ms t a r t y o u r c o m p u t e r b h o l d i n gd o w n t h r u n / s t o p k e a n h i t i n g t h e r e s t o r e k e y . T r e i n s t a l lt h f i l t e r l a t e r , j u s t l o a d t h el o a d e r p r o g r a m a n r u i t

Y o c a m o d i f y w h a t t h t r a n s l a t o r w i l l p r i n t f o s o m eg r a p h i c s c h a r a c t e r s b c h a n g

i n l i n e s 1 0 0 0 t 1 3 5 0 i t h l o a d e r p r o g r a m . T h v a r i a b l ei s e t t h C H R $ c o d e o t h c h a r a c t e r , w h i l e t h s t r i n g C i s e t t h s t r i n g t o b p r i n t e d .G O S U B 4 0 0 0 t h e n i n s t a l l s t h c o d e i t h f i l t e r ' s e x c e p t i o nt a b l e .

L i n e s m a b a d d e d a f t e rl i n e 1 3 5 0 f o o t h e r c h a r a c t e r s ,l i k e t h e x t r a C o m m o d o r e 6 c o l o r - c o n t r o l c h a r a c t e r s , w h i c ha r u n a v a i l a b l e o t h V I C -2 0 H o w e v e r , t h t o t a l e x c e pt i o n - t a b l e s p a c e m a n o e c e e d 2 5 6 b y t e s . T h p r o g r a mw i l l t e l l y o i t h e t a b l e s t r i n g sa r t o l o n g . Y o m i g h t h a v e t s h o r t e n s o m e s t r i n g s t m a k er o o m f o t h o t h e r s .

H o I W o r k sL i s t e r - F i l t e r i b a s i c a l l y p r

g r a m t h a t i p l a c e d j u s t b e f o r et h V I C ' s o C - 6 4 ' s n o r m a l o u p u r o u t i n e . T h i s i d o n e b m o d i f y i n g t h o u t p u t v e c t o r a l o c a t i o n s 8 0 a n 8 0 t p o i n tt t h L i s t e r - F i l t e r p r o g r a m .A f t e r i d o e s i t t r a n s l a t i n g , t h p r o g r a m t h e n p a s s e s c o n t r o l t t h n o r m a l o u t p u t p r o g r a m t p r i n t t h t r a n s l a t e d c h a r a c t e r s .

T h t r a n s l a t i n g p r o c e s s i f a i r l y s t r a i g h t f o r w a r d . F i r s t , t h c h a r a c t e r t b p r i n t e d i c h e c k e d a g a i n s t t h e p r e v i o u s l yr e c e i v e d c h a r a c t e r . I i i t h s a m e , t h e n a c o u n t o a c c u m ul a t e d c h a r a c t e r s i i n c r em e n t e d , a n t h c h a r a c t e r i n o i m m e d i a t e l y p r i n t e d . I i i n o t t h e s a m e , t h e n t h c h a r a c t e ri s a v e d , a n t h p r e v i o u s l y -b u f f e r e d c h a r a c t e r s a r p r i n t e d .

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 14/94

T h a t w a y , r e p e a t e d c h a r a c t e r sc a b c o m p r e s s e d a s i n g l es t r i n g .

T h c h a r a c t e r i c h e c k e d t s e i f i t i i t h e x c e p t i o nt a b l e . I n o t , i t ' s c h e c k e d t d t e r m i n e i i i C o m m o d o r el o g o k e g r a p h i c s c h a r a c t e r . I i t ' s n e i t h e r o t h o s e , i t ' sc h e c k e d t s e i i t ' s s h i f t e dc h a r a c t e r . T h a p p r o p r i a t es t r i n g r e p r e s e n t a t i o n o t h c h a r a c t e r i p r i n t e d , w i t h a n n e c e s s a r y n u m e r i c c o u n t . I t h c h a r a c t e r i n o r m a l p r i n t a b l eo n e , t h e n i t ' s p r i n t e d a i s

I y o a r k n o w l e d g e a b l e i m a c h i n e l a n g u a g e p r o g r a mm i n g , y o u m i g h t w a n t t d i s a ss e m b l e L i s t e r - F i l t e r t e x a m i n ei i d e t a i l .

L i s t e r - F i l t e r i h a n d yp r o g r a m f o m a k i n g c l e a r , p r f e s s i o n a l l i s t i n g s , a n i h e l p sp r e v e n t t h e y e s t r a i n a n h e a da c h e s c a u s e d b r e a d i n g c r y pt i g r a p h i c s c h a r a c t e r s , g

A d d r e s s a l a u t h o r c o r r e s p o nd e n c e t A l e j a n d r o A K a p a u a n ,1 4 1 - 6 A i r p o r t R o a d , W e s t L a f a ye t t e , I N 4 7 9 0 6 .

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 15/94

B R O B E R T W B A K E R

H e r e ' s h a n d y u t i l i t yt h a t a l l o w s y o t s q u e e z e y o u r p r g r a m s a n t h u s g a i nm o r e m e m o r y .

T h i s w a o r i g i n a l l y w r i tt e f o t h C o m m o d o r e P E T ,b u I ' v e m a d e s e v e r a l i m p r o v em e n t s a n d h a v e u p d a t e d t h p r o g r a m t r u o t h C o m o d o r e 6 a n V I C - 2 0 ( w i t h 1 6 e x p a n s i o n m e m o r y ) .

C o m p a c t o r I r e a d s B a s i cp r o g r a m t h a t h a s b e e n s a v e do d i s k a n c r e a t e s n e w ,c o m p a c t e d c o p y . C o m p a c t o r I d e l e t e s a l R E s t a t e m e n t s , u n e c e s s a r y s p a c e s a n l e a d i n gc o l o n s .

T h i s p r o g r a m , h o w e v e r , g o e so n s t e p f u r t h e r . W h e n e v e r p o s i b l e , i c o m b i n e s p r o g r a ml i n e s t e l i m i n a t e t h l i n k , l i n en u m b e r a n l i n e - e n d - f l a g o v e rh e a d s n o r m a l l y a s s o c i a t e d w i t h

I I G H T

L i n e S q u e e z e rF o r m e r l y " C o m p a c t o r . "

C o m m o d o r e 6 V I C - 2 0 w i t h 1 6 e x p a n s i o n

e a c h B a s i c p r o g r a m l i n e . I m a k e s p r o g r a m a s m a l l a p o s s i b l e a n u s u a l l y f a s t e rr u n n i n g .

T g i v e y o u a n i d e a o w h a t i c a d o t h C o m p a c t o r I p r g r a m i o v e r 3 1 0 0 b y t e s l o n g ( 1 b l o c k s o d i s k ) , a n w h e n c o p a c t e d b y i t s e l f , t h n e v e s i o n i a b o u t 1 8 0 0 b y t e s ( b l o c k s o d i s k ) , o a p p r o x i m a t el 5 8 s m a l l e r . A d m i t t e d l y , t h eC o m p a c t o r I p r o g r a m d o e sc o n t a i n a l a r g e n u m b e r o s p a c e s a n s e v e r a l r e m a r k s ,b u t t h e s a v i n g s y o g e o a n p a r t i c u l a r p r o g r a m d e p e n d o h o i w a w r i t t e n .

W h i l e w r i t i n g t h o r i g i n a l v e s i o n o f t h i s p r o g r a m , c a m ea c r o s s f e o C o m m o d o r eB a s i c ' s u n d o c u m e n t e d q u i r k s .S i n c e m a n y o y o l i k e t e p e r i m e n t w i t h t h c a p a b i l i t i e so h a v i n g p r o g r a m s w r i t e o t h e rp r o g r a m s t d i s k , t h f o l l o w i n gi n f o r m a t i o n m a b o i n t e r e s tt y o u .

Z e r o - L e n g t h a n L o n g L i n e sN o r m a l l y , i i i m p o s s i b l e t

c r e a t e z e r o - l e n g t h l i n e w h e ny o u u s e t h s c r e e n e d i t o r o a n C o m m o d o r e s y s t e m . B z e r o - l e n g t h l i n e , m e a n l i n ew i t h l i n k , l i n e n u m b e r a n e n d - o f - l i n e f l a g , b u w i t h n B a s i c c o m m a n d s o t e x t . I y o w e r e t t y p e j u s t l i n e n u m b e ru s i n g t h s c r e e n e d i t o r , y o w o u l d a c t u a l l y d e l e t e l i n e i n

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 16/94

s t e a d o e n t e r i n g z e r o - l e n g t hl i n e .

W h e n y o w r i t e a B a s i c p r g r a m o d i s k a d a t a f i l e ,t h e r e i n o t h i n g t p r e v e n t y o f r o m e n t e r i n g z e r o - l e n g t h l i n e .B a s i c , h o w e v e r , c a n n o t c o r r e c tl l i n k t h p r o g r a m l i n e s w h e np r o g r a m c o n t a i n s a z e r o - l e n g t hl i n e . T h e r e f o r e , i y o w a n t t h p r o g r a m t r u n . y o c a n n o th a v e a n z e r o - l e n g t h l i n e s i y o u r p r o g r a m .

A t h o t h e r e x t r e m e , w h e ny o u u s e t h C o m m o d o r e s c r e e ne d i t o r , y o c a n n o t c r e a t eB a s i c l i n e t h a t i l o n g e r t h a n2 5 b y t e s . T h C o m m o d o r e 6 n o r m a l l y l i m i t s y o t m a i m u m o 7 c h a r a c t e r s , b e c a u s eo t h e l i n e - w r a p p i n g c h a r a c t e ri s t i c s a n t h n e e d f o a t l e a s t

o n e - d i g i t l i n e n u m b e r .W h e n y o u ' r e w r i t i n g d a t a -

f i l e t o d i s k , b c a r e f u l n o t c r a t l i n e g r e a t e r t h a n 2 5 b y t e s ,a t h p r o g r a m u s u a l l y w o n ' tl o a d b a c k f r o m t h d i s k . I f i td o e s l o a d , t h p r o g r a m w i l l n o m a l l y b c o m p l e t e l y d e s t r o y e d .

H o t h P r o g r a m W o r k sW h e n y o r u t h C o m p a c t o r

I p r o g r a m , y o h a v e s o m e c o t r o l o v e r t h s i z e o f t h p r o g r a ml i n e s . T h f i r s t i n p u t p r o m p t( l i n e s 4 1 0 - 4 2 0 ) w i l l a s f o t h m a x i m u m l i n e l e n g t h . T h i sm u s t b p o s i t i v e n u m b e r b t w e e n a n 2 5 5 — t h e d e f a u l tv a l u e i 2 5 i y o j u s t h i t h r e t u r n k e y . W h e n e n t e r i n g s m a l ln u m b e r s , b s u r e t u s e s p a c e st r e m o v e u n w a n t e d d i g i t s f r o mt h d e f a u l t n u m b e r .

A f t e r y o s e l e c t t h m a x im u l i n e l e n g t h , y o a r a s k e dt h n a m e o t h B a s i c p r o g r a m

f i l e y o w a n t c o m p a c t e d ( l i n e s4 4 0 - 4 5 0 ) . ( R e m e m b e r t h a t t h p r o g r a m m u s t b e o n d i s k . ) I t h f i l e i s n o f o u n d o i a n d i s ke r r o r s a r e n c o u n t e r e d , t h e yw i l l b r e p o r t e d a n t h e p r og r a m w i l l a b o r t .

N e x t , y o u ' r e a s k e d t e n t e rt h n a m e o t h c o m p a c t e dp r o g r a m t b c r e a t e d ( l i n e s4 6 0 - 4 7 0 ) . T h i s n a m e c a n n o t b t h s a m e a t h o r i g i n a l p r g r a m n a m e o a n o t h e r f l c u r r e n t l y o n t h e d i s k . I a n f i l ew i t h t h s a m e n a m e a l r e a d y e i s t s , o i a n d i s k e r r o r s a r e c o u n t e r e d , t h p r o g r a m w i l ll i k e w i s e a b o r t .

C o m p a c t o r I r e a d s t h e p r og r a m a s e q u e n t i a l d i s k d a t a -f i l e , a n t h f i l e i r e a d t w i c e .T h f i r s t p a s s ( l i n e s 4 8 0 - 8 2 0 )c h e c k s f o l i n e n u m b e r s t h a ta r t h t a r g e t s o G O T O ,G O S U B , R u n , o r l f . . . T h e ns t a t e m e n t s ( l i n e s 5 9 0 - 6 9 0 ) .W h e n i f i n d s t a r g e t l i n e n u b e r , t h a t n u m b e r i s a v e d i m a t r i x T L i i t ' s n o a l r e a d ys a v e d ( l i n e s 7 3 0 - 7 6 0 ) . I a l s oc h e c k s f o m u l t i p l e t a r g e t l i n e si O N . . G O T O a n O N . . . G O -S U s t a t e m e n t s ( l i n e s 8 0 0 - 8 2 0 ) .

A t h f i r s t p a s s p r o g r e s s e s ,e a c h t a r g e t l i n e i d i s p l a y e d i t h o r d e r f o u n d ( l i n e 7 5 0 ) . T h i sg i v e s y o s o m e i n d i c a t i o n o t h s c a n n i n g p r o g r e s s , s i n c e i c a b r a t h e r s l o w . A t t h e n o t h f i r s t p a s s , t h e t a r g e tl i n e s a r s o r t e d i n t o n u m e r i c a lo r d e r , t o h e l p s p e e d u l a t e rp r o c e s s i n g ( l i n e s 8 6 0 - 8 9 0 ) .

D u r i n g t h s e c o n d p a s s( l i n e s 9 3 0 - 1 4 2 0 ) , e a c h l i n e i c o p i e d , d e l e t e d o c o m p a c t e da c c o r d i n g t t h C o m p a c t o r ' sr u l e s . A g a i n , t h e l i n e n u m b e r i

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 17/94

d i s p l a y e d a e a c h l i n e o t h o r i g i n a l p r o g r a m i p r o c e s s e d ,t l e y o k n o w h o t h e p r og r a m i p r o g r e s s i n g . T h r u l e sf o l o w e d b y t h C o m p a c t o r a r a f o l l o w s :

A n l e a d i n g c o l o n s a n d / o rs p a c e s o n l i n e a r e d e l e t e d( l i n e 1 0 1 0 ) .• l i n e t h a t h a o n l y r e m a r k s

i d e l e t e d i f i t i n o t a r g e tl i n e ( l i n e s 1 0 2 0 - 1 0 4 0 ) . I t h l i n e i t a r g e t l i n e , t h r e m a r kw i l l b r e p l a c e d w i t h s i n g l ec o l o n , w h i c h m u s t b r e t a i n e d( l i n e 1 0 5 0 ) . T h i s m a p r o d u c el e a d i n g c o l o n i t h n e x t l i n e i n o t a r g e t l i n e a n i c o b i n e d w i t h t h i s l i n e . T h l i n ec a n n o t b e r e d u c e d t z e r o -l e n g t h l i n e , s i n c e B a s i c c a n n o tl i n k p r o g r a m c o r r e c t l y w i t hz e r o - l e n g t h l i n e , a m e n t i o n e de a r l i e r .

I a n l i n e c o n t a i n s a G O T O ,R u o I f . . . T h e n s t a t e m e n t , i c a n n o t b e c o m b i n e d w i t ha n o t h e r l i n e . L i n e 1 1 3 0 m a k e st h c h e c k f o t h e s e t o k e n s a n s e t s f l a g i v a r i a b l ew h e n e v e r o n e i f o u n d . T h i sf l a g f o r c e s t h c u r r e n t l i n e t b w r i t t e n t d i s k a n t h n e x tl i n e t b r e a d w i t h o u t c o m b i ni n t h t w o . A n l i n e c o m b i n e da f t e r t h e s e B a s i c c o m m a n d sw o u l d n e v e r b e x e c u t e d ; t h u st h c o m p a c t e d p r o g r a m w o u l dn o f u n c t i o n p r o p e r l y .• A n y s p a c e s w i t h i n l i n e , t h a t

a r n o e n c l o s e d i q u o t e s , a r d e l e t e d ( l i n o 1 1 1 0 ) .• A n y r e m a r k s a t h e n o

B a s i c l i n e a r e d e l e t e d t t h e n o t h l i n e ( l i n e 1 1 4 0 ) .

A n y t h i n g w i t h i n q u o t e s i c o p i e d u n t o u c h e d ( l i n e s 1 1 8 0 -

1 2 0 0 ) . I a e n d i n g q u o t e i m i s s i n g f r o m l i n e t h a t c o u l db c o m b i n e d w i t h a n o t h e r l i n e ,t h e n a n e n d i n g q u o t e i a d d e d( l i n e s 1 2 1 0 - 1 2 2 0 ) .

W h e n c o l o n i f o u n d w i t h i nB a s i c l i n e a n n o w i t h i n

q u o t e s , t h C o m p a c t o r p r o g r a mc h e c k s t h e n e x t n o n - s p a c ec h a r a c t e r b e f o r e i c o p i e s t h c o l o n ( l i n e 1 2 6 0 ) . I a r e m a r k f o l o w s t h c o l o n , t h c o l o n a n t h r e s t o t h l i n e a r d e l e t e d .O t h e r w i s e , t h c o l o n i c o p i e d ,a n p r o c e s s i n g c o n t i n u e s a n o r m a l ( l i n e 1 2 7 0 ) .

A t h e n o e a c h B a s i c l i n e ,t h C o m p a c t o r c h e c k s t s e i t h n e x t l i n e c a b c o m b i n e dw i t h t h i s o n ( l i n e 1 3 1 0 ) . I t h e r ea r e n ' t a n G O T O , R u o I f . . . T h e n c o m m a n d s , a n i t h n e x t l i n e i n o t a r g e t l i n e ,t h l i n e s a r c o m b i n e d ( l i n e s1 3 2 0 - 1 3 6 0 ) . W h e n t h i s h a p p e n s ,t h l i n k a n l i n e n u m b e r a r d i s c a r d e d , a c o l o n i w r i t t e n ,a n t h e n e x t l i n e i p r o c e s s e da p a r t o f t h e p r e v i o u s l i n e .

I t h s e c o n d l i n e c a n n o t b c o m b i n e d w i t h t h f i r s t l i n e , t h f i r s t l i n e i w r i t t e n t d i s k w i t ht h c o r r e c t l i n k . T h i s i t h m a j o r d i f f e r e n c e b e t w e e n t h o r i g i n a l C o m p a c t o r a n t h i sn e v e r s i o n . C o m p a c t o r I u s e s

l i n e b u f f e r t c o n s t r u c t t h e n t i r e l i n e b e f o r e i i a c t u a l l yw r i t t e n t d i s k . T h i s a l l o w s t h p r o g r a m t c o n s t r u c t a n a cc u r a t e l i n k v a l u e , w h i c h i w i l lw r i t e a t h f r o n t o f e a c h l i n e .

W h e n t h e n o t h p r o g r a mi f o u n d , t h l a s t l i n e i w r i t t e nt d i s k , a l o n g w i t h t h e e n d i n gz e r o l i n k , a n a l f i l e s a r p r o pe r l y c l o s e d ( l i n e s 1 4 0 0 - 1 4 2 0 ) .

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 18/94

L i n e s O L i n e ss k i p p e d o v e r t h e s u b r o u t i n e s ,

w h i c h a r e l o c a t e d n e a r t h f r o n to t h p r o g r a m a l i n e s 2 3 0 - 3 6 0 .

G O S U B t l i n e 2 4 w i l l r e a db y t e a n r e t u r n t h c h a r a c t e rc o d e e s t a b l i s h e d i t h v a r i a b l eV w h i l e s t a r t i n g a l i n e 2 3 w i l lr e a d t w b y t e s . L i n e s 2 7 0 -2 9 c h e c k f o d i s k e r r o r s a n r e p o r t a n f i n d i n g s b e f o r ea b o r t i n g t h e p r o g r a m .

L i n e s 3 0 0 - 3 2 0 c o m p u t e t h l i n k v a l u e f o p r o g r a m l i n e i L a n t h e n w r i t e t d i s k t h l i n k , p r o g r a m l i n e a n e n d i n gf l a g ( 0 ) . L i n e s 3 3 0 - 3 6 0 r e a d a e n t i r e B a s i c p r o g r a m l i n e , s a i n e a c h b y t e i t h m a t r i xa n t h l i n e l e n g t h i P I a l s oc o m p u t e s t h p r o g r a m l i n en u m b e r , s a v e s i i t h L v a r ia b l e a n d i s p l a y s t h e l i n e n u b e r , o v e r w r i t i n g a n p r e v i o u sn u m b e r .

T h l i n e l e n g t h t h a t y o s p e c i f y a t h p r o g r a m ' s b e g i nn i n g p r e v e n t s C o m p a c t o r I f r o m c o m b i n i n g l i n e s t h a tw o u l d e x c e e d t h e s p e c i f i e dl i m i t . H o w e v e r , a n l i n e sa l r e a d y g r e a t e r t h a n t h l i m i t

w i l l b c o p i e d w i t h o u t b e i n gc o m b i n e d w i t h o t h e r l i n e s . I y o s e l e c t a s m a l l l i m i t , t h e n

t h p r o g r a m w i l l c o p y m o s t o t h l i n e s w i t h o u t c o m b i n i n gt h e m . I w i l l , h o w e v e r , c o m p a c te a c h l i n e b r e m o v i n g s p a c e s ,r e m a r k s o l e a d i n g c o l o n s .

K e e p i m i n d t h a t t h n e w l yc o m p a c t e d p r o g r a m m a h a v el i n e s t h a t c a n n o t b e d i t e d w i t ht h s c r e e n e d i t o r . O t h C - 6 4 ,a n y p r o g r a m l i n e t h a t e x c e e d st w s c r e e n l i n e s c a n n o t b e d i t e d . ( S e e m U n c o m p a c t o rp r o g r a m , f o l l o w i n g , w h i c ha l l o w s y o t b r e a k a n s h o r t e n p r o g r a m l i n e s t a l l o wf o e a s i e r e d i t i n g . )

O n q u i c k w o r d o c a u t i o n .W h e n y o e n t e r t h P r i n t t f c o m a n d , d n o u s t h P r i n ts t a t e m e n t ' s a b b r e v i a t i o n , w h i c hi a q u e s t i o n m a r k . I y o d o t h l i n e w i l l s t i l l l i s t c o r r e c t l y ,b u i n t e r n a l l y t h c o d e i i n c o rr e c t a n w i l l g e n e r a t e s y n t a xe r r o r . A l w a y s t y p e t h e e n t i r ec o m m a n d — P R I N T # . S ]A d d r e s s a l a u t h o r c o r r e s p o nd e n c e t R o b e r t W . B a k e r , 1 5W i n d s o r D r i v e , A t c o , N 0 8 0 0 4 .

1

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 19/94

L i n e E x p a n d e rF o r m e r l y " U n c o m p a c t o r . "

B R O B E R T W B A K E R

A r y o u r p r o g r a ml i n e s o v e r c r o w d e dw i t h m u l t i p l e s t a t em e n t s ? T h i s p r o g r a mb r e a k s u p a n d s h o r te n t h o s e l i n e s , m a i n t h e m e a s i e r f o y o t e d i t .

T h i s w a o r i g i n a l l y w r i t t e nf o t h C o m m o d o r e P E T , b u I ' v e m a d e s e v e r a l i m p r o v em e n t s , i n c l u d i n g u p d a t i n g t h p r o g r a m t r u o t h C o m m od o r e 6 a n V I C - 2 0 .

U n c o m p a c t o r , c o m p a n i o nt C o m p a c t o r I I r e a d s B a s i cp r o g r a m t h a t w a s a v e d o n d i s ka n c r e a t e s a n e w , u n c o m -p a c t e d , o e x p a n d e d c o p y . I d o e s t h i s b t a k i n g a n m u l t i -s t a t e m e n t l i n e s ( s t a t e m e n t ss e p a r a t e d b c o l o n s ) a n b r e a ki n t h e m i n t o s e p a r a t e p r o g r a ml i n e s w i t h n e l i n e n u m b e r s .

i i G H C o m m o d o r e 6

V I C - 2 0 w i t h 1 6 e x p a n s i o n

L o n g l i n e s c r e a t e d b C o m p a ct o I c a n o b e d i t e d a n t h p r o g r a m r e c o m p a c t e d .

W h e n y o s p l i t m u l t i s t a t e -m e n t l i n e s , t h n e l i n e n u b e r s a r c r e a t e d b y i n c r e m e n ti n t h o r i g i n a l l i n e n u m b e r s b 1 . f o l l o w t h i s p r o c e d u r e u n t i ll i n e n u m b e r r e a c h e s t h n e x to r i g i n a l l i n e n u m b e r i t h e p r og r a m . W h e n r e a c h t h a t p o i n t ,t h e n c o p y t h r e m a i n d e r o t h o r i g i n a l l i n e a p a r t o f t h l a s tl i n e g e n e r a t e d , w i t h a n a p p r op r i a t e s e p a r a t i n g c o l o n s .

T h e p r o g r a m m u s t t a k e i n t oa c c o u n t c e r t a i n B a s i c t o k e n s ,o k e y w o r d s , s i n c e t h e y d e t e rm i n e w h e t h e r o n o p a r t i cu l a r l i n e c a b e b r o k e n i n t os e p a r a t e l i n e s . T h u s , a n d a t af o l l o w i n g G O T O , E n d , R u n , I f R e t u r n , R E M , S t o p , L i s t o C O N T t o k e n i c o p i e d , u c h a n g e d , t t h e n o t h e c u rr e n t p r o g r a m l i n e . A l s o , o n c ep r o g r a m d e t e c t s a q u o t e , i m u s t c o p y t h l i n e u n t i l i r e a c h e s a n o t h e r q u o t e o t h e n o t h p r o g r a m l i n e .P r o g r a m D e s c r i p t i o n

W h e n y o r u n t h e U n c o mp a c t o r I p r o g r a m , y o h a v es o m e c o n t r o l o v e r w h a t s i z ep r o g r a m l i n e s w i l l b u n c o m -p a c t e d . T h f i r s t i n p u t p r o m p t( l i n e 3 7 0 ) w i l l a s f o t h m i n i m u m l i n e l e n g t h t t r u n c o m p a c t i n g . T h i s s h o u l d b p o s i t i v e n u m b e r b e t w e e n a n

1

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 20/94

2 5 5 , b u t h e r e i n c h e c k o t h e v a l u e e n t e r e d . I y o j u s t h i t h r e t u r n k e w h e n p r o m p t e d ,t h e d e f a u l t w i l l f o r c e t h e p r og r a m t t r a n b r e a k e v e r ys i n g l e l i n e , w h e r e p o s s i b l e .S e l e c t i n g n u m b e r l i k e 2 w i l lc a u s e s m a l l l i n e s ( w i t h 2 o f e w e r c h a r a c t e r s ) t b l e f t u t o u c h e d , w h i l e l o n g e r l i n e s a r u n c o m p a c t e d .

A f t e r y o s e l e c t t h m i n i m u ml i n e l e n g t h , y o u ' r e t h e n a s k e dt h n a m e o t h B a s i c p r o g r a mf i l e t b u n c o m p a c t e d ( l i n e s3 9 0 - 4 0 0 ) . T h p r o g r a m m u s t b o d i s k , a p r o g r a m f i l e s c a n o b r e a d f r o m t a p e . I t h f i l ei n o f o u n d , o i a n d i s k e r o r s a r e n c o u n t e r e d , t h p r g r a m w i l l t e r m i n a t e .

N e x t , y o u ' r e a s k e d t e n t e rt h e d e s i r e d n a m e o t h u n c o mp a c t e d p r o g r a m t b c r e a t e d( l i n e s 4 1 0 - 4 2 0 ) . T h i s n a m e c a n o b t h s a m e a t h o r i g i n a lp r o g r a m n a m e o r t h a t o a n o t h e r f i l e c u r r e n t l y o t h d i s k .I a n f i l e w i t h t h s a m e n a m ea l r e a d y e x i s t s , o i a n d i s k e r o r s a r e n c o u n t e r e d , t h e y w i l lb r e p o r t e d , a n t h p r o g r a mw i l l t e r m i n a t e .

U n c o m p a c t o r I t r e a t s t h p r o g r a m t b u n c o m p a c t e d a

s e q u e n t i a l d i s k d a t a f i l e ,w h i c h i r e a d s o n l y o n c e . A i r e a d s t h o r i g i n a l p r o g r a m ,e a c h l i n e n u m b e r i d i s p l a y e do t h s c r e e n ( l i n e s 4 9 0 - 5 1 0 ) .T h i s g i v e s y o s o m e i n d i c a t i o no h o t h i n g s a r e p r o g r e s s i n ga U n c o m p a c t o r I r u n s ; i c a b r a t h e r s l o w .

A f t e r U n c o m p a c t o r I c o p i e st h o r i g i n a l l i n e n u m b e r , i r e a d s t h a c t u a l l i n e i n t o t h m a t r i x ( l i n e s 5 5 0 - 5 6 0 ) a n t h e n

r e a d s t h e n e x t l i n k a n l i n en u m b e r ( l i n e s 6 0 0 - 6 2 0 ) . W h e n i f i n d s t h z e r o l i n k a t h e n o t h p r o g r a m , t h n e x t l i n en u m b e r i f o r c e d t 6 4 0 0 0 . T h i sn u m b e r e x c e e d s a n y p o s s i b l eB a s i c p r o g r a m l i n e n u m b e r ,t h u s f o r c i n g p r o p e r h a n d l i n g o t h l a s t l i n e o t h p r o g r a mr e a d .

O n c e t h e n t i r e l i n e h a s b e e nr e a d , a n i i t ' s l o n g e r t h a n t h l i m i t y o s e l e c t e d , i i s c a n n e df o c o l o n s a n c e r t a i n B a s i ct o k e n s ( l i n e s 6 6 0 - 9 4 0 ) . I t h l i n e i s h o r t e r t h a n t h s p e c if i e d l i m i t , i t ' s c o p i e d u n t o u c h e d( l i n e 8 6 0 ) . I o n o t h s p e c i a lB a s i c t o k e n s i f o u n d ( l i n e s8 2 0 - 8 5 0 ) , t h r e m a i n d e r o t h l i n e i c o p i e d u n t o u c h e d .

W h e n c o l o n i f o u n d , t h l i n e i s p l i t a l o n g a t h e c u rr e n t l i n e n u m b e r p l u s o n i l e s s t h a n t h n e x t o r i g i n a l l i n en u m b e r ( l i n e s 7 0 0 - 7 6 0 ) . T h c u r e n t l i n e i w r i t t e n t d i s k w i t ht h p r o p e r l i n k a n e n d i n g f l a g .S i n g l e l e a d i n g c o l o n s a t h s t a r t o a n l i n e a r r e t a i n e d ,w h i l e s p a c e s o e x t r a c o l o n sf o l l o w i n g a n c o l o n i t h m i d l o l i n e a r e d e l e t e d ( l i n e7 5 0 ) .

W h e n e v e r q u o t a t i o n m a r k sa r e n c o u n t e r e d , t h r e m a i n d e ro t h l i n e i c o p i e d u n t o u c h e du n t i l t h q u o t e c l o s e s o e n o l i n e i f o u n d ( l i n e s 9 1 0 - 9 4 0 ) . A t h e n o t h p r o g r a m , z e r ol i n k i w r i t t e n t o d i s k t p r o p e rl t e r m i n a t e t h n e p r o g r a m ,a n a l f i l e s a r c l o s e d .

T h s u b r o u t i n e s a r n e a r t h f r o n t o t h p r o g r a m t h e l ps p e e d t h i n g s u p T h s u b r o ut i n e a t l i n e 2 3 r e a d s t w b y t e s ,w h i l e 2 4 r e a d s s i n g l e b y t e

1

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 21/94

f r o m t h o r i g i n a l p r o g r a m f i l e .W h e n t h p r o g r a m r e t u r n s f r o mt h i s s u b r o u t i n e , t h l a s tc h a r a c t e r r e a d i s i n C $ w i t h t h c h a r a c t e r c o d e s i a n V 1 L i n e s 2 7 0 - 2 9 0 c h e c k f o d i s k e r o r s a n e i t h e r r e t u r n t t h c a l l i n g l i n e o r d i s p l a y t h d i s ke r r o r a n s t o p t h p r o g r a m .L i n e s 3 0 0 - 3 2 0 c a l c u l a t e t h ec o r r e c t l i n k f o t h l i n e i L a n w r i t e t h e n t i r e l i n e , a l o n gw i t h t h l i n k , t t h n e p r g r a m f i l e .

N e w l y c r e a t e d , u n c o m p a c t e dp r o g r a m s a r f u l l y l i n k e d a n r e a d y t r u n . Y o c a u s t h U n c o m p a c t o r I a n C o m p a c t o rI o a n s t a n d a r d B a s i c p r

g r a m t h a t d o e s n o c o n t a i n e b e d d e d a s s e m b l y l a n g u a g e r o t i n e s .

A m e n t i o n e d i t h C o p a c t o r I a r t i c l e , d o n ' t u s e aq u e s t i o n m a r k a a a b b r e v i at i o n f o P r i n t i P r i n t # c o m a n d s . T h e l i n e w i l l s t i l l l i s tc o r r e c t l y , b u i n t e r n a l l y t h c o d e i i n c o r r e c t a n w i l lg e n e r a t e a S y n t a x e r r o r i e e c u t e d . B s u r e y o a l w a y st y p e t h e n t i r e c o m m a n d —P R I N T # — t o a v o i d p r o b l e m s . (

A d d r e s s a l a u t h o r c o r r e s p o nd e n c e t R o b e r t W B a k e r , 1 W i n d s o r D r i v e , A t c o , N 0 8 0 0 4 .

1

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 22/94

B Y M I K E K O N S H A KI y o w a n t t c o m p u t e r i z ea l t h o s e r e c o r d s y o h a v e t k e e p t r a c k o f h e r e ' s d a n d yd a t a b a s e p r o g r a m t h a t w i l lg i v e y o i n f o r m a t i o n i j i f f y . ( T h e f i r s t o t w p a r t s . )

d a t a b a s e i o n o t h m o r e p r a c t i c a l a n u s e f u l p r g r a m s t h a t c o m p u t e r o w n e rc a h a v e . I n f o r m a t i o n s t o r a g eh a s a l w a y s b e e n o n o t h m j o a r e a s o e m p h a s i s i t h c o m p u t e r i n d u s t r y , a n f o t h p e r s o n a l c o m p u t e r i s t t h e r e a r m a n y a p p l i c a t i o n s , p a r t i c u l a r l yi m a i n t a i n i n g f i l e s s u c h a f a m i l y r e c o r d s , C h r i s t m a s c a r dl i s t s , r e c i p e f i l e s , i n v e n t o r i e s o p e r s o n a l p o s s e s s i o n s a n a n t h i n g e l s e y o m i g h t w a n t t k e e p t r a c k o i h a n d y a n d o g a n i z e d m a n n e r .

D a t a b a s e s t a k e m a n y f o r m sa n m a b p r o g r a m m e d i s e v e r a l w a y s , a c c o r d i n g t y o u rn e e d s a n d t h e e x t e n t o t h d a t a t b o r g a n i z e d a n s t o r e d . D a t a b a s e s n o r m a l l y r q u i r e s o m e t y p e o m a s s s t o ra g d e v i c e , s u c h a t a p e o d i s k d r i v e t h a t w i l l k e e p t h r e c -

I I f i H T

A n A S C I I o C o m m o d o r ep r i n t e rC o m m o d o r e 6 w i t h 1 5 4 1 d i s kd r i v e

D a t a f i l e

o r d s f o l a t e r p r o c e s s i n g .P r i n t e r s a r e a l s o m a j o r p

r i p h e r a l u s e d w i t h d a t a b a s e s .T h e y p r o d u c e t h h a r d c o p y r p o r t s w i t h o u t w h i c h t h a c c u mu l a t i o n o f r e c o r d s w o u l d b e t r e m e l y h a r d t a n a l y z e . A f t e ra l l , w h a t g o o d i t h c o m p u t e rw i t h o u t o u t p u t ?R e l a t i v e R e c o r d s

d a t a b a s e i e s s e n t i a l l yp r o g r a m t h a t c r e a t e s p r o g r a mt h a t c o l l e c t s a n p r o c e s s e sr e c o r d s a c c o r d i n g t y o u rw i s h e s a n n e e d s . I c o n s i s t so r e c o r d s a n f i e l d s . r e c o r di b a s i c a l l y c o l l e c t i o n o i n f o rm a t i o n i t h f o r m o f i e l d s ,e a c h o n c o n t a i n i n g i n f o r m at i o n u n i q u e t o t h a t r e c o r d . A l r e c o r d s i p a r t i c u l a r d a t a b a s eh a v e t h s a m e n u m b e r o f i e l d sc o n t a i n i n g t h e s a m e t y p e s o i n f o r m a t i o n .

F o e x a m p l e , c o n s i d e r t h f o l l o w i n g d a t a b a s e , c o n t a i n i n g

l i s t o f a m i l y m e m b e r s a n f r i e n d s w i t h t h e i r b i r t h d a y s a n g i f t p r e f e r e n c e s :D A T A B A S E : B i r t h d a y s1 N a m e : M i k e K

B o r n : 0 5 - 2 8 - 4 7L i k e s : C o m p u t e r s

2 N a m e : B e c k y K B o r n : 0 6 - 2 7 - 5 8L i k e s : C l o t h e s

3 N a m e : S a r a h K B o r n : 0 9 - 1 0 - 7 5L i k e s : D r a w i n g

4 N a m e : G e o r g e S B o r n : 0 7 - 0 3 - 5 0L i k e s : W i n e

1

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 23/94

5 N a m e : L e s l i e Z B o m : 0 1 - 1 8 - 4 3L i k e s : B o o k s

I t h i s d a t a b a s e , c a l l e d B i r t hd a y s , t h e r e a r c u r r e n t l y f i v er e c o r d s . E a c h r e c o r d c o n t a i n st h r e e f i e l d s , e n t i t l e d N a m e ,B o r n a n L i k e s . T h i n f o r m at i o n i e a c h f i e l d i t h a c t u a ld a t a t h a t ' s b e i n g r e c o r d e d a n o r g a n i z e d . S u c h d a t a i s o m et i m e s c a l l e d a i t e m .

A y o u c a n s e e , t h d a t a i n o l i s t e d i a n p a r t i c u l a r s q u e n c e o r o r d e r . O n o t h f e t u r e s o d a t a b a s e p r o g r a m i t h a b i l i t y t m a n i p u l a t e o s o r tr e c o r d s i a l p h a n u m e r i c s q u e n c e , a c c o r d i n g t p a t i c u l a r f i e l d . O b v i o u s s o r t sw o u l d b i n t o l i s t s b n a m e o b b i r t h d a y . I t h i s w a y o u ' db a b l e t p r i n t o u l i s t o r e c o r d s i a n c o n v e n i e n to r d e r .

F o e x a m p l e , i s o r t w e r ep e r f o r m e d o t h f i r s t f i e l d( N a m e ) , t h o r d e r o t h r e c o r d sw o u l d b 2 - 4 - 5 - 1 - 3 . N o t i c et h a t t h s o r t w a k e y e d f r o mt h f i r s t n a m e , n o t h i n i t i a l o t h l a s t n a m e . S o r t s a l w a y ss t a r t w i t h t h l e f t m o s t w o r d sa n c h a r a c t e r s . I t h k e f i e l dw a B o r n , t h o r d e r w o u l d b 5 - 1 - 2 - 4 - 3 . N o t i c e t h a t t h i s s o r ti d e t e r m i n e d b t h f i r s t n m e r i c c h a r a c t e r , w h i c h h a p p e n st b t h m o n t h , n o t h y e a r .M a i n D a t a b a s e F e a t u r e s

F e a t u r e s f o u n d i m o s t d a t ab a s e s i n c l u d e :

A D a d d i t i o n a l r e c o r d s .M O D I F Y e x i s t i n g r e c o r d s .D E L E T E r e c o r d s f r o m d a t a

b a s e .

S O R T r e c o r d s b y f i e l d .L I S T r e c o r d s o t h s c r e e n .P R I N T l i s t o r e c o r d s o t h

p r i n t e r .S E A R C H f o o n o m o r e

s i m i l a r r e c o r d s .

W h e n t h P r i n t f e a t u r e i c h o s e n , y o t y p i c a l l y h a v e t h a b i l i t y t f o r m a t t h l i s t o r e o r d s i v a r i o u s f o r m s a n a r a n g e m e n t s . M a i l i n g l a b e l s a n r e p o r t s a r e x a m p l e s o c o m o u s e s . R e p o r t s t y p i c a l l yh a v e h e a d i n g s a t h e t o p o t h p a g e , w i t h t h e d a t a i t e m s l i s t e di c o l u m n s b e l o w t h h e a d i n g s .

N o e v e r y f i e l d o r e c o r dn e e d s t b p r i n t e d i t h i n f o rm a t i o n i s o m e f i e l d s i n o u s e f u l f o t h r e p o r t . Y o n o m a l l y d e s i g n t h f o r m a t f o p a r t i c u l a r r e p o r t o r t y p e o m a i li n l a b e l a n s a v e i o d i s k f o l a t e r u s e . Y o u s u a l l y s t o r e f o m a t s s e p a r a t e l y f r o m t h i n f o rm a t i o n i t h d a t a b a s e .

T h r e c o r d s i d a t a b a s ea r n o r m a l l y s t o r e d o d i s k .T a p e d r i v e s a r a l s o u s e d , b u a r v e r y s l o w , e s p e c i a l l y w h e nd e a l i n g w i t h l a r g e n u m b e r o r e c o r d s . T a p e d r i v e s a l w a y ss t o r e t h d a t a b a s e i t h f o r mo s e q u e n t i a l f i l e , w h i l e d i s k -b a s e d s y s t e m s c a s t o r e t h r e c o r d s i e i t h e r s e q u e n t i a l o

r e l a t i v e f i l e .S e q u e n t i a l f i l e s i n v o l v e l o a d

i n t h e n t i r e d a t a b a s e f r o mt h d i s k i n t o t h c o m p u t e r ' sm e m o r y . Y o t h e n m a n i p u l a t et h e r e c o r d s , a n t h i n f o r m at i o n i p r i n t e d o u w h i l e t h em e m o r y c o n t a i n s t h d a t a b a s e .W h e n y o u ' v e c o m p l e t e d a l d e s i r e d o p e r a t i o n s , t h e u p d a t e dd a t a b a s e i s a v e d b a c k t t h

1

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 24/94

d i s k . Y o n o r m a l l y s c r a t c h t h o l i n f o r m a t i o n b e f o r e s a v i n gt h n e w .

S e q u e n t i a l f i l e s l o a d e d i n t om e m o r y a l l o w v e r y f a s t o p e r at i o n s o t h d a t a . T h m a j o rd r a w b a c k i t h a t t h c o p u t e r ' s m e m o r y c a p a c i t y l i m i t st h s i z e o f t h d a t a b a s e o t h n u m b e r o r e c o r d s . I t ' s v e r y i p o r t a n t t k e e p t h n u m b e r o f i e l d s i r e c o r d s m a l l , a w e l la t k e e p t h e l e n g t h o t h i t e m s i e a c h f i e l d t m i n i m u m . T h i s w i l l a l l o w t h m a x i m u m n u m b e r o r e c o r d s .

I c o n t r a s t t s e q u e n t i a lf i l e s , r e l a t i v e f i l e s s t o r e d a t a i s p e c i f i e d d i s k a r e a s c a l l e d s e t o r s . Y o c a n a c c e s s a n m n i p u l a t e e a c h r e c o r d w i t h o u ta f f e c t i n g o t h e r r e c o r d s . S i n c ey o c a o n l y p e r f o r m o p e r at i o n s d i r e c t l y o t h d i s k ,i n s t e a d o i m e m o r y , t h e s es y s t e m s m a b v e r y s l o w , e p e c i a l l y w h e n y o p e r f o r m s o r ti n o p e r a t i o n s .

P r i n t i n g o p e r a t i o n s p u l l t h d a t a d i r e c t l y f r o m t h d i s k o n r e c o r d a t i m e . T h i s a l s ot a k e s l o n g e r t h a n i w o u l d w i t h

m e m o r y - b a s e d s y s t e m . T h m a i n a d v a n t a g e o r e l a t i v e f i l e si t h a t t h d a t a b a s e c a n s t o r eo v e r t h r e e t i m e s a m a n y r e o r d s a m e m o r y s y s t e m .

A n o t h e r a d v a n t a g e i t h a ty o c a d e v e l o p m o r e c o p l e x a n e x t e n s i v e d a t a b a s ep r o g r a m , s i n c e m e m o r y s p a c ei n o n e e d e d f o l o a d i n g r e o r d s . R e l a t i v e f i l e s y s t e m s c a a d f e a t u r e s s u c h a m a t he m a t i c a l c a l c u l a t i o n s o f r e co r d s , g r a p h i c s r o u t i n e s t p l o to u d a t a a n s c r e e n f o r m a t t i n g

t o a i d i e n t e r i n g d a t a .

D a t a f i l e D e s c r i p t i o nD a t a f i l e i m e m o r y - b a s e d ,

m u l t i p l e - p r o g r a m d a t a b a s es y s t e m f o t h C o m m o d o r e 6 4 I u t i l i z e s s e q u e n t i a l f i l e s o 1 5 4 1 d i s k d r i v e , a n a n A S C I Io C o m m o d o r e p r i n t e r . c h o s e

m e m o r y - c o n t r o l l e d s y s t e mb e c a u s e m o s t h o m e u s e r s o p e r s o n a l c o m p u t e r s d o n ' t n e e d

l a r g e n u m b e r o r e c o r d s .A l s o , y o c o u l d p r o b a b l y b e t t e ru s t h t i m e s p e n t i f r o n t o t h c o m p u t e r f o m o r e r e c r e at i o n a l a c t i v i t i e s , l i k e p r o g r a mm i n g , t h a n i w a i t i n g f o d i s k - b a s e d s y s t e m t p e r f o r m ,e s p e c i a l l y w h e n u s i n g t h s l o w1 5 4 1 .

D a t a f i l e a l l o w s y o t c r e a t ey o u r o w d a t a b a s e , c h o o s i n gt h n u m b e r a n l e n g t h o f i e l d s ,a w e l l a t h e i r t i t l e s . T h p r g r a m w i l l c a l c u l a t e t h m a x im u n u m b e r o r e c o r d s t h a tc a b r e t a i n e d i m e m o r y a c o r d i n g t t h c r i t e r i a y o e s t a b l i s h e d . A f t e r y o u ' v e c r a t e d a d a t a b a s e a n a d d e d r e o r d s , y o c a p e r f o r m s t a n d a r do p e r a t i o n s o t h d a t a a n s a v e t d i s k o p r i n t o u t t h er e s u l t s i v a r i o u s f o r m a t s .

D a t a f i l e u s e s s e v e r a l t e c hn i q u e s t s a v e t i m e a n m e o r s p a c e . T h e m a i n B a s i c p r g r a m , D a t a f i l e , i t y p i c a l l yl o a d e d f i r s t a t h b e g i n n i n g o R A M . W h e n r u n , t h p r o g r a me s t a b l i s h e s t h e e x i s t e n c e o e v e r y v a r i a b l e t h a t D a t a f i l e a n i t s u b p r o g r a m s w i l l u s e , b s e t t i n g e a c h v a r i a b l e t d u m v a l u e .

1

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 25/94

S t r i n g v a r i a b l e s a r s e t n u l l [ A C H R $ ( 0 ) ] o s o m ev a l u e p e r t i n e n t t t h p r o g r a m ,a n f l o a t i n g p o i n t a n i n t e g e rv a r i a b l e s a r a s s i g n e d v a l u eo z e r o [ 0 ] F i n a l l y , w h e t h e r

f i l e o d a t a i c r e a t e d a t h s t a r t o t h p r o g r a m o b l o a di n a e x i s t i n g f i l e , t h e a r r a y sa r d i m e n s i o n e d l a s t . T h i s h a

t w o - f o l d p u r p o s e . I a l l o w sp r o g r a m s t l o a d o t h e r p r g r a m s a n a l s o m i n i m i z e s t h t i m e t h c o m p u t e r h a t s p e n dm a n a g i n g t h m e m o r y .

T h e m a i n p r o g r a m c a l o a do t h e r s u b p r o g r a m s f r o m t h d i s k , r e m o v i n g i t s e l f f r o m m e o r t a l l o w r o o m f o t h n e p r o g r a m i t h s a m e m e m o r yc e l l s . T h n e p r o g r a m w i l lt h e n b a b l e t u s t h s a m ev a r i a b l e v a l u e s a n d a t a w h i c hw e r e s e a n r e t a i n e d d u r i n gt h o p e r a t i o n o t h f i r s tp r o g r a m .

T h i s o n l y w o r k s a l o n g a t h s e c o n d p r o g r a m i s m a l l e ri m e m o r y r e q u i r e m e n t s t h a nt h f i r s t . T h e s e c o n d p r o g r a m ,h o w e v e r , c a l o a d t h e f i r s t o n e ,e v e n t h o u g h t h f i r s t i s l a r g e r ,b e c a u s e t h m e m o r y s p a c ew a a l l o c a t e d w h e n D a t a f i l ef i r s t w a l o a d e d .G a r b a g e C o l l e c t i o n T i m e

T h C o m m o d o r e a r c h i t e c t u r ei s u c h t h a t a t h p r o g r a m e c o u n t e r s v a r i a b l e s d u r i n g e e c u t i o n a n d , e x c e p t f o s t r i n g s ,g i v e s t h e m v a l u e s , t h o s e v a l u e sa r e s t o r e d d i r e c t l y a b o v e t h B a s i c p r o g r a m . W h e n a a r r a yi d i m e n s i o n e d , t h c o m p u t e rw i l l a s s i g n t h e m p t y c e l l sd i r e c t l y a b o v e t h v a r i a b l ev a l u e s t a r r a y d a t a .

C o n s e q u e n t l y , a s t h c o p u t e r e n c o u n t e r s n e v a r ia b l e t h a t i h a n o s e e n b e f o r e ,i w i l l s t a r t s h o v i n g t h e a r r a yh i g h e r u i m e m o r y , c e l l b c e l l , u n t i l e n o u g h r o o m i a v a i l a b l e f o t h n e v a r i a b l e .{ E v i d e n t l y , v a r i a b l e s g e l o n e l yi t h e y ' r e n o t o g e t h e r . )

A f t e r t h a r r a y s , s t r i n g s a r s t o r e d . B a s i c h a s a n a s t y h a b i to r e a p p r o p r i a t i n g m e m o r ys p a c e t h a t ' s h o l d i n g s t r i n g s ,i o r d e r t f r e e u t h m e m o r yf o p o s s i b l e f u t u r e n e e d s . T h i sp r o c e d u r e , c a l l e d g a r b a g e c o l e c t i o n , i n o r m a l l y i n v o k e dw h e n t h B a s i c s t a t e m e n tF R E ( O ) i s i n u s e . G a r b a g e c o l e c t i o n t a k e s t i m e , e s p e c i a l l yw h e n d e a l i n g w i t h l a r g e a r r a y sc o n s i s t i n g o f s t r i n g s , s u c h a t h o s e c r e a t e d b D a t a f i l e .

I t ' s p o s s i b l e t l o s e c o n t r o lo y o u r c o m p u t e r f o s e v e r a lm i n u t e s w h e n t h i s h a p p e n s ,a n i w i l l o c c u r e v e r y t i m e a o t h e r n e v a r i a b l e c o m e sa l o n g . a d v i s e y o t k e e p t h i si m i n d w h e n p r o g r a m m i n gw i t h a r r a y s . I t ' s b e s t t k e e pt h n u m b e r o v a r i a b l e s t m i n i m u m a n t p r e d e f i n et h e m b e f o r e d i m e n s i o n i n ga r r a y s .

A j u s t m e n t i o n e d , t h e p r og r a m r e t a i n s a l t h e r e c o r d d a t ai n s i d e m e m o r y , e v e n t h o u g hp r o g r a m s a r b e i n g r e m o v e da n r e p l a c e d w i t h o t h e r p r g r a m s . T h s u b p r o g r a m s p e f o r m o p e r a t i o n s a n m a n i p ul a t e t h e r e c o r d d a t a a u t i l i t i e ss e r v i n g t h m a i n p r o g r a m . I t h r o u t i n e s a n s e r v i c e s p r o v i d e db t h s u b p r o g r a m s D F R e p o r ta n d D F M a i l w e r e c o m b i n e dw i t h D a t a f i l e i n t o o n l a r g e p r o -

1

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 26/94

g r a m , t h e r e w o u l d b l e s ss p a c e l e f t f o r e c o r d s .

T h e S u b p r o g r a m sT h f o l l o w i n g i b r i e f d

s c r i p t i o n o f t h f u n c t i o n o e a c h o t h s u b p r o g r a m s .{ N o t e : F o r e a s o n s o s p a c e ,t h s u b p r o g r a m s D F R e p o r t a n dD F M a i l w i l l a p p e a r n e x t m o n t h ,a l o n g w i t h d e t a i l e d d e s c r i pt i o n o e a c h . )

T h D a t a f i l e m a i n p r o g r a mc r e a t e s t h e d a t a b a s e , d e f i n i n gt h n u m b e r o f i e l d s p e r e c o r d ,t h t i t l e s a n l e n g t h s o f i e l d s ,a n t h n u m b e r o p o s s i b l e r e o r d s , b a s e d o n h o t h f i e l d sw e r e s e u p D a t a f i l e a l s o s o r t st h f i e l d s i a l p h a n u m e r i c a lo r d e r , d e p e n d i n g o w h i c h f i e l di c h o s e n .

D a t a f i l e a l s o a c t s a t h c o t r o l l i n g p r o g r a m f o d i s k - r e l a t e do p e r a t i o n s , s u c h a s l o a d i n g( r e a d i n g ) a n s a v i n g ( w r i t i n g )d a t a f i l e s , f o r m a t t i n g b l a n kd i s k s , r e a d i n g t h e d i r e c t o r y a n c h o o s i n g w h i c h s u b p r o g r a m st a d v a n c e t o

T h e D F M a i l s u b p r o g r a m i d e s i g n e d t p r i n t m a i l i n g l a b e l sa n h a t h c a p a c i t y t d e t e rm i n e w h i c h f i e l d s w i l l b p r i n t e d o w h i c h l i n e s o t h l a b e l . D F M a i l p r i n t s o a n s i n g l e - r o w , t r a c t o r - f e e d l a b e l s ,a n d c a n a d j u s t t h n u m b e r o l i n e s p e l a b e l a n t h n u m b e ro c h a r a c t e r s p e l i n e .

O n c e t h l a b e l ' s f o r m a t i d e s i g n e d a n s a v e d f o f u t u r eu s ( i s p e c i a l f o r m a t f i l e s ) , y o h a v e t h a b i l i t y t s e a r c ht h r o u g h t h d a t a f i l e s f o s l e c t e d r e c o r d s w i t h c o m m o nf i e l d s ( e . g . , N a m e S m i t h ) o r t op r i n t t h e n t i r e d a t a f i l e . I o t h e r

w o r d s , y o c a p i c k a n c h o o s e a y o l i k e .

T h D F R e p o r t s u b p r o g r a m i d e s i g n e d t p r i n t r e p o r t s o t h C o m m o d o r e 1 5 2 5 E o M P S 8 0 1p r i n t e r , a w e l l a a n A S C I I -t y p e p r i n t e r w i t h s u i t a b l e i n t e rf a c e . D F R e p o r t h a s b e e n t e s t e ds a t i s f a c t o r i l y o O k i d a t a , E p s o na n d G e m i n i d o t - m a t r i x p r i n t e r s ,a w e l l a o t h e B r o t h e r d a i s y -w h e e l t y p e w r i t e r / p r i n t e r .C a r d c o i n t e r f a c e w a u s e d w i t ha l o t h a b o v e h a r d w a r e .

Y o h a v e t h c a p a b i l i t y t f o r m a t t h r e p o r t i o r d e r t p r e s e n t t h e r e c o r d s i t h w a b e s t s u i t e d t o y o u r n e e d s . Y o c a s a v e t h f o r m a t f o r e c a l lw h e n a n o t h e r r e p o r t m u s t b p r i n t e d . Y o c a p r i n t u t 1 3 c h a r a c t e r s a c r o s s t h e p a g e , d p e n d i n g o t h c a p a c i t y o y o u rp r i n t e r . T h C o m m o d o r e p r i n te r w i l l o n l y p r i n t r e p o r t s u t a 8 0 - c h a r a c t e r w i d t h .

t i t l e c o n s i s t i n g o f o u rl i n e s w i l l b c e n t e r e d a t h t o o t h p a g e , f o l l o w e d b c o u m h e a d i n g s . Y o c a d e f i n eu t e i g h t c o l u m n s w i t h t h w i d t h a n l o c a t i o n o e a c h . Y o c a a l s o d e f i n e t h e c o l u m nt i t l e s , a l t h o u g h t h e s e n o r m a l l yh a v e t h s a m e n a m e s a t h r e c o r d f i e l d s t h a t w i l l b p r i n t e db e l o w t h h e a d i n g s . Y o m a t h e n s e a r c h s e l e c t i v e l y f o t h r e c o r d s t b p r i n t e d i t h c o l u m n s .

F o l o n g r e p o r t s , t h p r i n t e rw i l l a u t o m a t i c a l l y n u m b e r t h p a g e , a d v a n c e t t h n e x t p a g e ,a n p r i n t c o l u m n h e a d i n g sb e f o r e b e g i n n i n g t p r i n t m o r er e c o r d s . F o r a f a s t e r p r i n t o u t o ft h r e c o r d s , n o n f o r m a t t e dp r i n t u t i l i t y i p r o v i d e d t h a t l i s t s

1

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 27/94

e a c h r e c o r d a n e v e r y f i e l dw i t h i n t h r e c o r d i r o w s i s t e a d o c o l u m n s . T h i s p r i n t o u tc a b c u a n p a s t e d o c a r d s .

A l t h a b o v e p r o g r a m s s a v ed a t a f i l e s o f o r m a t f i l e s u n d e rs p e c i a l n a m e s t h a t c a n b e l o a de o n l y b t h p r o g r a m t h a ts a v e d t h f i l e . I m a n y c a s e st h n a m e g i v e n t t h o r i g i n a ld a t a f i l e w h e n t h d a t a b a s e w a c r e a t e d w i l l a l s o b u s e d a r e f e r e n c e o f o r m a t f i l e s c r a t e d b D F R e p o r t a n d D F M a i l .T h i s f e a t u r e h e l p s y o u k e e pt r a c k o w h i c h f o r m a t w e n t w i t hw h i c h d a t a f i l e . C o n s e q u e n t l y ,D a t a f i l e , D F R e p o r t a n d D F M a i lc o u l d e a c h h a v e f i l e n a m e dX m a s M a i l , b u w o u l d l o a d o n l yt h e i r r e s p e c t i v e f i l e .

D a t a f i l e I n s t r u c t i o n sY o b e g i n b t y p i n g L O A D

" D A T A F I L E " , 8 R E T U R N > W h e n t h e d i s k d r i v e s t o p s r u n i n g , t y p e R U < R E T U R N > .

T h s c r e e n t h e n d i s p l a y s t h m a i n m e n u , w h i c h r e s e m b l e st h f o l l o w i n g . ( T e x t o l e t t e r ss u r r o u n d e d b b r a c k e t s d e n o t er e v e r s e d v i d e o c h a r a c t e r s , n o rm a l l y i d e n t i f y i n g a k e y t b p r e s s e d . )[ D A T A F I L E M E N U ]

[ C ] R E A T E N E F I L E[ A ] D D R E C O R D T C U R R E N T F I L E[ M J O D I F Y R E C O R D I C U R R E N T F I L E[ D ] E L E T E R E C O R D I C U R R E N T F I L E[ R ] E A D O L F I L E F R O M D I S K[ P J R I N T R E C O R D S B S E L E C T I O N[ V ] I E W F I L E O S C R E E N[ S ] O R T R E C O R D S B F I E L D[ W ] R I T E N E F I L E T D I S K[ F J O R M A T D I S K[ $ D I S K D I R E C T O R Y[ Q ] U I T P R O G R A M

P R E S S T H A P P R O P R I A T E K E Y

T H E R E A R E R E C O R D S I M E M O R YS P A C E F O R M O R E R E C O R D S( N o t e : T h l a s t l i n e w i l l n o b d i s p l a y e d u n t i l f i l e h a s b e e nc r e a t e d o l o a d e d f r o m d i s k . )

Y o c a n c h o o s e a n o t h 1 o p t i o n s b p r e s s i n g t h k e t h a t r e p r e s e n t s t h f i r s t l e t t e r o t h o p t i o n , a l t h o u g h C r e a t e o R e a d s h o u l d b e t h f i r s t o n c h o s e n w h e n y o b e g i n . T h p r o g r a m w i l l j u m p t t h r s p e c t i v e s u b r o u t i n e w i t h o u ty o u r h a v i n g t p r e s s t h r e t u r nk e y . W h e n p a r t i c u l a r s u b r o ut i n e h a s c o m p l e t e d i t c h o r e s ,i w i l l a l w a y s r e t u r n t t h i sm e n u .

I t ' s g o o d i d e a t c r e a t e as m a l l d a t a b a s e a f i r s t , i o r d e rt b e c o m e f a m i l i a r w i t h D a t a -f i l e . D o n ' t p u t o m u c h e f f o r ti n t o t h f i r s t g o - a r o u n d . E x p e r im e n t b i t c h e c k o u t h e p r og r a m ' s c a p a b i l i t i e s . T h f o l l o wi n i s t e p - b y - s t e p d e s c r i p t i o no w h a t t e x p e c t w h e n y o s l e c t o p t i o n s f r o m t h m a i nm e n u .

C r e a t e N e F i l eT r t m a x i m i z e t h a v a i l a b l e

m e m o r y s p a c e b k e e p i n g t h n u m b e r o f i e l d s a n t h l e n g t h s o t h n a m e s t m i n i m u m . T h l e n g t h s o t h f i e l d s s h o u l d a l w a y s b r e s t r i c t e d t o l e s s t h a n 7 c h a ra c t e r s .

H e r e ' s p r a c t i c e f i l e , w h i c hw e ' l l c a l l N a m e s a n A g e s . I w i l l h a v e t w f i e l d s , t h f i r s to n t b c a l l e d N a m e , a n t h s e c o n d o n e A g e . W e ' l l o n l y b p u t t i n g f i r s t n a m e s i o u d a t a b a s e , s o l e n g t h o t e c h a r a c t e r s f o f i e l d s h o u l d b a d e q u a t e . W w i l l b p u t t i n g

1

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 28/94

t h p e r s o n ' s a g i f i e l d 2 s t w c h a r a c t e r s s h o u l d s u f f i c e .P r e s s t h r e t u r n k e a f t e r e v e r yp r o m p t . T h p r o g r a m c o n t i n u e sw i t h :

H O M A N Y F I E L D S I E A C HR E C O R D ?

F I E L D # 1T I T L E ? N A M EL E N G T H ? 1 0

F I E L D # 2T I T L E ? A G L E N G T H ?T h c o m p u t e r w i l l t h e n c a l c ul a t e a c l o s e l y a p o s s i b l e t h n u m b e r o r e c o r d s t h a t c a b s t o r e d :Y O U R S E L E C T I O N S W I L L A L L O W 1 1 1 0M A R E C O R D S . [ A ] C C E P T O [ R ] E J E C T ?P r e s s A I i p r e s s e d , t h p r o g r a m w i l l r e t u r n t t h p o i n tw h e r e y o a r a s k e d f o t h n u m b e r o f i e l d s i e a c h r e c o r d .T h i s g i v e s y o t h c h a n c e t c h a n g e t h f i e l d s i c a s e y o d i d n ' t g e a m a n y r e c o r d s a y o w e r e e x p e c t i n g .

I y o p r e s s A t h m a i nm e n u s h o u l d a p p e a r , a n t h b o t t o m l i n e s h o u l d t e l l y o a g a i n h o m a n y r e c o r d s t h m e m o r y c a h o l d . T h i s w i l ld e c r e a s e b o n e v e r y t i m e y o a d n e r e c o r d .

A d R e c o r d t C u r r e n t F i l eA f t e r p r e s s i n g o t h m a i n

m e n u , t h s c r e e n d i s p l a y s :P R E S S T H [ R E T U R N ] K E Y A F T E R

E A C H E N T R YP R E S S [ R E T U R N ] W I T H O U T A N

E N T R Y T O S T O P

[ R E C O R D N U M B E R 1

N A M E ? M I K EA G E ? 3

N o t y p e i a b o u t t e r e o r d s s y o u ' l l h a v e s o m e t h i n gt p l a y w i t h . I y o t r t e n t e ri n t o a n f i e l d m o r e c h a r a c t e r st h a n t h a t f i e l d w a i n i t i a l i z e df o r , y o u ' l l r e c e i v e a e r r o rm e s s a g e . Y o w i l l n o t i c e t h d u m m y c h a r a c t e r b e h i n d e a c hi n p u t s t a t e m e n t . T h i s i u s e d t r e s e r v e t h s p a c e w h i l e t h c o m p u t e r i w r i t i n g t h s e q u e nt i a l f i l e t t h d i s k .

Y o s t o p a d d i n g r e c o r d s b yp r e s s i n g t h r e t u r n k e w i t h o u tm a k i n g a e n t r y i t h f i r s tf i e l d . T h i s d o e s n ' t w o r k o n s u c e e d i n g f i e l d s b e c a u s e i t ' s a s u m e d t h e r e ' s s o m e d a t a t h e r et h a t n e e d s t b s a v e d . T h i sa l s o a l l o w s y o t f i l l i b l a n k sl a t e r i i n f o r m a t i o n i u n k n o w na t h t i m e .

I t ' s i m p o r t a n t t n o t e t h a tD a t a f i l e u s e s I n p u t s t a t e m e n t st h a t d n o a l l o w t h u s o q u o t a t i o n m a r k s , c o m m a s ,s e m i c o l o n s o c o l o n s a p a r t o fd a t a i t h f i e l d s . A l o t h e ra l p h a n u m e r i c c h a r a c t e r s a r a c c e p t a b l e .

M o d i f y R e c o r d i C u r r e n t F i l eI y o p r e s s M , y o w i l l s e e :

M O D I F Y W H I C H R E C O R D ? E N T E R [ # O [ A ] L L

I y o w a n t t c h a n g e j u s to n p a r t i c u l a r r e c o r d , e n t e r t h n u m b e r o t h r e c o r d { t r y 1 ) t h e n p r e s s t h r e t u r n k e y .P r e s s i n g w i l l d i s p l a y a l t h r e c o r d s i t h f i l e o n a t i m e .P r e s s i n g b r i n g s t h i s t t h s c r e e n :T M O D I F Y R E C O R D N U M B E R 1

M A K E C H A N G E S A E A C H F I E L D I D I S P L A Y E D , T H E N [ R E T U R N ]

2

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 29/94

N A M E ? M I K EA G E ? 3

A y o u c a n s e e , t h i s f o r m a ti s i m i l a r t t h A d o p e r a t i o n ,e x c e p t t h a t t h d a t a i p r p r i n t e d f o y o u o n t h s c r e e n .P r e s s t h r e t u r n k e o n c e , a c e p t i n g t h e n a m e , t h e n u p d a t et h a g b t y p i n g o v e rt h 3 w i t h 3 7 p r e s s t h r e t u r n k e y .

T h m a i n m e n u s h o u l d r e a pp e a r a g a i n . I t h e n t i r e f i l e i g o i n g t b m o d i f i e d , h o l d i n gt h r e t u r n k e d o w n w i l l s c r o l lt h r o u g h t h d a t a . I i b e s t ,t h o u g h , t f i n d t h e r e c o r d y o w a n t w i t h t h e V i e w f u n c t i o n .

D e l e t e R e c o r d i C u r r e n t F i l eP r e s s i n g g i v e s y o u :

D E L E T E W H I C H R E C O R D ? E N T E R [ # O [ A J L L

D o n ' t b a f r a i d t o p r e s s o t h i s o n e . R e c o r d s w i l l n o b d e l e t e d u n l e s s y o u ' v e g i v e n t h eg o - a h e a d t d s f i r s t . F o t h i se x a m p l e , e n t e r 1 t h e n p r e s st h r e t u r n k e y , w h i c h d i s p l a y s :T D E L E T E R E C O R D N U M B E R 1

P R E S S [ S H I F T ] [ D ] , P R E S S ( S P A C EB A R ] T A D V A N C ET h e n t i r e r e c o r d i d i s p l a y e d

s t h a t y o u ' l l b a w a r e o t h t o t a l c o n t e n t s o t h e r e c o r d b f o r e y o t r t d e l e t e i t . I f y o w a n t t d e l e t e t h r e c o r d , h o l dt h s h i f t k e d o w n w h i l e y o p r e s s t h k e y .

T h t o t a l n u m b e r o r e c o r d si t h f i l e w i l l b d e c r e a s e d b o n e , a n a l t h r e c o r d s a f t e rt h o n y o d e l e t e d w i l l b r n u m b e r e d a c c o r d i n g l y . I y o d e c i d e n o t d e l e t e t h r e c o r da f t e r a l l , j u s t p r e s s t h s p a c eb a a n i w i l l a d v a n c e y o t

t h n e x t r e c o r d o r b r i n g y o b a c k t t h m a i n m e n u . R m e m b e r t s a v e y o u r r e v i s e df i l e .

R e a d O l F i l e f r o m D i s kT h i s u t i l i t y i n o r m a l l y p e

f o r m e d a t h s t a r t o D a t a f i l et l o a d p r e v i o u s l y s t o r e d f i l e .T h p r o g r a m p r o m p t s w i t h :E N T E R N A M E O F I L E T B L O A D E D

T y p e i t h n a m e o t h d a t a f i l e a n p r e s s t h r e t u r nk e y . T h f i l e w i l l l o a d a n y o u ' l lr e t u r n t t h m a i n p r o g r a m . I t h r e t u r n k e i p r e s s e dw i t h o u t a f i l e n a m e p r e s e n t , t h p r o g r a m w i l l a l s o e x i t s a f e l yb a c k t t h m a i n p r o g r a m .P r i n t R e c o r d s b S e l e c t i o n

T h i s u t i l i t y a d v a n c e s y o t a n o t h e r m e n u , d e s i g n e d t l o a ds u b p r o g r a m s t h a t w i l l a c t u a l l yp e r f o r m t h p r i n t i n g o p e r a t i o n s .I n r e c o r d s a r p r e s e n t i m e m o r y , y o u ' l l b d i r e c t e d b a c kt t h m a i n m e n u .[ P R I N T E R M A I N M E N U ]

P R I N T R E C O R D S U S I N G :

[ R ] E P O R T S A N L I S T S[ M J A I L I N G L A B E L S[ U ] S E R D E F I N E D S U B P R O G R A MI E J X I T T M A I N M E N U

P R E S S T H A P P R O P R I A T E K E r e t u r n s t h p r o g r a m t t h

m a i n m e n u , l o a d s u D F R e p o r t a n w i l l l o a dD F M a i l . P r e s s i n g r e s u l t s i n E N T E R N A M E O S U B P R O G R A M

H e r e y o c a l o a d u p r g r a m s t h a t m i g h t p e r f o r m o t h e ro p e r a t i o n s o y o u r d a t a t h a tD a t a f i l e d o e s n o p r o v i d e . N o

2

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 30/94

e n t e r i n g a n f i l e n a m e a a l w i l lg e y o b a c k t t h p r i n t e rm e n u .

U s e r - D e f i n e d S u b p r o g r a ms e r v e s t l o a d p r o g r a m t h a ty o m i g h t w r i t e t e n h a n c ey o u r p a r t i c u l a r d a t a f i l e . O n e a m p l e m i g h t b e p r o g r a m t h a ta d d s u p a l t h n u m e r i c v a l u e si o n f i e l d o d a t a f i l e . T h i sc o u l d , f o e x a m p l e , b f i e l dt h a t h o l d s t h c u r r e n t v a l u e f o h o u s e h o l d i n v e n t o r y i t e m s , g i i n y o q u i c k l y t h e t o t a l v a l u ef o i n s u r a n c e p u r p o s e s .

M a n y v a r i a t i o n s a r p o s s i b l e .Y o w i l l h a v e t s t u d y t h e p r og r a m l i s t i n g s t f i n d t h v a r ia b l e n a m e s r e q u i r e d t g e t t h ec o r r e c t d a t a . M o r e o t h i s l a t e r .

V i e w F i l e o S c r e e nE n t e r i n g t h i s r o u t i n e d i s p l a y s

t h f i r s t r e c o r d i t h d a t a f i l ew i t h t h e f o l l o w i n g c o m m a n d sb e l o w t h r e c o r d :[ R E C O R D N U M B E R 1 I F I L E ( n a m e o

d a t a f i l e )

( R e c o r d D a t a )

[ N ] E X T , [ L J A S T , [ J J U M P , [ F ] I N D , [ E J X I TP r e s s i n g c a u s e s t h

s c r e e n t s t e p t t h n e x tr e c o r d . Y o c a n w a l k t h r o u g hy o u r e n t i r e d a t a f i l e , o n r e c o r da t i m e , u t y o u r e n r e c o r dw i t h t h i s c o m m a n d . s t e p s y o b a c k w a r d s , d e c r e m e n t i n g e a c hr e c o r d n u m b e r b o n e , t p r e v io u r e c o r d s .

a l l o w s y o t j u m p d i r e c t l yt p a r t i c u l a r r e c o r d n u m b e r ,i n s t e a d o s t e p p i n g o n b o n e .Y o u ' l l b a s k e d f o t h r e c o r dn u m b e r ; t h e n e n t e r y o u r c h o i c ea n p r e s s t h r e t u r n k e y .

i s e a r c h f u n c t i o n t h a t

a l l o w s y o t f i n d r e c o r d f i e l d st h a t s h a r e c o m m o n i t e m s o d a t a . T h s c r e e n d i s p l a y s l i s to t h f i e l d n a m e s o t h c u r e n t d a t a f i l e , t h e n a s k s y o u t e n t e r t h n u m b e r o t h f i e l dy o w i s h t s e a r c h . T h f i e l dn a m e i t h e n d i s p l a y e d a n y o u ' r e a s k e d t E N T E R [ C O MM O I T E M ] . E n t e r t h e s t r i n g o ft e x t t h a t i t b s e a r c h e d a n p r e s s t h r e t u r n k e y .

F o e x a m p l e , i y o c h o s ef i e l d w h i c h w a n a m e d F i r s tN a m e , y o m i g h t e n t e r t h s t r i n g J I M . T h e c o m p u t e r w i l ls e a r c h o u a l r e c o r d s t h a t b g i w i t h J I i t h F i r s t N a m ef i e l d .

N o o n l y w o u l d J I c o m e u p b u J I M M Y w o u l d a l s o b d i s p l a y e d b e c a u s e i b e g i n sw i t h J I M . E n t e r i n g w o u l dc a u s e s e a r c h o a l s t r i n g s i

p a r t i c u l a r f i e l d t h a t b e g a nw i t h a n s o n P r e s s t c o n t i n u e t t h n e x t r e c o r d i t h e s e a r c h .S o r t R e c o r d s b y F i e l d

T h f i e l d n a m e s w i l l b d i p l a y e d , e a c h p r e c e d e d b n u m b e r , a n t h l i s t w i l l b f o l l o w e d b y p r o m p t :W H I C H F I E L D I T B S O R T E D ?

E n t e r i n g o n o t h n u m b e r ss h o w n , f o l l o w e d b R E T U R N ,w i l l s e n d t h c o m p u t e r o f t s o r t o u t h a t p a r t i c u l a r f i e l d i a s c e n d i n g a l p h a n u m e r i c a lo r d e r . T h c o m p u t e r w i l l t e l ly o h o i t ' s d o i n g d u r i n g t h p r o c e s s b y f l a s h i n g t h n u m b e ro t h r e c o r d i t ' s c u r r e n t l y w o r ki n g o n .

D a t a f i l e u s e s S h e l l - M e t z l e rs o r t r o u t i n e . A l t h d a t a i t e m s

2

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 31/94

e n t e r e d i n t o D a t a f i l e a r e s t o r e da s t r i n g v a l u e s i t h a r r a y s ,w h e t h e r t h e v a l u e i i t h f o r mo a l p h a b e t i c a l c h a r a c t e r s o n u m b e r s . T h e r e f o r e , h e r e i p o i n t t c o n s i d e r i t h s o r t i n go s t r i n g v a r i a b l e s t h a t a r n u b e r s : T h f i r s t n u m b e r e c o u n t e r e d w i l l b e c o n s i d e r e dt h f i r s t c h a r a c t e r u s e d f o c o m p a r i n g a g a i n s t a n o t h e rn u m b e r .

G i v e n t h n u m b e r s 2 0 0 0 , 3 a n 1 5 6 , t h s o r t r o u t i n e w i l lc o m p a r e t h i 2 0 0 0 w i t h t h e

i 3 a n t h i 1 5 6 . T h r e s u l t w i l l b s h o w n a t h s q u e n c e 1 5 6 , 2 0 0 0 a n 3 5

T h i s i o b v i o u s l y n o t h i t e n t i o n . Y o c a g e a r o u n dt h i s p r o b l e m b e n t e r i n gn u m b e r s t h a t h a v e t h s a m en u m b e r o d i g i t s . T h e n u m b e r sw i l l n o l o o k l i k e t h i s : 2 0 0 0 ,0 0 3 5 a n 0 1 5 6 , a n w h e ns o r t e d , w i l l b i t h p r o p e ro r d e r : 0 0 3 5 , 0 1 5 6 , 2 0 0 0 .

A l t h r e c o r d s w i l l n o b i d i f f e r e n t o r d e r a c c o r d i n g t

t h c h o s e n f i e l d . I y o w a n t t k e e p t h f i l e i n t h i s o r d e r y o m u s t w r i t e i b a c k o n t o t h d i s k .

{ N o t e : A n d e s i r e d s o r t i n gs h o u l d b d o n e b e f o r e a d v a n ci n t t h P r i n t s u b p r o g r a m s .T h e r e i n f a c i l i t y f o s o r t i n gt h r e c o r d s i t h o s e p r o g r a m s . )W r i t e N e F i l e t D i s k

E n t e r i n g t h i s r o u t i n e p r d u c e s t h i s d i s p l a y :E N T E R N A M E O F C U R R E N T F I L E T

B S A V E D ( 1 C H A R A C T E R S M A X ) .A N E X I S T I N G F I L E W I T H T H S A M E N A M E W I L L B S C R A T C H E D

A m e n t i o n e d p r e v i o u s l y ,

D a t a f i l e a d d s s p e c i a l c h a r a c t e rc o d e s t t h b e g i n n i n g o y o u rd a t a f i l e s a n f o r m a t f i l e s . T h i se n s u r e s t h a t p r o g r a m s w i l l l o a dt h e i r o w f i l e s a n a l l o w t h m u l t i p l e u s o t h s a m ef i l e n a m e s .

W r i t i n g y o u r c u r r e n t d a t a f i l eo n t o t h d i s k i n v o k e s t h f o l l o w i n g o p e r a t i o n s :

D a t a f i l e M a i l L i s t w a r e a di n t o m e m o r y f r o m t h d i s k . I a p p e a r s o t h d i s k d i r e c t o r ya D F M A I L L I S T .

T h c u r r e n t f i l e h a s b e e n u pd a t e d a n t h f i l e i e n t e r e d ,f o w r i t i n g t h f i l e t t h d i s k ,e x a c t l y a t h n a m e t h a t i w a r e a d f r o m , M A I L L I S T .

T h p r o g r a m w i l l c h a n g e t h n a m e o t h l a s t f i l e o t h d i r e c t o r y n a m e d D F M A I L L I S Tt D F M A I L L I S I O L D . N o t i c et h a t t h l a s t f o u r c h a r a c t e r s i t h 1 6 - c h a r a c t e r f i l e n a m e w i l lb r e p l a c e d w i t h ! O L D .• T h e c u r r e n t u p d a t e d f i l e w i l l

t h e n b e s a v e d a s D F M A I LL I S T .

I D F ] M A I L L I S ! O L D w a sa l r e a d y o t h e d i s k d i r e c t o r y ,t h a t f i l e w o u l d b e s c r a t c h e db e f o r e t h e M A I L L I S T f i l e i sr e n a m e d .

I e s s e n c e , D a t a f i l e a l w a y sk e e p s y o u r c u r r e n t d a t a f i l e a w e l l a y o u r l a s t d a t a f i l e . T h i sg i v e s y o t h o p p o r t u n i t y t r e c a p t u r e t h l a s t v e r s i o n o y o u r d a t a . I y o d e s i r e t l o a dt h l a s t v e r s i o n f r o m t h R e a dO l F i l e o t h m e n u , e n t e rM A I L L I S I O L D . D n o i n c l u d et h s p e c i a l c h a r a c t e r s s h o w n a t h b e g i n n i n g o t h f i l e n a m eo t h d i r e c t o r y .

I f o s o m e r e a s o n y o d e s i r e

2

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 32/94

t k e e p t h ! O L D f i l e s , y o m u s t g i v e t h e m n e n a m e t k e e p f r o m s c r a t c h i n g t h e ml a t e r . ( R e m e m b e r , d n o e c e e d 1 c h a r a c t e r s . )F o r m a t a D i s k

T h i s f e a t u r e a l l o w s y o t f o r m a t a b l a n k d i s k f o u s l a t e ro i s a v i n g f i l e s .[ D I S K N A M E . I D ] ?

I n s e r t d i s k i n t o t h e d i s kd r i v e . E n t e r u t 1 6 - c h a r a c t e rh e a d e r f o t h e d i s k n a m e ,f o l l o w e d b c o m m a , t h e nt w o - c h a r a c t e r d i s k I D a n f i n a ll R E T U R N . T h d r i v e w i l lb e g i n t f o r m a t t h d i s k ( t h i st a k e s a p p r o x i m a t e l y 3 1 / 2 m i

u t e s ) . W h e n i i f i n i s h e d , y o w i l l b r e t u r n e d t t h m e n u .

D i s k D i r e c t o r yP r e s s i n g t h s h i f t a n k e y s

w i l l l i s t t h d i r e c t o r y o t h e c u rr e n t d i s k i t h d r i v e . P r e s s a n k e t g e b a c k t t h m e n u .Q u i t P r o g r a m

T h i s c o m m a n d m a k e sc l e a n e x i t o u o t h p r o g r a m . I c l o s e s a l t h f i l e s , p e r f o r m sh o u s e k e e p i n g f u n c t i o n a n l e t sy o k n o w i y o u ' v e f o r g o t t e n t s a v e y o u r c u r r e n t f i l e . A n m o d i f i c a t i o n s t f i l e w i l l t r i gg e f l a g t h a t w i l l p r e v e n t y o f r o m i m m e d i a t e l y l e a v i n g t h ep r o g r a m .

D a t a f i l e P a r t I D F M a i l I n s t r u c t i o n s

Y o l o a d D F M a i l u s i n g t h p r i n t o p t i o n s f o u n d i D a t a f i l e .I i a s s u m e d t h a t d a t a f i l e i c u r r e n t l y h e l d i m e m o r y ; o t h e rw i s e , t h e r e w i l l b n o t h i n g t p r i n t . T h s c r e e n s h o w s :

[ U \ B E L S I Z E ]

[ S J T A N D A R D — 5 R O W S P E R L A B E L7 , 9 B Y 3 V z I N C H E S

[ L ] A R G E - 8 R O W S P E L A B E L1 7 , s B Y 3 V z I N C H E S

[ O J T H E R - C U S T O M L A B E L S I Z E O N U M B E R O C H A R A C T E R S P E R O

N O T E : L A B E L S A R S E P A R A T E D B O N R O

3 C H A R A C T E R S P E R O I S T A N D A R D

P R E S S T H A P P R O P R I A T E K E Y

D F M a i l u s e s " O n e - u p "t r a c t o r - f e e d l a b e l s a n i a d a p ta b l e t a n l e n g t h o r w i d t h o l a b e l . T h s t a n d a r d s i z e l a b e l s( w i t h r o w s o t e x t ) a r e t h em o s t p o p u l a r a n m o s t e a s i l yo b t a i n a b l e , w i t h t h e l a r g e s i z e( r o w s ) b e i n g n e x t i l i n e .P r e s s e i t h e r t h o k e y . I y o u h a v e l a b e l s o n o n - s t a nd a r d s i z e , c h o o s e t h o p t i o ni n s t e a d .

O T H E R i a d a p t a b l e t l e y o c h o o s e t h n u m b e r o r o w s , f r o m t ? a n t h n u b e o c h a r a c t e r s c a b e e xp a n d e d f r o m t h s t a n d a r d 3 u t o 1 3 6 . P u t t i n g y o u r p r i n t e r i n t oc o m p r e s s e d m o d e w i l l a l l o wm o r e c h a r a c t e r s o l a b e l s o s t a n d a r d l e n g t h .

2

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 33/94

S o m e l a b e l s t h a t f i t h n o n -t r a c t o r - f e e d p r i n t e r s g i v e y o t w a c r o s s t h p a g e . T h e s el a b e l s , w h i c h a r e f o u r i n c h e sl o n g , a r u s e d i t h p r i n t e r h a o n l y p i f e e d ( O k i d a t a a n E s o n , f o e x a m p l e ) . T h e s e l o n g e rl a b e l s c a a c c o m m o d a t e 3 c h a r a c t e r s p e r o w , i d e s i r e d .D F M a i l , h o w e v e r , w i l l o n l y p r i n to t h e l e f t m o s t l a b e l s . Y o c a n ,o c o u r s e , f e e d t h l a b e l s i b a c k w a r d s t u s t h o t h e rs i d e .

I < O i p r e s s e d , t h s c r e e n w i l l d i s p l a y :E N T E R N U M B E R O R O W S O

L A B E L ?E N T E R N U M B E R O C H A R A C T E R S

P E R O W ?E n t e r y o u r m o d i f i c a t i o n s

w h e n p r o m p t e d . T h n e x ts c r e e n s h o w s t h m a i n m e n uf o t h e m a i l i n g l a b e l s p r o g r a m ,a f o l l o w s :

M A I L I N G L A B E L S M E N U ]

[ P ] R E - D E F I N E D F O R M A T O [ D ] E F I N E N E F O R M A T

[ C J H A N G E L A B E L S I Z E

[ E ] X I T T O M A I N P R O G R A M O [ R J E P O R T / L I S T I N G P R O G R A M

[ Q ] U I T P R O G R A MP R E S S T H A P P R O P R I A T E K E

P r e s s i n g t h k e r e l o a d sD a t a f i l e i n t o m e m o r y w i t h o u td i s t u r b i n g t h r e c o r d d a t a .c l o s e s t h f i l e s a n t e r m i n a t e st h e n t i r e p r o g r a m . E n d i n g h e r ew i p e s o u a l d a t a . D t h i s o n l yi y o h a v e n o u p d a t e d a n yr e c o r d s a n i y o u h a v e y o u rc u r r e n t d a t a f i l e s t o r e d o d i s k .Y o w i l l b w a r n e d i y o h a v en o d o n e s o

l o a d s t h s u b p r o g r a mD F R e p o r t d i r e c t l y , i n s t e a d o

h a v i n g t g b a c k t t h e D a t a -f i l e p r o g r a m . s e n d s y o u b a c kt t h f i r s t s c r e e n t h a t y o e c o u n t e r e d w h e n y o e n t e r e dD F M a i l . T h i s a l l o w s y o t a l t e rt h s i z e o y o u r l a b e l s a n p r i n t o u t s .

F o r m a t t i n g Y o u r L a b e l sF o r m a t t i n g o f p r i n t e r o u t p u t s

m a b t h m o s t c o n f u s i n ga s p e c t o d a t a b a s e . Y o m u s tb a b l e t o v i s u a l i z e h o y o w a n t t h f i n a l r e s u l t t a p p e a r .T h i s m a s e e m d i f f i c u l t a f i r s t ,b u b e i n g a b l e t c u s t o m i z ey o u r o u t p u t s i c o n s i d e r e ds t r o n g f e a t u r e o d a t a b a s e .

F o r t u n a t e l y , o n c e y o h a v ef o r m a t t e d l a b e l o r r e p o r t( w h e n u s i n g D F R e p o r t ) , y o u ' l lb a b l e t s a v e y o u r d e s i g n f o f u t u r e r e c a l l . F r o m t h e n o n w h e n y o w a n t t p r i n t y o u rl a b e l s , y o u ' l l b a b l e t b r e e z eb t h f o r m a t t i n g r o u t i n e s .

L e t ' s d e s i g n s a m p l e m a i li n l a b e l t h a t w i l l p r o b a b l ym e e t m o s t o y o u r n e e d s .B e f o r e d o i n g t h i s , y o m u s th a v e a p r e v i o u s l y c r e a t e d d a t a -f i l e t h a t ' s c o m p a t i b l e w i t h y o u rl a b e l f o r m a t . T h d a t a f i l e w i l lh a v e t h e f o l l o w i n g s t r u c t u r e :

N a m e o d a t a f i l e : M A I L L I S TN u m b e r o f i e l d s :

F i e i d F i e l d n a m e F i e l d l e n g t hL A S T N A M E 1

F I R S T N A M E 1 C O D E

S T R E E T 3 C I T Y 2

S T A T EZ I

P H O N E 1 M o d i f i c a t i o n s t t h a b o v e

d a t a f i l e m i g h t i n c l u d e s e c o n da d d r e s s l i n e ( e . g . , C O M P A N Y

2

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 34/94

N A M E ) . T h p h o n e n u m b e r i i n c l u d e d i t h d a t a f i l e , b u w i l ln o b p r i n t e d o t h l a b e l s .T h f i e l d C o d e m a b u s e d f o c l a s s i f y i n g t h r e c o r d s ( e . g . ,

r e l a t i v e s , F f r i e n d s ,b u s i n e s s a s s o c i a t e s ) , o r f o

a e m p l o y e e n u m b e r , p r o f e ss i o n a l t i t l e o a a c c o u n t n u b e f o b u s i n e s s p u r p o s e s .D e f i n e N e F o r m a t

N o t h a t t h d a t a f i l e i d e f i n e d , a n a s s u m i n g t h a tr e c o r d s a r p r e s e n t , l e t ' s r e t u r nt w h e r e w l e f t D F M a i l . P r e s si n i t h e M a i l i n g L a b e l sm e n u r e s u l t s i t h i s d i s p l a y ,w h i c h w i l l i n d i c a t e , b r o w s a n c h a r a c t e r s , w h i c h l a b e l s i z e h a b e e n c h o s e n :[ M A I L I N G L I S T F O R M A T ]

T H I S F O R M A T U S E S S I N G L E R O L A B E L S .E A C H L A B E L C O N T A I N S U T R O W S .E A C H R O C A C O N S I S T O T F I E L D S .I T H E L E N G T H O M U L T I P L E I T E M SE X C E E D S 3 C H A R A C T E R S , S O M ED A T A W I L L B C U O F F .[ N U M B E R O R O W S ? ]

A t h i s p o i n t , l e t ' s p a u s e t d i s c u s s w h a t y o u r l a b e l w i l ll o o k l i k e . R o w i l l i n c l u d er e c o r d f i e l d s 1 a n ( L A S TN A M E F I R S T N A M EC O D E ) , i t h a t o r d e r . R o w i l lo n l y h a v e r e c o r d f i e l d( S T R E E T ) . R o w i l l c o n s i s t o r e c o r d f i e l d s 5 a n ( C I T YS T A T E Z I P ) . R o w s a n w i l l n o b u s e d .

T h l a b e l s h o w n o t h s c r e e n i d i v i d e d i n t o f i e l d sp e r r o w . T h e s e a r f o r m a tf i e l d s , n o r e c o r d f i e l d s . T r n o t o g e t t h e m c o n f u s e d . E n t e r

f o t h N U M B E R O R O W S a n p r e s s t h r e t u r n k e y .C H O O S E W H I C H F I E L D S G I W H I C H R O E N T E R [ 0 I A D D I T I O N A L F I E L D S A R N O D E S I R E D .

L A S T N A M E R O F I R S T N A M E F I E L D 1 ? C O D ES T R E E TC I T YS T A T EZ I P H O N EF i e l d 1 i t h i s c a s e , r e f e r s t o

t h f i r s t f i e l d o i t e m o t h f i r s tr o w . I t h i s f i e l d w w i l l p l a c er e c o r d f i e l d 2 w h i c h i d i p l a y e d o t h l e f t o t h s c r e e n .R e s p o n d t t h p r o m p t s o n t h r i g h t o t h s c r e e n a f o l l o w s :R O p r e s s t h r e t u r n k e F I E L D 1 a f t e r e a c h e n t r yF I E L D 2 F I E L D 3

R O F I E L D 1 ? F I E L D 2 F I E L D 3

R O W SF I E L D 1 ? F I E L D 2 F I E L D 3

T h s c r e e n w i l l n o d i s p l a y :D Y O W I S H T R E V I E W Y O U R F O M A A N D / O R M A K E C O R R E C T I O N S ?[ Y ] O R [ N ]

P r e s s i n g w i l l r e p e a t t h l a s t s c r e e n , e x c e p t t h a t t h r e c o r d - f i e l d n u m b e r s w i l l a p e a r a f t e r t h f o r m a t - f i e l dp r o m p t s . P r e s s t a d v a n c e i t t h p r o g r a m .[ S A V E F O R M A T ] [ Y O [ N ] ?

S A V E U N D E R W H A T F I L E N A M E ?M A I L T E S T

Y o w i l l n o t i c e t h a t t h p r o -

2

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 35/94

g r a m p r e - p r i n t s t h f i l e n a m et h a t w a d e t e r m i n e d w h e n y o u rd a t a f i l e w a s a v e d o l o a d e dd u r i n g d i s k o p e r a t i o n . T h i sl i n k s r e c o r d a n f o r m a t f i l e st o g e t h e r s t h a t y o w i l l n o h a v e t r e m e m b e r d i f f e r e n tn a m e s . A t h i s p o i n t a n f o r m a tf i l e s w i t h t h e n a m e M a i l L i s tw i l l b e s c r a t c h e d a t h i s n e f o r m a t i s a v e d . U n l i k e t h ed a t a f i l e s , f o r m a t f i l e s w i l l n o b g i v e n b a c k u p w h e n f i l eo t h s a m e n a m e i r e s a v e da f t e r c h a n g e s . C h a n g e t h n a m e o t h f o r m a t f i l e a t t h i st i m e i y o w a n t t o r e t a i n t h o l f o r m a t , a n p r e s s t h r e t u r nk e y .

T h p r o g r a m w i l l t h e n a v a n c e t w h e r e t h l a b e l s a r a l i g n e d i t h p r i n t e r . J u m pt h e r e n o i y o w i s h , b e c a u s et h e n e x t f e p a r a g r a p h s w i l ld i s c u s s t h s i t u a t i o n w h e r e t h u s e r l o a d s i p r e - d e f i n e d f o m a t .

P r e - d e f i n e d F o r m a tA f t e r p r e s s i n g a t h e M a i l

i n L a b e l s m e n u , t h s c r e e nw i l l d i s p l a y :L O A D F O R M A T F R O M W H A T F I L E ?

M A I L T E S TT h p r o m p t s h o u l d p r e - p r i n t

t h l a s t - u s e d f i l e n a m e . I M A I LT E S T i t h c o r r e c t f o r m a t f i l e ,p r e s s r e t u r n . A s o o n a t h f i l ei l o a d e d , t h p r o g r a m w i l ld i s p l a y :D Y O W I S H T R E V I E W Y O U R F O RM A A N D / O R M A K E C O R R E C T I O N S ?[ Y O [ N

T h i s i t h s a m e q u e s t i o na s k e d w h e n y o f i r s t d e s i g n e dt h f o r m a t . I y o a r n o s u r e i t h f o r m a t y o l o a d e d w a t h c o r r e c t o n e , y o m a c h e c k i

a t t h i s t i m e . T h i s i a l s o g o o do p p o r t u n i t y t m a k e s l i g h tc h a n g e f o o n e - o f - a - k i n d j o b .P r e s s N T h s c r e e n w i l ld i s p l a y :S A V E F O R M A T ? [ Y O [ N

T h i s m a s e e m r e p e t i t i v e , b u i a l l o w s y o t s a v e c h a n g e df o r m a t , o r t o s a v e t h c u r r e n to n u n d e r n e n a m e , o o n n e d i s k . P r e s s N T h p r o g r a mw i l l n e x t d i s p l a y :I N S E R T S I N G L E R O T R A C T O R F E E DL A B E L SR U T E S T L A B E L S T O H E L P P O S I T I O NL A B E L S

P R E S S | T ] E S T L A B E L[ C J H O O S E R E C O R D S

P r e s s i n g w i l l p r i n t r o w s o a s t e r i s k s . T h n u m b e r o r o w sa n c h a r a c t e r s s h o u l d r e f l e c ty o u r l a b e l s i z e a n f o r m a t .P o s i t i o n t h l a b e l s i y o u rp r i n t e r s t h a t t h r o w s a p p e a rc e n t e r e d i t h l a b e l . O n c e t h l a b e l s a r a l i g n e d , p r e s s t a d v a n c e t t h P r i n t O p t i o n sm e n u , w h e r e y o w i l l c h o o s et h e r e c o r d s t p r i n t .P R I N T O P T I O N S M E N U

[ A ] L L R E C O R D S I F I L E[ S ] E L E C T I N D I V I D U A L R E C O R D[ F ] I N D R E C O R D S W I T H C O M M O NF I E L D S[ E p C I T T O M A I N M E N U[ P R E S S T H A P P R O P R I A T E K E Y ]

A t h i s t i m e , y o a c t u a l l y d c i d e w h i c h r e c o r d s y o w a n t t p r i n t , a n t h e n b e g i n p r i n t i n g .( I f , a a n t i m e , y o u d e c i d e t h a ty o w a n t t o l e a v e t h i s s e t i o n — b e f o r e o a f t e r p r i n t i n g —p r e s s t g e b a c k t t h m a i nm e n u . ) T h c h o i c e s a r a f o l l o w s :

2

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 36/94

A l R e c o r d s i F i l eT h p r i n t e r w i l l s t a r t p r i n t i n g

f r o m r e c o r d n u m b e r u n t i l i h a p r i n t e d y o u r e n t i r e d a t a f i l e .S i b a c k w i t h c u o c o f f e e i y o u h a v e l a r g e f i l e .

S e l e c t I n d i v i d u a l R e c o r dT h i s g i v e s y o t h o p p o r t u n i

t y t o p r i n t j u s t o n l a b e l o y o u rc h o i c e . T h i s a s s i s t s y o i m a k i n g l a s t - m i n u t e c o r r e c t i o n so p r i n t i n g j u s t f e r e c o r d so u o y o u r d a t a f i l e . T h s c r e e nd i s p l a y s P R I N T W H I C H R E O R D ? E n t e r t h e r e c o r d n u m b e r ,t h e n p r e s s r e t u r n . I y o t y p e i

n u m b e r h i g h e r t h a n t h s i z eo y o u r d a t a f i l e , y o w i l l r e c e i v ea e r r o r m e s s a g e . Y o m u s tp r i n t s o m e t h i n g t g e b a c k t t h m e n u .

F i n d R e c o r d s w i t h C o m m o nF i e l d sT h i s s e a r c h r o u t i n e o p e r a t e s

i d e n t i c a l l y t o t h o n i t h v i e w o p t i o n o t h e D a t a f i l e p r g r a m . T h s c r e e n w i l l d i s p l a ya l t h f i e l d n a m e s i y o u r d a t a -f i l e t h e l p y o s e a r c h . T h f o l o w i n g l i s t i f r o m t h d a t a f i l ec a l l e d M A I L L I S T . F o t h i s e a m p l e , w w i l l s e a r c h f o a l l a s t n a m e s b e g i n n i n g w i t h S

E N T E R [ C O M M O N I T E M ]( T H E E N T I R E S T R I N G I N O R Q U I R E D )

[ L A S T N A M E ] ?

S E A R C H I N G R E C O R D SI y o f o l l o w e d t h e a b o v e s

q u e n c e , t h s y m b o l w i l l b a i n c r e m e n t i n g n u m b e r t h a t w i l ls t o p w h e n t h p r o g r a m f i n d sr e c o r d w i t h l a s t - n a m e f i e l db e g i n n i n g w i t h S I w i l l t h e np r i n t o u t h a t r e c o r d a n t h e ns t a r t l o o k i n g f o a n o t h e r . I y o h a p r e v i o u s l y s o r t e d t h i s f i l eb l a s t n a m e , a l t h S w o u l db p r i n t e d o n a f t e r a n o t h e r .T h p r o g r a m w i l l c o n t i n u es e a r c h i n g u n t i l i r u n s o u o r e c o r d s . I w i l l t h e n s e n d y o b a c k t t h P r i n t O p t i o n s m e n u .

I y o h a t y p e d i S W Y K O W S K I f o t h l a s t n a m e ,o n l y t h o s e r e c o r d s t h a t p e r f e c tl m a t c h e d , o b e g a n w i t hS W Y K O W S K I , w o u l d b p r i n t e d .

F o r a b u s i n e s s a p p l i c a t i o n ,y o c o u l d u s t h i s f e a t u r e t g r o u p m a i l b z i c o d e . I i a l s o p o s s i b l e t p r i n t o n l yt h o s e r e c o r d s t h a t h a v es p e c i a l c o d e t h a t w a p r e v i o u sl e n t e r e d i t h c o d e f i e l d o t h r e c o r d .

F I N D R E C O R D S W I T H C O M M O NF I E L D S

L A S T N A M EF I R S T N A M EC O D ES T R E E TC I T YS T A T EZ I P H O N E

W H I C H F I E L D I T B S E A R C H E D ?

2

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 37/94

D F R e p o r t I n s t r u c t i o n s

J u s t a w i t h D F M a i l , y o l o a d D F R e p o r t u s i n g t h p r i n to p t i o n s i D a t a f i l e , a n a g a i ni t ' s a s s u m e d t h a t d a t a f i l e i i m e m o r y ; o t h e r w i s e , t h e r e i n o t h i n g t p r i n t . T h s c r e e ns h o w s :

R E P O R T P R I N T O U T M E N U

( L J I S T R E C O R D S U N F O R M A T T E D O I P J R E - D E F I N E D F O R M A T[ D ] E F ! N E N E F O R M A T

[ E ] X I T T O M A I N P R O G R A M O [ M J A I L I N G L A B E L P R O G R A M

[ Q ] U I T P R O G R A M

P R E S S T H A P P R O P R I A T E K E Y

T h i s m e n u f u n c t i o n s l i k eD F M a i l . P r e s s i n g r e l o a d sD a t a f i l e b a c k i n t o m e m o r y f o r f u rt h e r u p d a t e s w i t h o u t d i s t u r b i n gt h r e c o r d d a t a . c l o s e s t h f i l e sa n t e r m i n a t e s t h e n t i r e p r g r a m . E n d i n g h e r e w i p e s o u a l d a t a . D t h i s o n l y i y o h a v e n o u p d a t e d a n r e c o r d s a n i y o h a v e y o u r c u r r e n t d a t a f i l e s t o r e do d i s k . Y o w i l l b w a r n e d i y o f a i l t d s o l o a d s t h p r o g r a mD F M a i l d i r e c t l y w i t h o u t f i r s t h a i n t l o a d D a t a f i l e .

W e ' l l b u s i n g t h d a t a f i l e M A I LL I S T , a d e s c r i b e d i t h D F M a i li n s t r u c t i o n s , a a e x a m p l e f i l e t d e m o n s t r a t e t h f o r m a t t i n g a n p r i n t o u t s o D F R e p o r t . D u m m yd a t a w i l l b u s e d .

L i s t R e c o r d s U n f o r m a t t e dT h i s f u n c t i o n i b f a t h

s i m p l e s t w a t g e h a r d c o p y o y o u r d a t a f i l e . P r e s s i n g r e s u l t s i n [ P R I N T O P T I O N S M E N U ]

[ A ] L L R E C O R D S I F I L E[ S ] E L E C T I N D I V I D U A L R E C O R D[ F ] I N D R E C O R D S W I T H C O M M O N F I E L D[ E J X I T T O M A I N M E N U

P O S I T I O N P A P E R I P R I N T E R A T O O P A G E

P R E S S T H A P P R O P R I A T E K E YT h i s m e n u f u n c t i o n s e x a c t l y a

t h o n i D F M a i l , w i t h o n e c e p t i o n . I n s t e a d o c e n t e r i n g y o u rm a i l i n g l a b e l , y o a r e r e q u i r e d t a d v a n c e y o u r p r i n t e r t t h e t o p o t h e n e x t p a g e . R e f e r t t h m a i lp r o g r a m f o i n s t r u c t i o n s o t h a b o v e m e n u . r e c o r d p r i n t e d u f o r m a t t e d w i l l r e s e m b l e t h f o l l o w i n g :[ R E C O R D # 1 ]L A S T N A M E — - K O N S H A KF I R S T N A M E M I K EC O D ES T R E E TC I T YS T A T EZ I P H O N E

I R E C O R D # 2 ]L A S T N A M E

A U T H O R4 8 2 1 H A R V E S T C O U R T

- - . C O L O R A D O S P R I N G SC O L O R A D O

- — 8 0 9 1 73 0 3 / 5 9 6 - 4 2 4 3

e t c .

A y o c a s e e , t h e r e c o r dd a t a i p r i n t e d i r o w s , w h i c hw a s t e s c o n s i d e r a b l e p a p e r . A t h o u g h t h i s p r i n t o u t i q u i c k -a n d - d i r t y , i c a b c u o u a n p a s t e d o n t o c a r d s o f i l e d i s m a l l c a b i n e t s o f o l d e r s .

P r e - D e f i n e d F o r m a tP r e s s i n g r e s u l t s i n

L O A D F O R M A T F R O M W H A T F I L EM A I L L I S T

E n t e r t h e d a t a f i l e f o r m a t t b e u s e d f o p r i n t i n g y o u r r e p o r t ,t h e n p r e s s t h e r e t u r n k e y . T h n a m e o t h l a s t d a t a f i l e l o a d e d

2

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 38/94

i D a t a f i l e w i l l b p r e - p r i n t e df o y o a f t e r t h p r o m p t .C h a n g e t h n a m e b o v e r s t r i k -i n g . T h s c r e e n t h e n d i s p l a y s :D O Y O U W I S H T O R E V I E W Y O U R F O M A A N D / O R M A K E C O R R E C T I O N S [ Y O [ N ] ?

P r e s s i n g s e n d s y o t h r o u g h t h D e f i n e N e F o r m a tr o u t i n e . T h c u r r e n t v a l u e s o y o u r f o r m a t w i l l b d i s p l a y e d .A l t e r b o v e r s t r i k i n g t h v a l u e sa n p r e s s i n g r e t u r n . A l s o p r e s sr e t u r n t a c c e p t t h v a l u e s .P r e s s i n g g i v e s y o u :S A V E F O R M A T [ Y O [ N ] ?I y o m a d e a n c h a n g e s , g a h e a d a n r e s a v e y o u r n e f o m a b p r e s s i n g Y K e e p i n g t h s a m e f i l e n a m e w i l l s c r a t c h t h o l f o r m a t . A f t e r N , y o w i l lp r o g r e s s t t h P r i n t O p t i o n sm e n u , w h i c h h a s b e e n p r e v io u s l y d e s c r i b e d .D e f i n e N e F o r m a t

T h i s r o u t i n e c r e a t e sc u s t o m f o r m b a s e d o y o u r d s i g n . I w o u l d b g o o d i d e a t s k e t c h o u o a s h e e t o g r a p hp a p e r o p r o g r a m m e r ' s p a dw h a t y o w a n t y o u r r e p o r t t l o o k l i k e . Y o w i l l n e e d t d e c i d e t h f o l l o w i n g :7 H o m a n y c h a r a c t e r s w i d ew i l l t h r e p o r t b e U t 1 3 c h a r a c t e r s m a b p r i n t e d , i y o u r p r i n t e r i c a p a b l e o c o p r e s s i n g t e x t . E i g h t y c h a r a c t e r si n o r m a l . R e p o r t w i d t h s l e s st h a n 8 c h a r a c t e r s w i l l b p r i n t e d l e f t - j u s t i f i e d o t h p a p e r .2 H o s h o u l d y o u r t i t l e r e a d ?U t f o u r l i n e s a r p o s s i b l e ,w h i c h w i l l b c e n t e r e d a t h t o o t h p a g e .3 H o m a n y c o l u m n s w i l l y o

n e e d ? T h i s w i l l d e p e n d o w h i c h f i e l d s o y o u r d a t a f i l ey o w i l l w a n t l i s t e d . U t e i g h tc o l u m n s a r a l l o w e d .4 W h a t i t h w i d t h , i c h a r a ct e r s , o e a c h c o l u m n ? T h i s w i l ld e p e n d o n t h c o m b i n e dc h a r a c t e r l e n g t h o t h r e c o r df i e l d s t h a t y o c h o o s e f o e a c hc o l u m n . T h t o t a l n u m b e r o c h a r a c t e r s p e r m i s s i b l e i a l t h c o l u m n s c o m b i n e d i 8 ( o 1 3 w i t h p r i n t e r s i c o m p r e s s e dp r i n t m o d e ) , w i t h t w c h a r a c t e r s b e t w e e n c o l u m n s .C h o o s i n g e i g h t c o l u m n s l e a v e sy o 7 c h a r a c t e r s f o r e c o r df i e l d s ( 1 4 c h a r a c t e r s u s e d i s p a c i n g ) .5 W h i c h r e c o r d f i e l d s w i l l b i e a c h o t h c o l u m n s ? A s i f o m a t t i n g D F M a i l m a i l i n g l a b e l s ,y o w i l l b a b l e t c o m b i n e u t t h r e e r e c o r d f i e l d s i e a c hc o l u m n .6 W h a t w i l l b t h h e a d e rn a m e o e a c h c o l u m n ?h e a d e r n a m e c a n n o t b e l o n g e rt h a n t h c h o s e n w i d t h o t h c o l u m n .

T r t r e m e m b e r t h l e n g t ho e a c h f i e l d i n t h d a t a f i l e t h a tw i l l b o t h i s r e p o r t . I t h r e o r d a t a c o n t a i n e d w i t h i n t h f i e l d i l o n g e r t h a n t h w i d t h o t h r e p o r t c o l u m n , s o m e e n c h a r a c t e r s w i l l b c u o f f .

L e t ' s d e s i g n r e p o r t u s i n gt h d a t a f i l e M a i l L i s t , w h i c h w i l lg i v e u r e f e r e n c e l i s t o t h r e c o r d s i t h f i l e . W w i l l u s f i r s t a n l a s t n a m e s ( 1 c h a r a ct e r s ) , s t r e e t a d d r e s s ( 2 0 ) , c i t y( 1 6 ) , s t a t e a n z i c o d e ( 8 ) , a n p h o n e n u m b e r ( 1 2 ) . T h i s c o p r i s e s t o t a l o 7 c h a r a c t e r s ,w h i c h w w i l l p u i n t o c o l -

3

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 39/94

u m n s ( w i t h s p a c e s b e t w e e nc o l u m n s ) f o t o t a l o 8 c h a ra c t e r s . T h r e p o r t w i l l l o o k l i k eT a b l e 1

N o g o b a c k t t h p r o g r a mt f o r m a t t h a b o v e r e p o r t .P r e s s i n g f r o m t h R e p o r tP r i n t o u t m e n u s e n d s y o u t o [ R E P O R T S I Z E ] U T 1 3 C H A R A C T E R S W I D E

P R I N T E R M U S T B I N I T I A L I Z E D F O W I D T H S G R E A T E R T H A N 8 C H A R A C T E R S .C H E C K Y O U R P R I N T E R M A N U A L O H O T P R I N T 1 3 C H R SN U M B E R O F C H A R A C T E R S ? 8

[ T I T L E F O R M A T ) P R O V I D E S F O L I N E S O I N F O R M A T I O N A T T H E T O PO F T H E F O R M :

T I T L E # 1 ? M A I L L I S T R E C O R D ST I T L E # 2 J A N U A R Y 2 3 1 9 8 4T I T L E # 3 T I T L E # 4

[ C O L U M N F O R M A T ] U T C O U M N S W I T H S P A C E S B E T W E E NC O L U M N S :

N U M B E R O C O L U M N S ?P O S I T I O N O C O L U M N # 1

C O L U M N # 2 1 < 1 2 C O L U M N # 3 4 < 1 2 2 C O L U M N # 4 ? 5 9 < 4 + 1 2 C O L U M N # 5 6 < 5 2

[ H E A D I N G F O R M A T ] C O L U M NH E A D I N G S C A N N O T E X C E E D W I D T HO C O L U M N S :

C O L U M N H E A D I N G ? L A S T / F I R S TN A M E

C O L U M N H E A D I N G ? S T R E E TA D D R E S SC O L U M N H E A D I N G ? C I T YC O L U M N H E A D I N G ? S Z I C O L U M N H E A D I N G ? P H O N EN U M B E RC H O O S E W H I C H F I E L D S G U N D E RT H C O L U M N SE N T E R [ 0 I A D D I T I O N A L F I E L D S A R N O D E S I R E D

L A S T N A M EF I R S T N A M EC O D ES T R E E TC I T YS T A T EZ I P H O N E

C O L U M N

C O L U M N

C O L U M N

C O L U M N

C O L U M N

F I E L D 1 F I E L D 2 F I E L D 3 F I E L D 1 F I E L D 2 F I E L D 3 ? F I E L D 1 F I E L D 2 F I E L D 3 F I E L D 1 F I E L D 2 F I E L D 3 ? F I E L D 1 ? F I E L D 2 F I E L D 3

D O Y O U W I S H T R E V I E W Y O U R F O RM A A N D / O R M A K E C O R R E C T I O N S [ Y O [ N ] ? < N [ S A V E F O R M A T ] [ Y O [ N < Y

S A V E U N D E R W H A T F I L E N A M E ?M A I L L I S T

T h p r o g r a m n o j u m p s t t h P r i n t O p t i o n s m e n u f o c h o o s i n g t h r e c o r d s t h a t a r t b p r i n t e d . N o y o s h o u l dr e f e r b a c k t t h m a i l i n g l a b e lp r o g r a m i n s t r u c t i o n s .

M A I L L I S T R E C O R D S

J A N U A R Y 2 3 1 9 8 4L a s t / F i r s t . N a m e S t r e e t A d d r e s s C i t y S Z i P h o n e N u m b e r

K o n s h a k M i k e

M o u s e M i c k e yB u n n y B u g sD a n i e l s J a c k

4 8 2 1 H a r v e s tC o u r t1 9 8 4 D i s n e y R o a d2 C a r r o t L a n e5 5 S o b r i e t y B l v d

C o l o r a d o S p r i n g s C 8 0 9 1 7 3 0 3 - 5 9 6 - 4 2 4 3O r l a n d o F 1 0 0 0 1 8 0 0 - 5 5 5 - 1 2 1 2W h a t s u p d o c C A 9 9 9 9 9 1 1 1 - 2 2 2 - 3 3 3 3S o u r m a s h T 7 0 7 0 7 0 0 0 - 8 7 6 - 5 4 3 2

3

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 40/94

A p p e n d i x t D a t a f i l eP r o g r a m m i n g U s e r P r o g r a m s

D a t a f i l e i f l e x i b l e , i t h a ty o m a w r i t e s u b p r o g r a mt h a t c a b c a l l e d f r o m t h P r i n t e r M a i n m e n u i D a t a f i l e .T h b a s i c g r o u n d r u l e s a r e :1 S u b p r o g r a m s c a n n o t b el a r g e r t h a n D a t a f i l e i t s e l f ( a p r o x i m a t e l y 7 4 0 0 b y t e s ) .2 V a r i a b l e n a m e s u s e d s h o u l dn o c o n f l i c t w i t h t h o s e t h a t a r n e c e s s a r y f o m a i n t a i n i n g t h d a t a f i l e s . V a r i a b l e n a m e s u s e di c o u n t e r s , s o r t i n g r o u t i n e sa n m e n u s a r s a f e t b d u p l ic a t e d . T r t m i m i c D F M a i l o D F R e p o r t i t h w a t h e yh a n d l e d a t a a n p e r f o r m o p e r at i o n s . N e v a r i a b l e n a m e s e c o u n t e r e d m a s e n d t h c o p u t e r o f g a r b a g e c o l l e c t i n g .3 Y o u r s u b p r o g r a m s h o u l dh a v e t h f a c i l i t y t l o a d b a c kD a t a f i l e s o y o u c a n c o n t i n u e t u p d a t e a n m a n i p u l a t e y o u rd a t a .4 O p e n p r i n t e r a n d i s k f i l e sp r o p e r l y w h e n e n t e r i n g r o t i n e . E n s u r e t h a t y o c l o s e t h f i l e s b e f o r e a d v a n c i n g t a n o t h e r r o u t i n e o r s u b p r o g r a m .5 I n c l u d e d i s k - c h e c k i n g r o t i n e s t o p r e v e n t p r o g r a mc r a s h e s . C h e c k o u a n o t h t h r e e D a t a f i l e p r o g r a m s f o t h r o u t i n e .6 I i e a s i e s t t m o d i f y o e p a n d D F M a i l o D F R e p o r t i s t e a d o w r i t i n g y o u r o w s u b p r o g r a m . Y o s h o u l d s a f e l yb a b l e t a d 2 0 0 0 b y t e s t D F M a i l a n 1 0 0 0 b y t e s t D F R e p o r t .V a r i a b l e I d e n t i f i c a t i o n

T h f o l l o w i n g i l i s t o a l

t h v a r i a b l e s u s e d i D a t a f i l ea n i t s u b p r o g r a m s . D n o u s e t h e s e v a r i a b l e n a m e s e c e p t f o a c c e s s i n g d a t a . T h e s ev a r i a b l e s n e v e r c h a n g e i u s o p u r p o s e .

n u m b e r o p o s s i b l e r e c o r d sX n u m b e r o c u r r e n t r e c o r d s

i f i l en u m b e r o f i e l d s i e a c h

r e c o r dN F N a m e o c u r r e n t d a t a o

f o r m a t f i l e i n m e m o r yR E C $ < R , F ) r e c o r d d a t a a r r a yF $ < F ) f i e l d n a m e a r r a yL % ( F ) = l e n g t h o f i e l d a r r a yT % ( F ) s o r t i n g b u f f e r a r r a yK % ( R ) p o i n t e r a r r a y , k e e p s

r e c o r d s i s o r t e d o r d e rM L $ ( 9 , 4 ) a r r a y f o c o m b i n i n g

f i e l d s i p r i n t i n g l a b e l s a n r e p o r t s

P C ( 1 0 ) c h a r a c t e r p o s i t i o n a r a f o r e p o r t c o l u m n s

T T $ ( 5 ) r e p o r t t i t l e a r r a yH C $ ( 9 ) c o l u m n h e a d i n g a r r a y

f o r e p o r t sD c h r $ ( 0 ) d u m m y s t r i n gC R c h r $ ( 1 3 ) p r i n t e r a n d i s kc a r r i a g e r e t u r nB 1 c h r $ ( 1 0 ) p r i n t e r l i n e f e e dB c h r $ ( 3 2 ) ' s p a c e 1 c h a r a c t e rE " E O F " e n d - o f - f i l e m a r k e r

o s e q u e n t i a l f i l e sM E 3 1 0 0 0 a v a i l a b l e m e m o r y

( b y t e s ) f o r e c o r d d a t aS , S T , E N E M S , E T E S d i s k

e r r o r v a r i a b l e sT h b a l a n c e o t h v a r i a b l e s

m a b u s e d i u s e r s u b p r og r a m s , b u s h o u l d b a v o i d e di a d d i t i o n s t D F M a i l a n dD F R e p o r t . C o u n t e r s a n r s p o n s e v a r i a b l e s a r e x c e p t e d .C h e c k t h p r o g r a m s c a r e f u l l yf o r c o n f l i c t s .I J L N M Z c o u n t e r s a n

3

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 41/94

t e m p o r a r y b u f f e r sK p r i n t r o u t i n e p o i n t e rA S , C $ , M R S , D R r e s p o n s e s

f r o m m e n u sC c h e c k w h e t h e r o n o f i l e

h a b e e n s a v e dR L = c a l c u l a t e d l e n g t h o

r e c o r dF 1 , F 2 , F f i e l d p o i n t e r b u f f e r sH N S , I D n e d i s k h e a d e r

n a m e a n I . D .S B $ = u s e r s u b p r o g r a m n a m eS f i e l d t b e s e a r c h e d o

s o r t e dA 1 $ , A 2 $ , A 3 $ , A b u f f e r s f o l o a d i n g d i s k d i r e c t o r yP p a p e r w i d t h o r e p o r t

( c h a r a c t e r s )C c o l u m n w i d t h b u f f e rR n u m b e r o r o w s ( l i n e s ) p e

l a b e lN L n u m b e r o f l i n e s f o r e p o r t

t i t l eN n u m b e r o c o l u m n s i

r e p o r tP l i n e c o u n t e r f o a u t o m a t i c

p a g i n g o r e p o r t sI i n p u t r e c o r d s e l e c t i o nT i n p u t c o m m o n s t r i n g t o b

s e a r c h e dt a f o c e n t e r i n g t i t l e s a n

f i r s t c o l u m n o r e p o r tL W n u m b e r o c h a r a c t e r s p e

r o o l a b e l sT n u m b e r o r o w s o l a b e l sP r i n t e r C o d e s f o C o m p r e s s e dP r i n t

M a n y C o m m o d o r e 6 o w n e r sh a v e c h o s e n t a d s t a n d a r dA S C I I p a r a l l e l p r i n t e r s t o t h e i rc o m p u t e r s y s t e m s . T h e s e p r i n te r c o s t m o r e , b u h a v e m a n yc a p a b i l i t i e s a n q u a l i t i e s t h a tm a k e t h p r i c e s e c o n d a r y . I t e r f a c e s t h a t c o n v e r t t h s e r i a lp o r t o t h 6 t p a r a l l e l A S C I Im u s t a l s o b p u r c h a s e d .

O n f e a t u r e t h a t D a t a f i l e i a b l e t u t i l i z e i t h a t o c o p r e s s e d c h a r a c t e r s , a l l o w i n gr e p o r t s t b p r i n t e d t h a t h a v ew i d t h s u t 1 3 c h a r a c t e r s .T h C o m m o d o r e 1 5 2 5 E a n M P S 8 0 1 d n o h a v e t h i s f e t u r e , s y o a r l i m i t e d t r p o r t s 8 c h a r a c t e r s ( t e n c h a ra c t e r s o r c o l u m n s p e i n c h w i d e .S o m e p r i n t e r s w i t h 1 5 - i n c h c a r i a g e s w i l l p r i n t 1 3 c h a r a c t e r si t h n o r m a l m o d e , b u w i l ln e e d t b c o m p r e s s e d i o r d e rt p r i n t 1 3 c h a r a c t e r s o s t a n d a r d 8 V b 1 p i e c e o p a p e r .

T a b l e s h o w s t h p r i n t e rc o d e s a n p r o c e d u r e s t u s t s e y o u r p r i n t e r i n t o c o p r e s s e d m o d e . T h i s s h o u l d b d o n e b e f o r e y o l o a d a n r u D a t a f i l e ( w h i l e y o a r i t e r m in a l , i n s t e a d o p r o g r a m , m o d e ) .

I y o a r a l r e a d y i n t o t h p r o g r a m , a n y o w a n t t s e n dt h p r i n t e r c o m m a n d s , y o m u s t u s t h e f o l l o w i n g p r o c ed u r e s t k e e p f r o m l o s i n g y o u rd a t a f i l e a n p o i n t e r s i m e m o r y :1 W h i l e i t h p r o g r a m , y o m u s t b a o n o t h m a n ym e n u s i D a t a f i l e , D F R e p o r t o D F M a i l . T h e r e s h o u l d n o b f l a s h i n g c u r s o r .2 P r e s s t h r u n / s t o p k e y . A t h b o t t o m o t h s c r e e n , y o u ' l ls e e :B R E A K I 3 ( 3 i t h l i n e n u m b e r

w h e r e t h c o m p u t e rR E A D Y s t o p p e d t h p r

g r a m )[ 3 T y p e i y o u r r e s p e c t i v ep r i n t e r c o m m a n d s e x a c t l y a s h o w n b e l o w i y o a r i t h D a t a f i l e p r o g r a m . I y o h a v e

3

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 42/94

e n t e r e d D F R e p o r t o D F M a i l ,e n t e r j u s t t h l i n e t h a t b e g i n sw i t h P R I N T # 4 . T h p r i n t e r f i l e sa r a l r e a d y o p e n w h e n y o a r i t h e s e p r o g r a m s .4 T y p e i G O T O 3 0 t h e n p r e s sr e t u r n . T h n u m b e r w i l l b d i f f e re n t , d e p e n d i n g o n w h i c h m e n ua n d s u b p r o g r a m y o a r i n 5 Y o w i l l n o b b a c k i t h p r o g r a m a e x a c t l y t h e p l a c ey o l e f t . T a d v a n c e i n t o t h n e x t p a r t o f t h p r o g r a m , p r e s so n o t h k e y s t h a t t h m e n uw a p r e v i o u s l y s h o w i n g . I s o m e i n s t a n c e s , y o m i g h t l o s ep a r t o f y o u r m e n u a t h s c r e e ns c r o l l s u p , s t r t r e m e m b e rw h i c h s e l e c t i o n y o w a n t t p r e s s a t h i s s t a g e . w i l l n o m a l l y e x i t y o t t h p r e v i o u sm e n u o s e n d y o t a n o t h e rp r o g r a m .

( N O T E : T h i s t e c h n i q u e m a b u s e d t s e n d a n y p r i n t e r

c o m m a n d s , n o j u s t c o p r e s s e d m o d e . J u s t m a k e t h a p p r o p r i a t e c h a n g e s t t h C H R S c o d e s . )

I y o u h a v e p r i n t e r t h a t i n o s h o w n i T a b l e 2 r e v i e wy o u r m a n u a l f o t h p r o p e rp r i n t e r c o d e s . O t h e r c o m m a n d so m o d e s t h a t y o m i g h t w a n tt c o n s i d e r w h e n p r i n t i n gr e p o r t s o l a b e l s a r E x p a n d e d( f o r m a k i n g d o u b l e s i z e l e t t e r s ) ;D o u b l e - s t r i k e ( f o r d a r k e r l e t t e r s ) ;a n d C h a n g i n g F o n t s ( d i f f e r e n tl e t t e r s t y l e s ) .

( N O T E : D n o u s m o d e st h a t s k i p o v e r t h e p e r f o r a t i o n s i t h p a p e r . L a b e l s d n o n e e d i t a n r e p o r t s a r a u t o m a t i c a l l yp a g e d b t h p r o g r a m . )

A d d r e s s a l a u t h o r c o r r es p o n d e n c e t M i k e K o n s h a k ,4 8 2 1 H a r v e s t C o u r t , C o l o r a d oS p r i n g s , C 8 0 9 1 7 .

3

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 43/94

T y p e i t h e f o l l o w i n g c o m m a n d s e x a c t l y a s h o w n t p u y o u rp r i n t e r i n t o c o m p r e s s e d m o d e . P r e s s r e t u r n a f t e r e a c h l i n e .

G E M I N I 1 0 X :

9 c h a r a c t e r s ( 1 C P I ) : 1 3 c h a r a c t e r s { 1 C P I ) :

O P E N 4 . 4 O P E N 4 . 4P R I N T # 4 , C H R $ { 2 7 ) C H R $ { 6 6 ) C H R $ ( 2 ) P R I N T # 4 , C H R $ { 2 7 ) C H R $ { 6 6 )

C H R $ { 3 )C L O S E 4 C L O S E 4O K I D A T A 8 2 A :

1 3 c h a r a c t e r s ( 1 6 . 5 C P I ) :

O K I D A T A 9 2 A :9 c h a r a c t e r s ( 1 C P I ) :

O P E N 4 . 4P R I N T # 4 , C H R $ ( 2 8 )C L O S E 4E P S O N R X 8 0 F f T :

9 c h a r a c t e r s { 1 C P I ) :

O P E N 4 , 4P R I N T # 4 , C H R $ ( 2 7 ) C H R $ ( 7 7 )C L O S E 4C I T O H P r o w r i t e r :

9 c h a r a c t e r s ( 1 C P I ) :

O P E N 4 . 4P R I N T # 4 , C H R $ ( 2 7 ) C H R $ ( 6 9 )C L O S E 4

O P E N 4 , 4P R I N T # 4 , C H R $ { 2 9 )C L O S E 4

1 3 c h a r a c t e r s ( 1 C P I ) :

O P E N 4 . 4P R I N T # 4 , C H R $ ( 2 9 )C L O S E 4

1 3 c h a r a c t e r s ( 1 7 . 1 C P I ) :

O P E N 4 . 4P R I N T # 4 , C H R $ ( 1 5 )C L O S E 4

1 3 c h a r a c t e r s ( 1 C P I ) :

O P E N 4 . 4P R I N T # 4 , C H R $ ( 2 7 ) C H R $ { 8 1 )C L O S E 4

N O T E : C h a n g i n g C P o r p i t c h o d a i s y w h e e l p r i n t e r s r e q u i r e s t h a ts u i t a b l e d a i s y w h e e l b i n s t a l l e d . A l t h o u g h c o m m a n d c o d e m a b s e n t , i i e a s i e s t t m o v e t h p i t c h s w i t c h o t h k e y b o a r d t t h p r o p e r s e t t i n g ( 1 0 , 1 o 1 C P I ; i . e . , 8 0 9 o 1 2 c h a r a c t e r s o a 8 1 / 2 - i n c h p a p e r w i d t h ) .N O T E : C h a n g i n g C P o r p i t c h o d a i s y w h e e l p r i n t e r s r e q u i r e s t h a ts u i t a b l e d a i s y w h e e l b e i n s t a l l e d . A l t h o u g h c o m m a n d c o d e m a b s e n t , i i e a s i e s t t m o v e t h p i t c h s w i t c h o t h k e y b o a r d t t h p r o p e r s e t t i n g ( 1 0 , 1 o 1 C P I ; i . e . , 8 0 9 o 1 2 c h a r a c t e r s o a 8 1 / 2 - i n c h p a p e r w i d t h ) . R

3

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 44/94

B K E I T H M E A D ET h i s b a t t l e s h i p g a m ec h a l l e n g e s y o o t w f r o n t s : D e f e n d y o u rf l e e t f r o m e n e m y a t a c k a n l e a r n t h i sp r o g r a m m e r ' s m e m o r ym a n a g e m e n t t i p s t t a k e a d v a n t a g e o t h C - 6 4 ' s s p e c i a l g r a p hi c f e a t u r e s .

Y o a r i c o m m a n d o b a t t l e s h i p . S u b m a r i n e s s i l e n t l ym o v e u n d e r t h a r e a y o d f e n d , s e e k i n g t a t t a c k y o u rf l e e t ' s m o s t v u l n e r a b l e s h i p s .E n e m y p l a n e s p a s s o v e r h e a d i

c o n t i n u o u s s t r e a m .Y o s i a t h c o n t r o l s w i t h

c l e n c h e d j a a n d b e a d e d b r o w .B l a z i n g c a n n o n f i r e a n w e l l -p l a c e d d e p t h c h a r g e s e x t r a c th e a v y t o l l . F o t h r e e t e n s e m i u t e s y o b a t t e r t h o p p o s i t i o nh o r d e s , t h e n e m e r g e i e x u l t a n tv i c t o r y , s p o r t i n g n e h i g hs c o r e .

B a t t l e s h i p W a r , a a r c a d e -s t y l e g a m e f o t h C o m m o d o r e6 4 b e g i n s w i t h a i n s t r u c t i o nd i s p l a y t h a t d e s c r i b e s u s e r c o t r o l s a n t a r g e t p o i n t v a l u e s .

i I G H T

B a t t l e s h i p W a

C o m m o d o r e 6

Y o m u s t , a i a n g o o ds h o o t - ' e m - u p , b l a s t a m a n y o j e c t s a p o s s i b l e — t h e s m a l l e rt h t a r g e t s t h h i g h e r t h e p o i n tv a l u e . T h s u b m a r i n e s c a n b e l u s i v e , b u i y o w a t c h t h e mt o c l o s e l y , t h a i r p l a n e s w i l ls l i p p a s t y o u .

P l a y i n g f o h i g h s c o r e i d e i n i t e l y t h w a t g w i t h B a t l e s h i p W a r . T h c h a m p i o n o t h i s h o u s e h o l d i m w i f e ; a o t h i s w r i t i n g , y o u ' l l n e e d 2 3 3 0p o i n t s t m a t c h h e r b e s t s c o r e .

W h e n t y p i n g t h e p r o g r a m ,o m i t a l r e m a r k s . L i n e s t h a t e n w i t h 9 7 - 9 9 a n c o n t a i n a s t e ri s k s m a a l s o b s k i p p e d . N t i c e t h a t s u b s t i t u t e d d e c i m a lp o i n t s ( p e r i o d s ) f o z e r o e s , t h u ss o m e w h a t s p e e d i n g u t h p r g r a m .

T h g a m e d i s p l a y f o B a t t l es h i p W a i c o m p o s e d e n t i r e l yo r e d e f i n e d c h a r a c t e r s . W h e ny o u s c u s t o m c h a r a c t e r s e t sa n t h C o m m o d o r e ' s o t h e rg r a p h i c s f e a t u r e s , m e m o r ym a n a g e m e n t b e c o m e s p r o bl e m . U n d e r s t a n d i n g w h e r e t s t o r e g r a p h i c s d a t a a n g e t t i n gt h 6 t u s i c a b d i f f i c u l t .I ' l l d i s c u s s t h i s p r o b l e m a n dh o d e a l t w i t h i i B a t t l e s h i pW a r .

w i l l c o n c l u d e w i t h s i m p l er o u t i n e t h a t l e t s y o e a s i l ym o v e s c r e e n R A a n o p e n u

l a r g e a r e a o f f r e e m e m o r y f o s p r i t e s , c h a r a c t e r s e t s , h i g hr e s o l u t i o n d i s p l a y s a n o t h e rf e a t u r e s .

3

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 45/94

D e f i n i n g t h e P r o b l e mY o s h o u l d k e e p i m i n d t h a t

t h C - 6 4 f e a t u r e s t w s e p a r a t es y s t e m s s h a r i n g m e m o r ys p a c e — t h e v i d e o c h i p ( V I C )a n t h B a s i c l a n g u a g e . T h V I c h i p ( n o t t b e c o n f u s e dw i t h t h V I c o m p u t e r ) h a n d l e sa l d a t a a n o p e r a t i o n s t h a tr e l a t e i a n w a t t h e v i d e od i s p l a y . T h V I C , h o w e v e r , h a

l i m i t a t i o n f o w h i c h y o u m u s ta l l o w — t h e c h i p c a n a c c e s s o nl 1 6 o m e m o r y . w i l l r e f e r t t h i s m e m o r y a t h V I v i d e ob a n k .

W i t h i n t h i s b a n k a l d a t a r l a t e d t o t h v i d e o d i s p l a y m u s tr e s i d e . W i t h i n t h V I v i d e ob a n k i a a r e a c a l l s c r e e nm e m o r y , 1 o R A t h a t c o t a i n s d a t a f o t h s t a n d a r d t e x td i s p l a y . Y o w i l l o f t e n s e s c r e e n m e m o r y r e f e r r e d t o a t h v i d e o m a t r i x o c h a r a c t e rp o i n t e r m e m o r y .

( B s u r e a t t h i s p o i n t t h a ty o u u n d e r s t a n d t h c o n c e p t o t h 1 6 V I v i d e o b a n k . D n o c o n f u s e i w i t h t h e s c r e e nm e m o r y , w h i c h i o n l y p o r t i o no t h v i d e o b a n k . )W i t h 6 4 o t o t a l m e m o r y ,t h e r e a r p o t e n t i a l l y f o u r V I b a n k s . N o r m a l l y , t h e V I c h i pi a c c e s s i n g t h f i r s t b a n k . I s e e s t h m e m o r y f r o m a d r e s s e s t 1 6 3 8 4 . l o o k a m e m o r y m a r e v e a l s t h a t t h i si b u s y a r e a . T h o n l y l a r g ec h u n k o f f r e e m e m o r y i w i t h i nt h s p a c e u s e d b B a s i c , b u tu n l e s s y o r e a l l y k n o w w h a t ' sg o i n g o n o n l y u s B a s i c m e o r f o B a s i c p r o g r a m .

S o t h m a j o r m e m o r y m a a g e m e n t p r o b l e m i t h i s : T h e r e

i n o s u f f i c i e n t a v a i l a b l e s p a c et a l l o w u s o t h 6 4 ' s s p e c i a lg r a p h i c s f e a t u r e s . I t h f i r s tV I v i d e o b a n k , t h b u l k o u n u s e d m e m o r y i r e s e r v e d b t h B a s i c s y s t e m f o B a s i c p r g r a m s . A i t u r n s o u t , b o t hB a s i c a n t h V I c h i p a r w i l li n t c o m p r o m i s e . T h B a s i cs p a c e c a b t r i m m e d o n e i t h e re n d . T h V I c h i p c a l o o k a a n o t h f o u r 1 6 v i d e ob a n k s .

T h s i m p l e s t s o l u t i o n w o u l ds e e m t b m o v i n g b a c k t h b e g i n n i n g o B a s i c ' s p r o g r a ma r e a . B a s i c p r o g r a m s n o r m a l l ys t a r t a t a d d r e s s 2 0 4 8 . T h f o l l o w i n g s e q u e n c e w o u l d f r e eu 4 b y t e s .P O K E 6 1 4 4 , 0 : P O K E 4 4 , 2 4 : N E W

B a s i c r e q u i r e s t h a t t h f i r s tb y t e i i t p r o g r a m a r e a b z e r o , s z e r o i t h f i r s t P o k e .T h s e c o n d P o k e s e t s b a c k t h b e g i n n i n g - o f - B a s i c p o i n t e r . T h N e c o m m a n d c a u s e s t h e p r og r a m a r e a t b s t r a i g h t e n e do u w i t h i n i t n e b o u n d a r i e s .

I ' v e s e e n t h i s m e t h o d s u c e s s f u l l y u s e d m a n y t i m e s , b u t h e r e ' s a o b v i o u s d r a w b a c k .p r o g r a m c a n ' t r e s e r v e m e o r f o i t s e l f ; t h e r e m u s t b s e p a r a t e s e t - u p p r o g r a m o y o m u s t m a n u a l l y t y p e i t h c o f i g u r a t i o n s e q u e n c e . A l o n g a t h e r e a r e a l t e r n a t i v e s , t h i st e c h n i q u e s h o u l d b e u n a c c e p ta b l e .

T h b e g i n n i n g o t h B a s i cp r o g r a m a r e a a c t u a l l y c o n t a i n st h f i r s t l i n e s o t h B a s i c p r g r a m i t s e l f . I t ' s c e r t a i n l y u n d e rs t a n d a b l e t h a t w c a n ' t c u o f t h a t c h u n k o m e m o r y w i t h o u td e s t r o y i n g o u p r o g r a m . S

3

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 46/94

w h a t a b o u t t h e o t h e r e n o t h B a s i c a r e a ?

T h v e r y t o o B a s i cm e m o r y i u s e d t s t o r e t h v a l u e s o v a r i a b l e s ( s p e c i f i c a l l y ,s t r i n g v a r i a b l e s ) . S t e a l i n g f r o mh e r e i g o i n g t z a t h v a r ia b l e s , b u t n o t i c e t h a t t h p r g r a m i t s e l f w i l l s u r v i v e .P O K E 5 5 , 0 : P O K E 5 6 , 1 2 8 : C L R

T h P o k e c o m m a n d s s e t h t o p - o f - B a s i c p o i n t e r d o w n 8 Kb y t e s . T h C L R c o m m a n df o r c e s B a s i c t r e b u i l d i t v a r ia b l e s y s t e m a t h n e w , l o w e rl o c a t i o n . A f t e r e x e c u t i o n o t h i sc o m m a n d , a l s t r i n g v a r i a b l e sa r n u l l a n a l n u m e r i c s a r e q u a l t z e r o .

C l e a r l y , t h d r a w b a c k t t h i sm e t h o d i m a n a g e a b l e a n d , a y o w i l l s e e , r e c o m m e n d g i n w i t h i t T h s e c r e t i t r e s e r v e t h m e m o r y b e f o r e y o d e c l a r e o u s a n v a r i a b l e s . T b s a f e , d e v o t e t h f i r s t l i n e o y o u r p r o g r a m s t t h f u n c t i o no c l e a r i n g t h i s s p a c e , i n e e d e d .

T h B a s i c c o m m a n d s q u e n c e i t h l a s t p a r a g r a p hs e t s t h t o l i m i t o B a s i c a a d d r e s s 3 2 7 6 8 . R e m e m b e r t h V I v i d e o b a n k s ? W e l l , t h t h i r db a n k b e g i n s a a d d r e s s 3 2 7 6 8 .P e r f e c t !P O K E 5 6 5 7 6 , 5

B e l i e v e i o n o t , t h i s i s t r u c t s t h V I c h i p t t a k e a l d a t a f r o m t h t h i r d v i d e o b a n k .S o w h i l e y o u ' v e l o s t 8 o B s i R A ( I ' v e n e v e r w r i t t e np r o g r a m a n y w h e r e n e a r 3 0 b y t e s l o n g ) , y o u ' v e g a i n e d f r e ea n c l e a r m e m o r y f o u s o c u s t o m g r a p h i c s .

Y o C a B a n k o I U n f o r t u n a t e l y , t h a c t u a l

s t r u c t u r e o t h n e v i d e o b a n ki c o m p l i c a t e d , b u b e a r w i t hm e Y o d o n ' t n e e d t u n d e rs t a n d i a a l i y o u ' r e w i l l i n g t oa b i d e b t h r u l e s a n a d d r e s sb o u n d a r i e s I ' p r e s e n t i n g .

F r o m a d d r e s s 3 2 7 6 8 t 3 6 8 6 3i 4 c h u n k t h a t c a b e u s e dn o r m a l l y i a n w a y o s e f i t .

A d d r e s s e s 3 6 8 6 4 t 4 0 9 5 9 a r t h V I c h i p ' s 4 " b l i n d s p o t "i t h i s v i d e o b a n k . T h V I i n o r e s t h R A i t h i s r a n g ea n d , i n s t e a d , s e e s t h c h a r a c t e rs e R O M , w h i c h c o n t a i n s t h d e f i n i t i o n s f o t h t w s t a n d a r dC o m m o d o r e c h a r a c t e r s e t s .P e e k s a n d P o k e s i t h B a s i cp r o g r a m w i l l s e t h R A M . Y o c o u l d u s t h i s t s t o r e d a t a o m a c h i n e l a n g u a g e i t h R A M .

A d d r e s s e s 4 0 9 6 0 t 4 9 1 5 1l o o k l i k e 8 o R A t t h V I v i d e o c h i p . B a s i c p r o g r a mP o k e t t h i s a r e a s t o r e s v a l u e si t h a t R A M , b u P e e k s e e sd a t a i t h B a s i c s y s t e m R O c h i p ! I t ' s c o n f u s i n g , b u t h i s i a c t u a l l y v e r y l a r g e a n u s e f u ls t r e t c h o m e m o r y .

J u s t r e m e m b e r t h a t y o u c a nP o k e d a t a i n b u y o c a n e v e rP e e k t h a t d a t a . ( I t ' s p r o b a b l yn o a a p p r o p r i a t e r e g i o n f o s c r e e n m e m o r y , b u w h e nw o u l d y o u e v e r n e e d t P e e k a

r e d e f i n e d c h a r a c t e r s e t ? )S p r i t e s , t o o , w o u l d o f t e n t i m e sb f i n e h e r e . M a c h i n e l a n g u a g ep r o g r a m m e r s w o u l d b a b l e t e x a m i n e t h i s m e m o r y b s w i t c hi n o u t h B a s i c R O M , b u t h a t ' s n o p o s s i b l e i B a s i cr o u t i n e .

S c r e e n m e m o r y , a s y o u r e

3

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 47/94

c a l l , i t h 1 c o n t a i n i n g t h t e x t s c r e e n d a t a . Y o m a d e f i n e s c r e e n m e m o r y a b e i n ga n o n o t h 1 6 - 1 K a r e a sw i t h i n t h v i d e o b a n k .c h a r a c t e r s e i 2 i l e n g t h ,a n d a n y o t h 8 - 2 K r e g i o n s o t h v i d e o b a n k m a b d e s i gn a t e d a s c o n t a i n i n g t h e c h a ra c t e r s e t .

I B a t t l e s h i p W a r , u s e dv a r i a b l e s t h o l d t h e s e l o c a t i o nv a l u e s . S C R A M c o u l d h a v e av a l u e o 0 - 1 5 . S C R A Mm e a n s t h a t s c r e e n m e m o r y r s i d e s i t h f i r s t 1 o t h V I v i d e o b a n k ( t h u s , b e g i n n i n g a 3 2 7 6 8 ) . C H S E T ( v a l u e e q u a l s0 - 1 4 , e v e n ) s p e c i f i e s w h i c h 2 a r e a h o l d s t h c h a r a c t e r s e t .O d v a l u e s o C H S E T s i m p l yh a v e t h s a m e e f f e c t a t h n e x t e v e n n u m b e r b e l o w .

T h V I c h i p c o n t a i n s s i g l r e g i s t e r t h a t s e t s t h l o c at i o n s o s c r e e n m e m o r y a n t h c h a r a c t e r s e t . T h f o l l o w i n gc o m m a n d w i l l w o r k f o a l m e a n i n g f u l v a l u e s o S C R A Ma n C H S E T .P O K E 5 3 2 7 2 , 1 6 ' S C R A M C H S E T

T h B a s i c s y s t e m m u s t b s e p a r a t e l y i n f o r m e d o t h l o c at i o n o s c r e e n m e m o r y s t h a ti c a p r o p e r l y h a n d l e s c r e e ni n p u t a n o u t p u t . T h f o l l o w i n gc o m m a n d w i l l p e r f o r m t h i s .P O K E 6 4 8 , 1 2 8 + 4 * S C R A M

G r a p h i c s R o u t i n e sI n v e s t i g a t i o n o o t h e r

g r a p h i c s f e a t u r e s s h o u l d r e v e a lh o t h e y f i i n t o t h i s m e m o r yc o n f i g u r a t i o n . O b s e r v e i t h p r o g r a m B a t t l e s h i p W a h o t h s y s t e m h a b e e n s p e c i f i c a ll i m p l e m e n t e d .

B e l o w a r t h r o u t i n e s f r o mB a t t l e s h i p W a t h a t c o u l d b u s e d i a n p r o g r a m t r e l o c a t et h e v i d e o b a n k a n d o p e n u s p a c e f o y o u r s p e c i a l g r a p h i c sd a t a .1 0 P O K E 5 5 , 0 : P O K E 5 6 , 1 2 8 : C L R( R e m e m b e r , i i b e s t t h a v e t h i s b t h f i r s t p r o g r a m l i n e . )

1 0 0 0 0 I S C R A M < O S C R A M 1 T H E N P R I N T - S C R E E N R A E R R O R " : S T O P

1 0 0 1 0 I C H S E T < 0 O R C H S E T > 1 5T H E N C H S E T = 4

1 0 0 2 0 P O K E 5 6 5 7 6 , 51 0 0 3 0 P O K E 5 3 2 7 2 , 1 6 * S C R A M + C H S E T1 0 0 4 0 P O K E 6 4 8 , 1 2 8 + 4 - S C R A M1 0 0 5 0 R E T U R N1 0 1 0 0 P O K E 5 6 5 7 6 , 71 0 1 1 0 P O K E 5 3 2 7 2 , 2 01 0 1 2 0 P O K E 6 4 8 , 41 0 1 3 0 R E T U R N

S a v e t h e s e p r o g r a m l i n e s a n u s t h e m . T h e y ' l l m a k e y o u r l i f e

l o e a s i e r , b e l i e v e m e T r e a r r a n g e t h v i d e o , s e

S C R A M e q u a l t 0 - 1 5 , C H S E Te q u a l t 0 - 1 4 ( e v e n ) a n G O S U B 1 0 0 0 0 . T h n e l o c at i o n o s c r e e n m e m o r y w i l l b 3 2 7 6 8 + 1 0 2 4 * S C R A M . T h V I c h i p w i l l e x p e c t t s e t h c h a r a c t e r s e a 3 2 7 6 8 + 1 0 2 4 *C H S E T . C H S E T w i l l p o i n tt h V I t t h s t a n d a r d c h a ra c t e r s e ( f o u p p e r / l o w e rc a s e ) .

S p r i t e s o o t h e r g r a p h i c s f e t u r e s m a e a s i l y b u s e d b k e e p i n g t h p r e v i o u s l y d s c r i b e d V I m e m o r y b a n k s t r u ct u r e i m i n d . R e m e m b e r , i p a t i c u l a r , t h a t t h s p r i t e i m a g ep o i n t e r s a r p a r t o t h s c r e e nm e m o r y a n m o v e w i t h i t

T r e s t o r e t h u s u a l c o n f i g ur a t i o n , e n t e r G O S U B 1 0 1 0 0 . T h

3

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 48/94

d e f a u l t s c r e e n m e m o r y a r e a a l o c a t i o n 1 0 2 4 i n o d i s t u r b e db a n o t h i s a c t i v i t y . T o g g l i n gb e t w e e n t h t w s u b r o u t i n e so f f e r s s i m p l e m e t h o d o p a g ef l i p p i n g , w i t h w h i c h y o m i g h tw i s h t e x p e r i m e n t . r i l c o n c l u d et h i s d i s c u s s i o n w i t h l i t t l ed e m o p r o g r a m t g e y o t h i n ki n g . T y p e i t h e s e l i n e s a l o n gw i t h t h e a b o v e r o u t i n e s ( d o n ' tf o r g e t l i n e 1 0 ) .

B e f o r e y o r u t h p r o g r a m ,n o t i c e t h a t t h P r i n t s t a t e m e n t sa r e o n l y e x e c u t e d o n c e .1 0 P R I N T " ( c l e a r s c r e e n ) "1 1 P R I N T " T H I S I T H O L

S C R E E N . "

1 2 S C R A M 0 : C H S E T = 4 : G O S U B1 0 0 0 0

1 3 P R I N T " ( c l e a r s c r e e n ) "1 4 P R I N T " H E R E I T H N E

S C R E E N ! "1 5 F O R D = 1 T O 1 0 0 0 : N E X T1 6 G O S U B 1 0 1 0 01 7 F O R D T O 1 0 0 0 : N E X T1 8 G O S U B 1 0 0 0 01 9 G E T A $ : I F A $ " G O T O 1 5 2 0 G O S U B 1 0 1 0 0 : E N D

P r e s s a n k e t e n t h e p r og r a m . h o p e y o c a p u t h e s er o u t i n e s t g o o d u s e . D o n ' t f o g e t t r B a t t l e s h i p W a r . H

A d d r e s s a l a u t h o r c o r r e s p o nd e n c e t K e i t h M e a d e , 3 1 1 1 1 5 t hA v e . N W R o c h e s t e r , M 5 5 9 0 1 .

4

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 49/94

B R O B E R T R O S S AF i v e i r o t i c - t a c -t o m a s o u n d e a s y ,b u d o n ' t b d e c e i v e d .T h i s g a m e o f f e r s m o r ec h a l l e n g e t h a n p e h a p s y o u ' r e w i l l i n g t t a c k l e .

S l i d e i s i m p l e s t r a t e g i cb o a r d g a m e t h a t p i t s y o a g a i n s t t h e c o m p u t e r , w h i c hh a s b e e n p r o g r a m m e d w i t hg r e e d y s t r a t e g y a n r a r e l yl o s e s .

S l i d e i p l a y e d o f i v e - b y -f i v e s q u a r e b o a r d w i t h 2 c e l l s .Y o a n t h c o m p u t e r t a k et u r n s e n t e r i n g s i n g l e t o k e n sf r o m t h e t o p ( n u m b e r e d 1 - 5 ) o rt h l e f t ( l e t t e r e d A - E ) . t o k e ne n t e r e d i n t o r o o c o l u m nw i l l s l i d e t o k e n s a l r e a d y p r e se n o t h b o a r d o v e r o d o w no n c e l l . T o k e n s m a b s h o v e do f t h g a m e b o a r d . T h f i r s tp l a y e r t h a v e f i v e t o k e n s i r o w , e i t h e r h o r i z o n t a l l y , v e r t i c a ll o r d i a g o n a l l y , w i n s .

O t h g a m e b o a r d s d r a w nb t h i s p r o g r a m , t h c o m p u t e rh a t h c r o s s e s a n y o h a v e

i I G H T

S l i d e

t h c i r c l e s . I t h s a m p l e p o s it i o n s h o w n i F i g . 1 y o w i ( h o r i z o n t a l l y ) b m a k i n g m o v e 2 b u t l o s e ( d i a g o n a l l y ) b m a k i n gm o v e C

f [ 1 1 1 I t S

h H — 1 — 4 — l - Hf I I

r - I h - h I X I X I I — a . — | l - H

E I | I I L —

F i g . 1 S a m p l ep r o g r a m o u t p u t .

C o m m o d o r e 6

M a k i n g t h B e s t M o v eT h f i r s t f e m o v e s o t h

c o m p u t e r a r r a n d o m , t p r v i d e s o m e v a r i e t y i t h g a m e s .Y o c a s e l e c t h o m a n ym o v e s i a d v a n c e t h c o m p u t e rc a c o n s i d e r — e i t h e r t w o , f o u r ,s i o r e i g h t m o v e s a h e a d . O v i o u s l y , t h m o r e m o v e s a h e a d ,t h m o r e t i m e i w i l l t a k e t h c o m p u t e r t m a k e s e l e c t i o n .Y o c a g r a d u a l l y a d v a n c e t h l e v e l o p l a y a y o l e a r n t h g a m e .

T d e t e r m i n e i t b e s t m o v e ,t h c o m p u t e r m u s t l o o k a t h g a m e t r e e ( s e e F i g . 2 ) E a c h

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 50/94

m o v e i d r a w n a b r a n c h o t r e e . N o t e t h a t t h t r e e i d r a w nw i t h i t b r a n c h e s h a n g i n gd o w n w a r d . E a c h p a t h d o w nw a r d f r o m t h r o o t ( a t h t o p )r e p r e s e n t s a p o s s i b l e s e q u e n c eo m o v e s . E a c h m o v e h a v a l u e , s o y o u c a p i c k t h m o v ew i t h t h l a r g e s t v a l u e .

F o s p e e d , t h m o v e - s e l e ct i o n l o g i c i w r i t t e n i m a c h i n el a n g u a g e . w r o t e t h a l g o r i t h mi B a s i c a n t h e n t r a n s l a t e d i i n t o m a c h i n e l a n g u a g e . I B s i c , a l e v e l 4 , c o u l d m o t h l a w n w h i l e t h e c o m p u t e r w a d e c i d i n g i t n e x t m o v e . A n o t h e rf a c t o r a l l o w i n g m o r e s p e e d i t h u s o p r u n i n g ; w d o n ' th a v e t c o n s i d e r a l p o s s i b l em o v e s f o u r p l a y s a h e a d .

E a c h p o s i t i o n i g i v e n n m e r i c a l w e i g h t , w h i c h i i n t e n de t m e a s u r e p l a y e r ' s a v a n t a g e . I t h p l a y e r w h j u s tm o v e d h a w i n , t h w e i g h t i a l a r g e a p o s s i b l e , i t h i sc a s e , 3 2

I t h o p p o s i n g p l a y e r w i n s ,t h w e i g h t i 3 2 a s m a l l a p o s s i b l e . O t h e r w i s e , t h e w e i g h ti t h a d v a n t a g e t h p l a y e r w h j u s t m o v e d h a o v e r h i o p o n e n t .

T h e r e a r t e p o s s i b l e m o v e sf r o m a n p o s i t i o n . H o c a p l a y e r d e t e r m i n e t h e b e s tm o v e ? S u p p o s e y o a r l o o k i n gj u s t t w l e v e l s a h e a d . F o e a c ho y o u r t e p o s s i b l e m o v e s , y o l o o k a w h a t y o u r o p p o n e n t c a nd o F o e a c h o y o u r p o s s i b l em o v e s , y o u r o p p o n e n t h a t e p o s s i b i l i t i e s , s t h e r e a r 1 0 c o m b i n a t i o n s o m o v e s .

F o e a c h m o v e y o c a m a k e , y o w a n t t k n o w h o w e l l y o u r o p p o n e n t c a n d o S y o a s s u m e t h a t y o u r o p p o n e n tw i l l s e l e c t m o v e b p i c k i n gt h p o s i t i o n o m a x i m u mw e i g h t . T h v a l u e o y o u r m o v ei t h e n t h n e g a t i v e o f t h i sm a x i m u m w e i g h t .

F R O M H I G H E RI T R E E

P L R ' i ' E R

O ~ 0 - 5 O > = O O O P P O N E N T

2 u O ' : ' O • : F L F

F i g . 2 G a m e t r e e , w h i c h r e p r e s e n t s a p o s s i b l e s e q u e n c e o m o v e s .

4

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 51/94

P r u n i n g t h G a m e T r e eI y o s e a r c h f o u r l e v e l s

a h e a d , i s e e m s t h a t y o m i g h th a v e t l o o k a a l 1 0 , 0 0 0 s q u e n c e s : y o m o v e , t h e n y o u ro p p o n e n t m o v e s , t h e n y o m o v e a g a i n , t h e n y o u r o p p on e n t m o v e s . F o e a c h o t h 1 0 0 0 p o s s i b i l i t i e s a l e v e l 3 t h v a l u e i t h n e g a t i v e o y o u r o p o n e n t ' s b e s t p o s s i b l e m o v e .

F o e a c h o t h 1 0 p o s i t i o n sa l e v e l 2 t h v a l u e ( t y o u r o p o n e n t ) i t h e n e g a t i v e o y o u rb e s t p o s s i b l e m o v e . F i n a l l y , a tl e v e l 1 t h v a l u e o e a c h o y o u r t e p o s s i b l e m o v e s i t h n e g a t i v e o y o u r o p p o n e n t ' sb e s t p o s s i b l e m o v e s .

I y o s e a r c h s i x l e v e l sa h e a d , y o u ' l l h a v e 1 , 0 0 0 , 0 0 0 s q u e n c e s a w h i c h t l o o k .C l e a r l y , t h i s i a t e d i o u s t a s ke v e n f o c o m p u t e r . F o r t u n a t el y t h e r e ' s w a o e l i m i n a t i n gm o s t o t h p o s s i b l e s e q u e n ce s — i t ' s c a l l e d p r u n i n g t h g a m e t r e e .

F o e x a m p l e , c o n s i d e r F i g . 2 S u p p o s e i r e p r e s e n t s y o u rk n o w l e d g e a b o u t p a r t i c u l a rp a r t o f g a m e t r e e j u s t a y o f i n i s h f i n d i n g t h v a l u e o t h s e c o n d g a m e p o s i t i o n i t h b o t t o m r o w . W h e n y o f i n d t h a tt h i s v a l u e i 8 t h e n y o u c a n s a t h a t t h v a l u e o t h p o s i t i o nj u s t a b o v e i ( i t s p a r e n t ) c a n ' tb b e t t e r t h a n f o y o u r o p o n e n t .

S i n c e y o u r o p p o n e n t a l r e a d yk n o w s h h a b e t t e r m o v e s , i c l u d i n g o n w i t h v a l u e o 5 t h e r e i n o n e e d t c o n t i n u ee v a l u a t i n g t h e o t h e r p o s s i b i li t i e s ( c h i l d r e n ) o f t h p o s i t i o n .A t h i s p o i n t , y o c a p r u n e t h

g a m e t r e e , t h a t i s s t o p c o s i d e r i n g t h - p o s i t i o n a n m o v e o t t h p o s i t i o n t i t r i g h t i t h f i g u r e .

Y o u ' l l b a b l e t f o l l o w t h i sp r u n i n g p r o c e s s w h e n y o p l a yt h g a m e , s i n c e t h p r o g r a mp l a c e s t h m o v e s i t ' s c o n s i d e ri n o t h e s c r e e n .T h P r o g r a m

T l o a d a n p l a y t h g a m e ,y o u n e e d o n l y e n t e r t h e B a s i cl i s t i n g s . T h f i r s t B a s i c p r o g r a m{ L i s t i n g 1 ) c o n s i s t i n g m o s t l y o D a t a s t a t e m e n t s , P o k e s t h m c h i n e l a n g u a g e n e e d e d b t h g a m e . T h s e c o n d p r o g r a m( L i s t i n g 2 p l a y s t h e g a m e .

L i s t i n g b e g i n s b y p r o t e c ti n t h m a c h i n e c o d e . T h e n i g e t s t h g a m e t r e e ' s d e p t h o s e a r c h b y a s k i n g y o t c h o o s e

l e v e l .T h v a r i a b l e C C i n i t i a l i z e d i

l i n e 9 0 c o u n t s t h m o v e s m a d eb t h c o m p u t e r w h i l e i i p l a yi n r a n d o m l y . T h c o n t r o l f o r a n d o m m o v i n g i i l i n e 2 8 0 .T h v a r i a b l e B i t h m o v en u m b e r , w h i c h i n e e d e d b t h s u b r o u t i n e t h a t u p d a t e s t h s c r e e n a n i n t e r n a l g a m eb o a r d s .

L i n e s 1 0 0 - 1 2 0 d e c i d e w h i c hp l a y e r s t a r t s . A i c o d e f o t h c u r r e n t p l a y e r ; i y o u a n d- i t h c o m p u t e r . L i n e 1 3 i

e x e c u t e d i t h c o m p u t e rm o v e s f i r s t ; i s e t s u t h g a m eb o a r d a n m a k e s t h c o m p u te r ' s f i r s t m o v e . L i n e 1 4 s e t s u t h g a m e b o a r d i y o m o v ef i r s t .

L i n e s 1 5 0 - 2 4 0 o b t a i n p l a ye r ' s m o v e , r e c o d e i f o t h e r o ut i n e t h a t u p d a t e s t h b o a r d a n t h e n c a l l t h a t r o u t i n e .

4

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 52/94

T h g a m e b o a r d i c o d e d i m e m o r y i t h 2 b y t e s s t a r t i n ga l o c a t i o n 2 8 6 7 2 ( i l i n e 4 7 0 ) .W h e n t h s e a r c h r o u t i n e i c a l l e d , i c a l l s i t s e l f r e c u r s i v e l y .I n e e d s u t e i g h t c o p i e s o t h g a m e b o a r d , d e p e n d i n g o nt h l e v e l y o c h o o s e . T h e s e a r l o c a t e d i t h 2 0 b y t e s b e g i nn i n g a l o c a t i o n A

T h b o a r d e v a l u a t i o n r o u t i n e ,c a l l e d f r o m t h B a s i c p r o g r a mb S Y R i l i n e s 2 6 a n 3 2 0 ,n e e d s t k n o w w h i c h o t h e s ee i g h t b o a r d s i i s u p p o s e d t e v a l u a t e . T h i s i t h p u r p o s e o l o c a t i o n L Z w h i c h i P o k e d i l i n e s 2 6 a n 3 2 0 .

T h e v a l u a t i o n r o u t i n e r t u r n s i l o c a t i o n C Z i y o h a v e f i v e i r o w ; o t h e r w i s e , i r e t u r n s 0 L o c a t i o n C Z + 1 i t h r e t u r n f o t h c o m p u t e r , s l i n e s 2 6 a n 2 7 c h e c k t s e i t h e r e i w i n n e r . S a n T k e e p t r a c k o t h n u m b e r o w i n s f o e a c h p l a y e r .

L i n e 2 9 c a l l s t h t r e e s e a r c hr o u t i n e t h a t s e l e c t s t h c o p u t e r ' s m o v e . B i t h m o v ep i c k e d ; i t h c o m p u t e r h a s o nl l o s i n g m o v e s , y o f o r c em o v e l i l i n e 3 0 0 . L i n e 3 1 t h e n u p d a t e s t h e b o a r d . L i n e s3 2 0 - 3 4 0 c h e c k f o w i n n e r a n t h e n c y c l e b a c k f o t h n e x tm o v e . L i n e s 3 5 0 - 3 6 0 c o n t a i nt h l o g i c f o r a n d o m m o v e b t h c o m p u t e r .

T h s u b r o u t i n e a 3 7 0 - 5 2 0s e t s n u m b e r o c o n s t a n t s : S t h s t a r t i n g l o c a t i o n o t h s c r e e n ; D N t h s c r e e n w i d t h ;M a n M C t h s t a r t i n g r o a n c o l u m n f o t h g a m e b o a r do t h e s c r e e n ; L C , t h s t a r t i n gs c r e e n R A l o c a t i o n f o t h

b o a r d ; D 2 t w i c e t h s c r e e nw i d t h ; a n t h c h a r a c t e r s u s e dt d r a w t h e b o a r d .

C e r t a i n v i t a l m e m o r y l o c at i o n s a r g i v e n s y m b o l i c n a m e si l i n e 4 7 0 . I l i n e 5 1 0 , t h i n t e rn a b o a r d a l e v e l i a r r a y i i n i t i a l i z e d . L i n e 5 1 i a l s o e e c u t e d b e f o r e e a c h n e g a m e .

T h s u b r o u t i n e i l i n e s5 3 0 - 7 1 0 b u i l d s t h e s c r e e n , u i n t h s y m b o l i c p a r a m e t e r ss e u p b y t h i n i t i a l i z a t i o nr o u t i n e . T h r o u t i n e i l i n e s7 2 0 - 1 0 7 0 u p d a t e s t h b o a r da f t e r a m o v e . T h l e v e l b o a r di a r r a y i l o o k e d a b t h i sr o u t i n e . P e e k s a n d P o k e s m u s tb u s e d , s i n c e i n o B a s i cd i m e n s i o n e d a r r a y .

F i n a l l y , t h l a s t f e l i n e s a 1 0 8 0 - 1 1 3 0 p r i n t t h s c o r e a n p r o v i d e f o a c o n t i n u a t i o n o t h m a t c h . h a v e f o u n d t h m a t c h a l e v e l t b p r e t t y u e v e n — i n t h c o m p u t e r ' s f a v o r ,

A d d r e s s a l a u t h o r c o r r e s p o nd e n c e t R o b e r t R o s s a , 1 9 0 1S t a r l i n g , J o n e s b o r o , A 7 2 4 0 1

4

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 53/94

M y s t e r y o L a n e M a n o r

B J I S A N D E R S

W h e r e a r S h e r l o c kH o l m e s , N e r o W o l f ea n P e t e r W i m s e yw h e n y o u n e e d t h e m ?S o m e o n e ' s b e e n k i l l e da L a n e M a n o r , a n y o u ' r e g o i n g t n e e dm o r e t h a n s l i c kt r e n c h c o a t a n f u n n y h a t d i s c o v e rw h e r e , w i t h w h a t a n dw h o d u n i t

M y s t e r y o L a n e M a n o r i w h o d u n i t g a m e , w h e r e t h p l a ye r a c a d e t e c t i v e s t r y i n g t s o l v e t h m y s t e r i o u s m u r d e r o i n d u s t r i a l i s t J a m e s L a n e . T h m y s t e r y i s o l v e d ( a n d t h w i n e d e c l a r e d ) w h e n t h m u d e r e r a n w e a p o n a r d i s c o ve r e d a n t h l o c a t i o n o t h c r i m e i d e t e r m i n e d . T h c o r e c t a n s w e r s a r r a n d o m l y g e e r a t e d e a c h t i m e t h p r o g r a m i r u n , s t h g a m e p r o v i d e s a e n d l e s s s o u r c e o m y s t e r y .

C o m m o d o r e 6 J o y s t i c k s

T h e r e a r s i d i f f e r e n t r o o m sw h e r e t h c r i m e c o u l d h a v e o cc u r r e d . T h e r e a r f i v e d i f f e r e n tp e o p l e w h c o u l d h a v e m u d e r e d M r L a n e . A n t h e r e a r f i v e w e a p o n s t h a t c o u l d h a v eb e e n u s e d .H o t S l e u t h

T m a k e a g u e s s , e a c hp l a y e r , i t u r n , m o v e s t o k e nt t h r e s q u a r e i r o o m .

T h s t e p - g e n e r a t o r , w h i c h i r u n n i n g w h e n t h p l a y s c r e e n i i n i t i a l l y d i s p l a y e d , d e t e r m i n e st h n u m b e r o s t e p s y o m o v ey o u r t o k e n . T h p l a y e r w h o s en a m e i d i s p l a y e d g o e s f i r s t , b p r e s s i n g t h e f i r e b u t t o n . T h i ss t o p s t h e s t e p - g e n e r a t o r , a n a a r r o w r e v e a l s t h n u m b e r o s t e p s y o m u s t m o v e .

O n c e y o u ' v e r e a c h e d t h r e s q u a r e , t h e p r o g r a m w i l l e n t e rt h G u e s s r o u t i n e , a n t h l i s to s u s p e c t s w i l l b d i s p l a y e du n d e r y o u r n a m e . M o v e t h f l a s h i n g a r r o w ( v i a t h j o y s t i c k )t t h n u m b e r c o r r e s p o n d i n g t t h s u s p e c t y o d e e m g u i l t y ,a n p u s h t h j o y s t i c k ' s f i r e b u t o t r e g i s t e r y o u r g u e s s .N e x t , t h s i p o s s i b l e r o o m sw i l l b l i s t e d ; g u e s s a g a i n a n p r e s s t h f i r e b u t t o n . T h l i s t o w e a p o n s w i l l t h e n b d i s p l a y e d .

A f t e r y o u ' v e m a d e y o u r t h r e eg u e s s e s , r e v i e w o t h e s eg u e s s e s w i l l b d i s p l a y e d a n t h n u m b e r o c o r r e c t g u e s s e sw i l l b r e v e a l e d .

4

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 54/94

F o a a d d e d c h a l l e n g e , a t h b e g i n n i n g o t h g a m ey o u ' r e g i v e n t h o p t i o n o s e i n o n o s e e i n g t h s t e p - g e ne r a t o r p o i n t e r . W i t h t h p o i n t e ri n v i s i b l e , p l a n n e d m o v e m e n tt h r o u g h t h m a n o r i p r a c t i c a l l yi m p o s s i b l e . A f t e r y o m a k eg u e s s , t h t o k e n i p l a c e ds o m e w h e r e i t h m a i n h a l lw a y .

L o o k O u t !T h m a n o r i n o w i t h o u t i t

o w h a z a r d s . T r a p d o o r s r a d o m l y s p r i n g o p e n a n c a b e c o m e v e r y t r o u b l e s o m e . I y o f a l l t h r o u g h t r a p d o o r , y o a r f o r c e d t b e g i n t h e t r e ka g a i n , f r o m t h h o m e p o s i t i o n .A t h g a m e p r o g r e s s e s , t h t r a p d o o r s m a b l o c k d o o r s o e l i m i n a t e n e e d e d g u e s s i n gs q u a r e s . Y o m a c l e a r t h e

m a n o r o t h t r a p d o o r s b yp r e s s i n g t h e r e t u r n k e y . I y o d t h i s , b o t h t o k e n s a r e f o r c e dt b e g i n a g a i n a t h h o m ep o s i t i o n .

Y o m a d i s c o v e r a l t h d a t at s o l v e t h m y s t e r y , b u t y o u rf i n a l g u e s s m u s t b m a d e i t h r o o m w h e r e t h c r i m e w a c o m m i t t e d .

W h e n t h m y s t e r y i f i n a l l ys o l v e d , t h w i n n i n g d e t e c t i v e i c o n g r a t u l a t e d w i t h m u s i c a lf a n f a r e a n t h t i m e i t o o k t s o l v e t h e m y s t e r y .

F o y o u r c o n v e n i e n c e , I ' v e i c l u d e d a i t e m i z e d l i s t o i s t r u c t i o n s , w h i c h s h o u l d m a k el e a r n i n g t h g a m e e a s i e r .h o p e y o e n j o y p l a y i n g M y s t e r yo L a n e M a n o r i a lA d d r e s s a l a u t h o r c o r r e s p o nd e n c e t J i S a n d e r s , 1 2 6 2 9S . R . 3 4 7 , M a r y s v i l l e , O 4 3 0 4 0 .

1 O n o t w d e t e c t i v e s m a w o r k o t h e c a s e .2 T h o b j e c t i t s o l v e t h e m u r d e r i t h e s h o r t e s t a m o u n t o t i m eo r i t w p l a y e r s , b e f o r e y o u r o p p o n e n t .3 M u r d e r e r , r o o m a n w e a p o n m u s t b f o u n d .4 . I n o r d e r t m a k e g u e s s , y o m u s t b i r o o m a n o t h r e s q u a r e .5 Y o m u s t m o v e y o u r t o k e n t h n u m b e r o s t e p s g i v e n b t h s t e p - g e n e r a t o r .6 A f t e r y o u ' v e m a d e y o u r g u e s s e s , y o u ' l l b e i n f o r m e d h o m a n ya r c o r r e c t .7 A f t e r a g u e s s , y o u r t o k e n w i l l b p l a c e d i t h e s a f e t y o t h m a i nh a l l w a y .8 T w i n , y o m u s t s o l v e t h e m u r d e r i t h r o o m w h e r e i o c c u r r e d .9 G u e s s e s a r m a d e u s i n g t h e g u e s s - s e l e c t o r , v i t h j o y s t i c k a n t h f i r e b u t t o n .1 0 T h f i r e b u t t o n i a l s o u s e d t s t o p t h s t e p - g e n e r a t o r .

4

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 55/94

M o n e y G r u b b e rF o r m e r l y " T a x m a n . "

B D O U G S M O A KY o u ' v e g o t b q u i c kt s t a y a h e a d o t h a tm o n e y - g r u b b i n g t a x -m a n , w h o ' s h o o y o u rt r a i l . H e ' s a f t e r y o u re v e r y d o l l a r a n w o n ' ts t o p a t h a t . H w a n t sy o u r l i f e .

I T a x m a n , y o m u s t m o v et h r o u g h d i f f e r e n t l e v e l s o t h s c r e e n a n g a t h e r m o n e y . B u j u s t a i r e a l l i f e , s o m e o n ee l s e w a n t s y o u r m o n e y , t o o .T h t a x m a n , o c o u r s e . A n j u s ta i r e a l l i f e , t h t a x m a nw a n t s m o r e t h a n y o u r m o n e y . . .h w a n t s y o u !

T p l a y T a x m a n , y o m u s tp l u g j o y s t i c k i n t o t h r e a r p o r to y o u r C - 6 4 . Y o e a r n p o i n t s f o e a c h t h a t y o g a t h e r a n y o l o s e p o i n t s f o e a c h o n t h a t t h t a x m a n g e t s . Y o b e g i n w i t ht h r e e l i v e s ( m a y b e n i n e w o u l d b b e t t e r ? ) a n d e a c h t i m e t h t a m a c a t c h e s y o u , y o l o s e o n l i f e . I y o r e a c h 2 0 0 0 p o i n t s , y o g a i n l i f e . T h p r o g r a m m a k e sn o i s e w h e n y o g e c a u g h t a n

b e e p w h e n y o g a i n a e x t r al i f e .

i I G H T

C o m m o d o r e 6 j o y s t i c k

T h e G a m e ' s I n g r e d i e n t sO n o t h i s g a m e ' s i n t e r e s t

i n f e a t u r e s i t h m u s i c , w h i c hp l a y s c o n t i n u o u s l y t h r o u g h o u tt h g a m e . I i i m a c h i n el a n g u a g e a n d r i v e n b i n t e rr u p t , s i d o e s n ' t s l o w d o w nt h g a m e .

A n o t h e r i n t e r e s t i n g f e a t u r ei t h l a r g e a l p h a b e t , w h i c h i u s e d i t h t i t l e a n s c o r e d i p l a y s . I i m a d e o s t r i n g s t h a tp r i n t g r a p h i c s c h a r a c t e r s t b u i l d e a c h l e t t e r . T h p r o g r a md o e s n ' t u s e v e r y l e t t e r , b u a l t h l e t t e r s a r e i n c l u d e d i l i n e s1 1 1 0 - 1 5 1 0 .

T h r o u t i n e a l i n e s 1 5 3 0 -1 5 4 0 p e r f o r m s t h e a c t u a l c o v e r s i o n o G t l a r g e l e t t e r s .B u s i n g t h i s r o u t i n e a n t h s t r i n g a r r a y o t h a l p h a b e t a n n u m b e r s , y o c a p r i n t l a r g et e x t i y o u r o w p r o g r a m s .

T g i v e t h i l l u s i o n o m a r u n n i n g , u s f o u r c u s t o m c h a ra c t e r s , t w f o e a c h d i r e c t i o n{ l e f t o r i g h t ) . T d e t e r m i n ew h i c h c h a r a c t e r t d i s p l a y u s a i n t e r e s t i n g t e c h n i q u e . I l i n e3 1 0 , t h c h a r a c t e r i c h o s e n b t h e x p r e s s i o n C P E E K ( C )( M E A N D 3 ) . T h v a l u e o P E E K ( C ) i s e b t h m a c h i n el a n g u a g e r o u t i n e t h a t r e a d s t h j o y s t i c k a n d e t e r m i n e sw h e t h e r o n o y o u h a v e m o v e d .T h ( M E A N D 3 ) i w h a t m a k e st h c h a r a c t e r c h a n g e .

4

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 56/94

A M c h a n g e s , M E A N Dg t h r o u g h t h s e q u e n c e 0 , 1 , 2 , 3o 3 , 2 , 1 , 0 , s t h c h a r a c t e r t h a ti d i s p l a y e d i c h a n g e d a M i c h a n g e d . S i n c e M i t h r u n n e r ' s p o s i t i o n o t h s c r e e n ,t h r u n n e r i a n i m a t e d a h r u n s . s i m i l a r m e t h o d i u s e di l i n e 3 0 0 , t a n i m a t e t h t a x -m a t h r o u g h h i t w p o s i t i o n s .

Y o u m u s t a c t u a l l y e n t e r t w p r o g r a m s t g e T a x m a n o f a n r u n n i n g . T h f i r s t o n e , T a L o a d e r , s e t s u t h c u s t o mc h a r a c t e r s e t t h a t w i l l b e u s e di t h g a m e , a n t h e n l o a d sa n r u n s t h g a m e p r o g r a m .

S i n c e y o u c a n u s e o n l y 1 c u s t o m c h a r a c t e r s , w r o t es h o r t m a c h i n e l a n g u a g e r o u t i n et h a t f i r s t m o v e s t h e n t i r e R O c h a r a c t e r s e i n t o t h R A a r e a , w h i c h t h g a m e w i l l u s e .t h e n u s e d B a s i c P o k e s i t h d a t a , f o t h 1 c h a r a c t e r s t b r e d e f i n e d . T h f i r s t f i v e d a t al i n e s o t h T a L o a d e r h o l d t h m a c h i n e l a n g u a g e r o u t i n e , a n i y o d o n ' t e n t e r i c o r r e c t l y ,l i n e 2 w i l l e n t h p r o g r a ma n t e l l y o t h c h e c k s u m i i e r r o r .

Y o d o n ' t w a n t a e r r o r i t h e s e l i n e s , s i n c e t h m a c h i n el a n g u a g e r o u t i n e d i s t u r b s i n t e rr u p t s a n d c h a n g e s l o c a t i o n t " b a n k o u t , " o s w i t c h o u t , I / m e m o r y , a n s w i t c h i t h R O M , s i c a b r e a d . B s u r e , t h e r e f o r e , t o g e t h e s e f i v el i n e s c o r r e c t . I t h r e s t o t h d a t a i n o c o r r e c t , t h c h a ra c t e r s w i l l n o b c o r r e c t , b u t h p r o g r a m w i l l n o b o m b .

A l s o n o t e t h a t l i n e 7 m u s tb s e f o e i t h e r t a p e o d i s k ,a n i y o a r u s i n g t a p e m

c h i n e , y o m u s t h a v e t h T a m a n g a m e p r o g r a m a s t h e n e x tp r o g r a m o t a p e a f t e r t h T a L o a d e r . Y o m i g h t e v e n w a n t t p u t w c o p i e s o t h p r o g r a ma f t e r t h l o a d e r , i c a s e t h r c o r d e r m i s s e s t h f i r s t o n e .

Y o s h o u l d a l s o b c a r e f u lw i t h t h d a t a i t h g a m e p r g r a m , s i n c e m o s t o i i f o m a c h i n e l a n g u a g e r o u t i n e s a n c o u l d c a u s e t h 6 t c r a s h i y o d o n ' t e n t e r i p r o p e r l y .w o n ' t t r t e x p l a i n t h p r o g r a mi d e t a i l , b u w i l l g i v e y o b r i e f d e s c r i p t i o n o w h a t e a c hs e c t i o n d o e s .

L i n e b L i n eL i n e c o r r e c t l y s e t s t h e e n d -

o f - p r o g r a m p o i n t e r s a f t e r y o u ' v el o a d e d t h e l o a d e r p r o g r a m a n dr u n t h e g a m e p r o g r a m .

L i n e s 1 0 - 1 8 0 s e u v a r i a b l e s , p r i n t t h t i t l e a n r e a d a n P o k e i t h d a t a f o t h m a c h i n e l a n g u a g e r o u t i n e st h a t a r u s e d .

L i n e s 1 9 0 - 3 6 0 m a k e u t h p l a y l o o p .

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 57/94

L i n e s 3 7 0 - 4 8 0 s e u t h s t r i n g s t h a t p u t t h e m o n e y a n t h " h o l e s " o t h s c r e e n .

L i n e s 4 9 0 - 5 8 0 p r i n t t h e p l a ys c r e e n f o e a c h l e v e l o p l a y .

L i n e s 5 9 0 - 6 3 0 a n i m a t e t h c h a r a c t e r s o t h s c r e e n .

L i n e s 6 4 0 - 7 9 0 u p d a t e t h s c o r e , c h e c k f o e n o g a m e ,c h e c k f o " b o n u s l i f e " a n d i p l a y t h e s c o r e a t h e n o t h g a m e .

L i n e s 8 0 0 - 8 1 0 d e t e r m i n e t h s k i l l l e v e l a w h i c h y o u s t a r t .

L i n e s 8 2 0 - 8 3 0 i n i t i a l i z e t h S I c h i p .

L i n e s 8 4 0 - 1 1 0 0 a r e t h e d a t af o t h m a c h i n e l a n g u a g er o u t i n e s .

L i n e s 1 1 1 0 - 1 5 2 0 a r e t h es t r i n g s t h a t c o n t a i n t h l a r g ea l p h a b e t .

L i n e s 1 5 3 0 - 1 5 4 0 p r i n t t h l a r g e l e t t e r s f r o m G $

L i n e s 1 5 6 0 - 1 5 8 0 p l a y t h o p e n i n g f a n f a r e , [ r

A d d r e s s a l a u t h o r c o r r e s p o nd e n c e t D o u g S m o a k , 3 0 K e y -w a r d S t . , C o l u m b i a , S 2 9 2 0 1 .

4

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 58/94

B L A R R Y D S M I T H

f o u c h d o w nF o r m e r l y " N F L F o o t b a l l

I t ' s f i r s t a n t e n , d i a g a i n ! S u r p r i s e !Y o u ' v e b e e n d r a f t e di n t o t h N F a s t a r t i n g q u a r t e r b a c k .H o w e l l c a y o r a c ku t h o s e p o i n t s a n s m o t h e r y o u r c o p u t e r o p p o n e n t ?

I y o u ' r e t i r e d o s h o o t i n g a o b e i n g c h a s e d b a l i e n s , y o m i g h t l i k e t t r q u a r t e r b a c k i n ga N F f o o t b a l l t e a m .

N F F o o t b a l l , g a m e t h a tr u n s o t h C - 6 4 o o t h V I C - 2 0 w i t h a n m e m o r y e x p a ns i o n , s i m u l a t e s t h s i t u a t i o n st h a t c o m m o n l y o c c u r i p r o f e ss i o n a l f o o t b a l l g a m e s . W h i l et h g r a p h i c s u s a g e i n o a t o u n d i n g , t h c o m p u t e r i c o m p e t e n t o p p o n e n t a n w i l lm a i n t a i n y o u r i n t e r e s t a s y o ul e a d y o u r t e a m t e i t h e r v i c t o r yo d e f e a t .

T h u s o t h e K e r n a l p l o tr o u t i n e f o p o s i t i o n i n g t h e c u rs o r , a n o t h r a n d o m n u m b e r

j i G H

C o m m o d o r e 6 o V I C - 2 0w i t h 3 K , 8 K o 1 6 e x p a n s i o n

t e c h n i q u e s f o s i m u l a t i n g t h s t a t i s t i c s o f o o t b a l l g a m e ,a r p r o g r a m m i n g t i p s y o m a w a n t t e x t r a c t . T h c o m p u t e ri w e l l i n f o r m e d a b o u t t h g a m eo f o o t b a l l , a n t h g a m e s i t u at i o n s a r s r e a l i s t i c t h a t y o u ' l Fp r o b a b l y f i n d y o u r s e l f f o l l o w i n gt h e s t r a t e g i e s o t h p r o s .B u t t i n g H e a d s

T a b l e l i s t s t h o f f e n s i v ea n d e f e n s i v e p l a y s a v a i l a b l e t y o a n t h c o m p u t e r . A t h t a b l e i l l u s t r a t e s , t h o f f e n s i v ep l a y e r h a s i p l a y s t c h o o s ef r o m : t w r u n n i n g p l a y s , t w p a s s i n g p l a y s a n d t w o k i c k i n gp l a y s . T h d e f e n s i v e p l a y e r m a c h o o s e t d e f e n d a n o t h r u n n i n g o p a s s i n g p l a y s .

F r o m t h d r a w p l a y t t h l o n g p a s s , t h p l a y s i n c r e a s e i y a r d a g e p o t e n t i a l . H o w e v e r ,w i t h t h e p o t e n t i a l c o m e s r i s k ,a t h p o s s i b l e y a r d a g e l o s sa l s o i n c r e a s e s . F o e x a m p l e ,t h d r a w p l a y t y p i c a l l y m a k e st h r e e - t f i v e - y a r d g a i n , o o n e - o t w o - y a r d l o s s . T h l o n gp a s s , o t h e o t h e r h a n d , m a m a k e a m u c h a s 7 0 y a r d s , b u tc o u l d r e s u l t i t e n - t 1 5 - y a r dl o s s . A l s o , t h c o m p u t e r g e n e ra t e s o c c a s i o n a l t u r n o v e r s , w i t hi n c r e a s i n g t u r n o v e r f r e q u e n c yf o t h p l a y s w i t h t h g r e a t e ry a r d a g e p o t e n t i a l .

T h c o m p u t e r d e t e r m i n e s t h k i c k i n g g a m e p u r e l y f r o m r a d o n u m b e r s , t h o u g h i u s e sn o n - u n i f o r m d i s t r i b u t i o n t o

5

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 59/94

t y p i f y p r o f e s s i o n a l g a m e . T h r u n n i n g a n p a s s i n g p l a y y a r da g i d e t e r m i n e d b o t h b r a d o n u m b e r s a n t h m a t c h o m i s m a t c h b e t w e e n t h c h o s e no f f e n s e a n d e f e n s e .

I t h c h o s e n d e f e n s e m a t c he t h e o f f e n s e , t h y a r d a g eg a i n s a r s u b s t a n t i a l l y r e d u c e d .I t h o f f e n s e a n d e f e n s e a r c o n s i d e r a b l y m i s m a t c h e d ( l i k ed e f e n d i n g f o l o n g p a s s w h e nt h o p p o n e n t r u n s d r a w ) , t h e nt h y a r d a g e g a i n i g e n e r a l l y i c r e a s e d . T h i s p r o v i d e s a g o o dm i x t u r e o c h a n c e a n d s t r a t e g y .

G e K i c k O u o I T h e c o m p u t e r p l a y s t h e f i e l d

g o a l k i c k i n g g a m e b p r o f e ss i o n a l r u l e s . I f i e l d g o a l a t e m p t i m i s s e d o u t s i d e t h 2 0 - y a r d l i n e , t h o p p o n e n t r c e i v e s t h e b a l l a t t h l i n e o s c r i m m a g e . I t h f i e l d g o a l i m i s s e d i n s i d e t h 2 0 - y a r d l i n e ,t h o p p o n e n t g e t s t h b a l l o t h 2 0

T h c o m p u t e r a l s o k n o w sa b o u t s a f e t i e s , s o b e c a r e f u lw h e n r u n n i n g t h e b a l l f r o md e e p i y o u r o w t e r r i t o r y .P u n t s t h a t g i n t o t h e n d z o n ea r p l a c e d o t h 2 0 - y a r d l i n e .

W h i l e t h c o m p u t e r r a n d o m l yc h o o s e s i t o f f e n s i v e a n d e f e n s i v e p l a y s , i i a w a r e o t h t i m e r e m a i n i n g , t h e s c o r ea n t h f i e l d p o s i t i o n . O f o u r t hd o w n , t h c o m p u t e r g e n e r a l l yw i l l p u n t ( o i c l o s e e n o u g h , t r f o r a f i e l d g o a l ) , b u i i t ' sb e h i n d l a t e i t h g a m e , i m a g f o t h f i r s t d o w n . T h c o p u t e r a l s o k n o w s t h a t t r a i l i n gh u m a n o p p o n e n t i a p t

t h r o w f e l o n g b o m b s , s w h e n i t ' s a h e a d , i t e n d s t d f e n d a g a i n s t t h l o n g e r p o t e nt i a l p l a y s .

T h s c r e e n d i s p l a y c o n s i s t so 2 0 - y a r d s e c t i o n o f i e l da r o u n d t h s c r i m m a g e l i n e , t h f i r s t d o w n m a r k e r s a n s c r i mm a g e - l i n e m a r k e r . I a l s o d i p l a y s t h t i m e ( n u m b e r o p l a y s ) r e m a i n i n g a n t h n u b e o d o w n s .

W h e n y o u ' r e p r o m p t e d f o p l a y , y o e n t e r t h n u m e r i cc o d e ( f r o m T a b l e 1 o t h d e s i r e d p l a y , o q u e s t i o nm a r k i y o u ' v e f o r g o t t e n t h p l a y s . q u e s t i o n m a r k w i l lr e s u l t i t h c o m p u t e r d i s p l a yi n l i s t o o p t i o n s .

C O D E P L A YD r a w p l a yE n s w e e p

3 S h o r t p a s sL o n g p a s sP u n t ( o f f e n s i v e p l a y o n l y )F i e l d g o a l ( o f f e n s i v e p l a yo n l y )

T a b l e 1 T h o f f e n s i v e a n d e f e ns i v e p l a y s a v a i l a b l e t y o a n t h c o m p u t e r , a n t h e i r n u m e r i c c o d e s .

C h o o s e Y o u r F o Y o c a c u s t o m i z e N F

F o o t b a l l t p l a y a g a i n s t y o u rf a v o r i t e o p p o n e n t . J u s t r e p l a c ea l o c c u r r e n c e s o " M E " a n " I i t h p r o g r a m l i s t i n g w i t h t h n a m e o y o u r c h o s e n o p p o n e n t .

5

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 60/94

T r t r e t a i n t h s a m e s p a c i n gb e f o r e a n a f t e r t h n a m e s t h a t t h d i s p l a y w i l l l o o k w e l l .C a u t i o n : D n o c h a n g e t h n m e r i c v a r i a b l e M E w h i c h i n o i n s i d e q u o t a t i o n m a r k s a n d , i c h a n g e d , w i l l c a u s e u n t o l dp r o b l e m s .

C - 6 4 o c c u r r e n c e s o " M E "a n " I a r i l i n e s 1 0 0 , 1 9 5 a n 2 3 0 . V I C - 2 0 o c c u r r e n c e s o

" M E " a n " I a r i l i n e s 1 0 0 ,1 9 a n 2 3 0 .

A f t e r y o i n s e r t y o u r o p p on e n t ' s n a m e , j u s t r u t h p r g r a m a n e n j o y t h t h r i l l o b a t l i n g t w i t h B i G a m e . t B ]A d d r e s s a l a u t h o r c o rr e s p o n d e n c e t L a r r y D S m i t h ,5 4 0 4 I n s p i r a t i o n L a n e , L a C r u c e s , N 8 8 0 0 1 .

5

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 61/94

B G A R Y F I E L D S

S p e l l e r

I t h i s p r o g r a m , y o u rc h i l d ' s a b i l i t y t o l e a r nw o r d s a n t h e i r d e f i n it i o n s i s n ' t m e a s u r e d b p o i n t s . N o i s e s , c l u e sa n s m o k e - p u f f i n g ,c h u g g i n g s p r i t e t r a i na l l e v i a t e t h p r e s s u r ea n m a k e l e a r n i n g f u n .

b e g a n w r i t i n g t h 6 S p e l l e rt h e l p m s e v e n - y e a r - o l dd a u g h t e r w i t h h e r w e e k l y s p e l li n l e s s o n s . w a n t e d t h C - 6 4t p r o m p t h e t s p e l l a w o r d ,t h e n t c h e c k t s e i s h h a s p e l l e d i c o r r e c t l y .

T h m a j o r p r o b l e m w a c o i n u w i t h a i n t e r e s t i n g a n u s a b l e p r o m p t , o n t h a tw o u l d n ' t d i s p l a y t h e w o r d .s p e e c h s y n t h e s i z e r w o u l d h a v eb e e n n i c e , b u d i d n ' t h a v e o n e .T h s o l u t i o n w a t o f f e r d e i n i t i o n o w o r d , t h e n l e h e s p e l l t h w o r d i d e f i n e d . T h i sa p p r o a c h t u r n e d u p p l u s , b c a u s e t h e d i s p l a y o t h e d e fi n i t i o n i n c r e a s e d t h l e a r n i n g .

I I G H T

C o m m o d o r e 6

W h a t ' s I A l A b o u t ?T h i s p r o g r a m n o o n l y r e i n

f o r c e s s p e l l i n g , b u a l s o k n o w le d g e o w o r d m e a n i n g s a n a w a r e n e s s o t h k e y b o a r d .A n t h 6 S p e l l e r i e n j o y a b l e .I t ' s f u l l o s o u n d — n i c e s o u n d sw h e n t h c h i l d ' s s p e l l i n g i c o r e c t , n o t - s o - n i c e s o u n d s w h e ni t ' s w r o n g .

T h i s p r o g r a m i f r i e n d l y , t o o .I f i r s t d i s p l a y s a l t h w o r d st h a t w i l l b i t h p r o g r a m a n dl e t s t h c h i l d s t u d y t h e s e f o a l o n g a s h e o s h p l e a s e s .O n c e t h c h i l d g e t s i n t o t h a t u a l p r o g r a m , i r e m a i n s f r i e n dl w i t h a i d s .

T h w o r d d e f i n i t i o n s a r s l o w l y s c r o l l e d a c r o s s t h s c r e e n w i t h a t t e n t i o n - k e e p i n gc l i c k s , a n o t h e r p r o m p t s a r a n n o u n c e d w i t h t o n e .

P r e s s i n g t h e F 1 k e p r o v i d e st h c h i l d w i t h c l u e s . I g i v e s a i o n l e t t e r a t i m e , r e p e a t i n gc l u e s a f t e r e a c h s p e l l i n g t r y ,a n a l s o a d d i n g l e t t e r s a f t e re a c h t r y , u t a n i n c l u d i n gt h t o t a l w o r d .

A n d , o c o u r s e , t h e r e ' sr e w a r d f o g e t t i n g t h w o r dr i g h t — C a s e y J o n e s r o l l s a l o n g" o t h r i g h t t r a c k " i h i s m o k e - p u f f i n g a n s o u n d - c h u gg i n g l o c o m o t i v e . T h p r o g r a mr e i n f o r c e s t h c o r r e c t s p e l l i n gw i t h f i n a l t o o t o t h t r a i nw h i s t l e .

T h i s c o n t i n u e s u n t i l t h c h i l dc o r r e c t l y s p e l l s a l t h w o r d s i

5

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 62/94

t h p r o g r a m ' s m e m o r y . T h e p r g r a m t h e n s a y s g o o d b y e w i t h ah e a r t y " W e l l d o n e ! " f o l l o w e db y f i n a l r e v i e w o t h s p e l l i n gw o r d s .P r o v i d i n g t h W o r d s

T h w o r d s a r p l a c e d i t h p r o g r a m b y p a r e n t o r t e a c h e r .T h p r o g r a m p r o m p t s t h e c o rr e c t e n t r y t h r o u g h s p e c i a l" c h a n g e W O R D S / D E F I N I T I O N SF 2 r o u t i n e ( l i n e s 8 a n 1 5 5 ) .

W o r d s a n d e f i n i t i o n s s h o u l db e n t e r e d i e v e n n u m b e r s b c a u s e t h d a t a d i s p l a y i r e a di p a i r s . S o i y o e n t e r 1 w o r d s a n d e f i n i t i o n s , a d a o t h e r t m a k e a n e v e n 1 2 A l s o ,t h d e f i n i t i o n s s h o u l d b e l e s st h a n 4 l e t t e r s i l e n g t h ( t r yl o n g e r o n a n y o u ' l l s e w h y ) .

O u p r a c t i c e a h o m e i t d u p l i c a t e e a c h w e e k ' s s p e l l i n g -l e s s o n w o r d s i n t o s e p a r a t e p r g r a m s t i t l e d S p e l l e r 1 S p e l l e r 2 a n s o n O n d i s k i r e s e r v e dj u s t f o s p e l l i n g w o r d s . T h a tw a y , t h c h i l d c a g b a c k a n t r o l l e s s o n s a g a i n . O r i y o u ' r e l i k e u a n h a v e ay o u n g e r c h i l d , t h s a v e d l e s o n s m a b f o h i o h e f u t u r e .D e s c r i p t i o n s o L i n e s

L i n e 1 5 S e t s t h s c r e e n c o l o ra n d s w i t c h e s t u p p e r / l o w e rc a s e .

L i n e 2 0 S e t s t h e b a s i c s o u n da n s p r i t e - g e n e r a t i n g v a r i a b l e s .

L i n e 2 5 P u t s t h d a t a -r e a d i n g p o i n t e r t t h e 0 i l i n e2 9 5 0 .

L i n e s 5 0 - 9 5 . T i t l e p a g e .L i n e s 8 a n 1 5 5 . P r o m p t f o

t h w o r d - r e p l a c e r o u t i n e .L i n e 8 7 R e a d s a n P o k e s t h

t r a i n i n t o m e m o r y .L i n e s 1 0 0 - 1 6 5 . D i s p l a y t h

w o r d s t h i s p r o g r a m w i l l r e v i e w .L i n e 1 9 0 . M a k e s t h d a t a

p o i n t e r l o o k a t h f i r s t w o r d s .L i n e 2 1 0 . R e a d s t h f i r s t

w o r d a n d e f i n i t i o n ; c i t h c l u e - v a r i a b l e c o u n t e r .

L i n e 2 1 5 . L o o k s t s e i a l t h w o r d s h a v e b e e n u s e d .

L i n e s 2 2 5 - 2 7 0 . S l o w l y s c r o l lt h d e f i n i t i o n ( b $ ) w i t h c l i c k s .

L i n e 2 8 0 . A s k s f o t h w o r dd e f i n e d .

L i n e s 3 0 0 - 3 1 0 . C h e c k t h s p e l l i n g a n g t t h c o r r e c to i n c o r r e c t r o u t i n e .

L i n e s 6 0 0 - 7 9 0 . T h c o r r e c ts p e l l i n g r o u t i n e .

L i n e 6 1 0 . T u r n s o t h s p r i t ea n e x p a n d s i t

L i n e 6 1 2 . M a k e s s p r i t e b l a c k .L i n e s 6 2 2 - 6 2 4 . D r a w t h

t r a c k s .L i n e 6 2 5 . M a k e s t h t r a i n

m o v e f r o m r i g h t t l e f t .L i n e 6 4 4 . C h u g g i n g s o u n d .L i n e 6 4 5 . P l a c e s t h t r a i n i

t h c o r r e c t s t a r t i n g l o c a t i o n .L i n e 6 4 6 . T h s m o k e v a r i a b l e

i s m

L i n e 6 5 1 . T u r n s t h c h u g g i n gs o u n d o f f .

L i n e s 6 5 7 - 6 6 1 . T h e t w o t r a i nt o o t s .

L i n e 6 6 2 . T u r n s s p r i t e o f f .L i n e s 7 3 0 - 7 9 0 . M a k e s m o k e

c o m e o u o t r a i n ' s s t a c k .L i n e s 8 0 0 - 9 1 0 . I n c o r r e c t

s p e l l i n g a n c l u e r o u t i n e .L i n e s 8 1 0 - 8 4 0 . B u z z e r .L i n e s 8 9 2 - 8 9 4 . C h e c k f o

c l u e r e q u e s t .L i n e 8 9 5 . P r i n t s c l u e u s i n g

L E F T S c o m m a n d .L i n e 9 1 0 . C h e c k s t s e i

n e s p e l l i n g i c o r r e c t .

5

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 63/94

L i n e s 1 5 0 0 - 1 8 2 0 . T h w i ^ D i s p l a y t h

O 2 5 0 0 - 2 9 0 0 . A i r o u t i n e^ 9 5 ^ 9 5 3 . T r a i n s p r i t ed a t a l i n e s .

L i n e s 3 0 0 0 - 4 9 9 9 . R e p l a c ea b l e d a t a l i n e s .

. s s s s a r —L a n v a / e2 8 8 0 6 .

5

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 64/94

T h M a n y - C o l o r e d V I B T O M M Y M I C H A E L T I L L M A NT h i s e d i t o r i a a r i s w h e n i c o m e s t d e s i g n i n g a n d m o d if y i n g y o u r m u l t i c ol o r e d V I C - 2 0 g r a p h i c sc h a r a c t e r s . W h a t ' sm o r e , i t ' s e a s y t u s e .

I ' v e s e e n m a n y f i n e a r t i c l e so m u l t i c o l o r p r o g r a m m i n g , b u I ' v e n e v e r f o u n d a n e a s y - t o - u s eE d i t o r t h a t w o u l d d e s i g n t h e s et y p e s o c h a r a c t e r s . A r e s u l to m f u t i l e s e a r c h , w r o t e t h E d i t o r p r o g r a m .T h i s p r o g r a m i d e s i g n e d t w o r k o V I w i t h 3 m e m o r ye x p a n s i o n ( S u p e r E x p a n d e r w i l la l s o w o r k ) . S i m p l y t y p e i t h i sp r o g r a m , s a v e i a n u s i t

I f h o w e v e r , y o u h a v e a n 8 o g r e a t e r m e m o r y e x p a n d e r ,t y p e i b o t h t h S c r e e n R e l o c at i o n p r o g r a m a n d t h E d i t o rp r o g r a m a n s a v e e a c h s e p ar a t e l y . W h e n e v e r y o w i s h t u s t h E d i t o r , l o a d t h e S c r e e nR e l o c a t i o n p r o g r a m a n d r u i t T h i s w i l l m a k e t h V I l o o k l i k ei d i b e f o r e y o a d d e d t h 8

i I G H T

V I C - 2 0 w i t h 3 e x p a n s i o nD a t a s s e t t e

P r i n t e r ( o p t i o n a l )

m e m o r y . N e x t , l o a d t h e E d i t o ra n d r e m o v e l i n e 1 ( i f a c t , y o m a r e m o v e i p e r m a n e n t l y a n s a v e t h n e v e r s i o n ) . N o y o m a r u t h p r o g r a m .

I t h u p p e r l e f t - h a n d c o r n e ro t h m a i n s c r e e n i d i s p l a y e dt h c o m m a n d b o a r d . I y o d o n ' t k n o w w h a t t o d o , w a i t f o

c o m m a n d t p o u p T h f o l l o w i n g i l i s t a n d e s c r i pt i o n o t h c o m m a n d s .C — C h a n g e c o l o r sD — D i s p l a yG — G o t n e c h a r a c t e rn u m b e rL — L o a d a o l c h a r a c t e r s e S — S a v e t h c h a r a c t e r s e ( p r i n t e r - s c r e e n - t a p e )

R e m e m b e r t h a t t h e s e a r e t h em a i n c o m m a n d s . I y o c h o o s eo n o t h e m , t h e y ' l l a l b e r a s e d f r o m t h s c r e e n a n r p l a c e d w i t h n e w s u b c o mm a n d s , w h i c h w i l l g i v e y o i s t r u c t i o n s o h o t c o n t i n u ep r o p e r l y . A l w a y s w a i t f o t h c o m m a n d s t a p p e a r ! ( T h e r e i

s l i g h t t i m e l a i s o m es u b r o u t i n e s . )

I y o l o o k t t h e r i g h t - h a n dc o r n e r o t h s c r e e n , y o u ' l l s e

l a r g e 6 x s q u a r e . T h i s i t h d i s p l a y a r e a , w h i c h a l l o w s y o t p u y o u r n e w l y c o n s t r u c t e dm u l t i c o l o r c h a r a c t e r s o t o o o b e s i d e e a c h o t h e r t c r e a t el a r g e r m u l t i c o l o r c h a r a c t e r s .

I y o l o o k a t h m i d d l e o t h e d i s p l a y s c r e e n , y o u ' l l s e t h r e e r o w s o n o r m a l h i g h -r e s o l u t i o n c h a r a c t e r s . T h e s e

5

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 65/94

a r e t h e c h a r a c t e r s t h a t y o m a r e s t r u c t u r e i n t o m u l t i c o l o r c h a ra c t e r s . ( A y o c r e a t e n e c h a r a c t e r , t h c h a r a c t e r c o r r es p o n d i n g t t h o n y o u ' r ew o r k i n g o w i l l c h a n g e s h a p e .T h c h a r a c t e r s i t h e s e t h r e er o w s w i l l s t i l l b d i s p l a y e d i H i g h - R e s o l u t i o n m o d e . )

I t h l e f t - b o t t o m c o r n e r o t h s c r e e n , y o u ' l l s e t h f o u rc o l o r s w i t h w h i c h y o u m a c o o y o u r m u l t i c o l o r c h a r a c t e r :s c r e e n c o l o r , b o r d e r c o l o r , c h a ra c t e r c o l o r a n a u x i l i a r y c o l o r .( T h e s e c o l o r s w i l l b k n o w n , r s p e c t i v e l y , a c o l o r 1 c o l o r 2 c o l o r a n c o l o r 4 .

I t h e r i g h t - b o t t o m c o r n e r o t h e s c r e e n , y o u ' l l s e t h c h a ra c t e r y o u ' r e r e s t r u c t u r i n g . I w i l lb d i s p l a y e d i H i g h - R e s o l u t i o nm o d e a n d , b e l o w , i n i t s a p r o p r i a t e M u l t i c o l o r m o d e .

T h b o t t o m m i d d l e o t h s c r e e n i t h m o s t i m p o r t a n t .T h i s i t h w o r k a r e a w h e r ey o u ' l l d i s p l a y t h e m u l t i c o l o rc h a r a c t e r i d i s p l a y . T h c h a r a c t e r w i l l b m a d e u o 3 l a r g e b l o c k s , c o l o r e d i o n o t h f o u r c o l o r s y o u ' r e a l l o w e dt u s e .

A r o u n d t h t o a n l e f t o t h l a r g e c h a r a c t e r a r a r r o w st h a t i n d i c a t e w h i c h b l o c k o c o l o r i t h w o r k a r e a y o u ' l l b c h a n g i n g . P r e s s t h e c u r s o r k e y st m o v e t h e a r r o w s . T h r i g h tc u r s o r m o v e s t h a r r o w s r i g h ta n t h l e f t c u r s o r m o v e s t h e ml e f t . L i k e w i s e , t h d o w n c u r s o rm o v e s t h a r r o w s d o w n a n t h u c u r s o r m o v e s t h e m u p T h c h a r a c t e r n u m b e r o w h i c hy o u ' r e c u r r e n t l y w o r k i n g w i l l b d i s p l a y e d o v e r t h e w o r k a r e a .

H o T o U s e t h P r o g r a mL o a d t h p r o g r a m a c c o r d i n g

t p r e v i o u s i n s t r u c t i o n s . R u i a n w a i t f o t h s c r e e n t o s e ti t s e l f .

N o s e l e c t a c h a r a c t e r t w o r k o ( 0 - 5 7 ) . P r e s s f o G t C h a r a c t e r a n t h e n i n p u t t h c h a r a c t e r n u m b e r ( 0 - 5 7 ) . A w a y s p r e s s t h r e t u r n k e a f t e rr e s p o n d i n g t r e q u e s t s f o i p u t . A l s o , f o r l a t e r r e f e r e n c e ,d o n ' t f o r g e t t o m a k e n o t e o w h a t c h a r a c t e r s y o a r c h a n g i n g .

I y o w i s h , y o m a c h a n g ec o l o r s n o w . ( I f a c t , y o c a c h a n g e t h c o l o r s a n y t i m e y o ua r b a c k t t h m a i n c o m m a n ds c r e e n . ) T o c h a n g e c o l o r s ,p r e s s C I n p u t y o u r c h o i c e o s c r e e n c o l o r f r o m t h c o l o r l i s t( s e e T a b l e 1 ) R e m e m b e r t p r e s s t h e r e t u r n k e a f t e r y o i n p u t y o u r c h o i c e .

N e x t , s e l e c t y o u r c h o i c e o b o r d e r c o l o r , t h e n c h a r a c t e rc o l o r , a n f i n a l l y , a u x i l i a r y c o o r ( Y o u m a c h o o s e o n l y c o l o r s0 - f o c h a r a c t e r c o l o r . )

N o y o m a r e s t r u c t u r ey o u r c h a r a c t e r . T o d o t h i s , y o m u s t u s t h c u r s o r k e y s a n t h n u m b e r k e y s 1 2 a n 4 N o t i c e t h a r r o w s a b o v e a n d t t h l e f t o t h e c h a r a c t e r . T h e s ea r r o w s i n d i c a t e w h i c h c o l o rb l o c k o t h e c h a r a c t e r y o a r c h a n g i n g . B p r e s s i n g t h c u s o k e y s ( w i t h t h s h i f t k e y ) y o m a p o s i t i o n t h a r r o w s t p o i n t t a n b l o c k w i t h i n t h w o r k a r e a .

T o c h a n g e t h c o l o r o t h b l o c k , y o m u s t u s e k e y s 1 2 o 4 I y o p r e s s k e 1 y o u ' l le r a s e t h a t b l o c k ( b e c a u s e y o u

5

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 66/94

a r e c o l o r i n g i i t h b a c kg r o u n d c o l o r ) ; k e y 2 w i l l c o l o rt h a t b l o c k i t h b o r d e r c o l o r ;k e y 3 w i l l c o l o r i i t h c h a ra c t e r c o l o r ; k e w i l l c o l o r i i t h a u x i l i a r y c o l o r .

N o t i c e t h a t a s y o u c h a n g et h b l o c k s , t h c o r r e s p o n d i n gp i x e l d o t s i t h m u l t i c o l o r e a m p l e c h a n g e t t h p r o p e r c o o r T h c o r r e s p o n d i n g d o t s i t h h i g h - r e s o l u t i o n e x a m p l ec h a n g e t t h p r o p e r c o n f i g u r at i o n , t o o .

I y o w i s h t d i s p l a y y o u rm u l t i c o l o r c h a r a c t e r s o t h d i s p l a y s c r e e n ( u p p e r r i g h t -h a n d c o r n e r ) , t h e n p r e s s f o t h d i s p l a y f u n c t i o n . F i r s t y o w i l l b a s k e d f o t h w i d t h a n h e i g h t o t h d i s p l a y s c r e e n( t h e n u m b e r o c h a r a c t e r s h o r iz o n t a l l y a n v e r t i c a l l y ) . T h e ny o u ' l l b a s k e d f o t h c h a ra c t e r n u m b e r a n t h c h a r a c t e rc o l o r f o t h a t p a r t i c u l a r c h a ra c t e r . R e p e a t t h i s i n f o r m a t i o nu n t i l t h d i s p l a y s c r e e n i f u l l .T h e n y o w i l l r e t u r n b a c k t t h m a i n c o m m a n d s .

N o t e t h a t i y o c h a n g e t h f o u r m a i n c o l o r s b u s i n g t h c o l o r c o m m a n d , t h e n t h s c r e e n , b o r d e r a n a u x i l i a r y c o o r f o a l b l o c k s i t h e d i s p l a yw i l l a l s o c h a n g e . E a c h b l o c k ' sc h a r a c t e r c o l o r w i l l s t a y t h s a m e , t h o u g h , b e c a u s e t h c h a r a c t e r c o l o r o e a c h b l o c k i i n d e p e n d e n t o o t h e r c o l o r s .T s a v e y o u r d a t a f o e a c hc h a r a c t e r , p r e s s S T h s c r e e nw i l l c l e a r a n y o u ' l l b p r e s e n t e d w i t h t h r e e o p t i o n s . I y o c h o o s e f o t a p e , i n s e r t i t h D a t a s s e t t e t h t a p e t w h i c h y o u w i s h t s a v e t h

c h a r a c t e r s e a n p r e s s T N e x t ,i n p u t a f i l e n a m e a n p r e s s t h r e c o r d a n p l a y b u t t o n s o t h D a t a s s e t t e . S t a n d b u n t i l t h c h a r a c t e r s e h a s b e e n c o p i e dt o t a p e . T h e r e w i l l b s l i g h td e l a y u n t i l t h m a i n s c r e e n i o n c e a g a i n d i s p l a y e d .

I y o c h o o s e f o p r i n t e r ,t h e n s t a n d b y w h i l e t h e c h a ra c t e r s e i c o p i e d t t h p a p e r .T h o u t p u t w i l l b a f o l l o w s .T h f i r s t n u m b e r i e a c h l i n e i t h e c h a r a c t e r ' s n u m b e r . T h n e x t e i g h t n u m b e r s a r e t h e b y t en u m b e r s t h a t r e p r e s e n t t h a tc h a r a c t e r i t h c h a r a c t e r s e t .( T h e f i r s t e i g h t n u m b e r s i t h s e a r f o d r a w i n g c h a r a c t e r 0 T h n e x t e i g h t n u m b e r s a r f o c h a r a c t e r L T h i s c o n t i n u e s a l t h w a t c h a r a c t e r 5 7 . )

N o y o s h o u l d m a k em a r k b e s i d e t h c h a r a c t e r s t h a ty o u ' v e c h a n g e d . Y o s h o u l da l s o m a k e a n o t e o t h c o l o r sy o u ' r e u s i n g a n t h c h a r a c t e rc o l o r y o a r u s i n g f o e a c hc h a r a c t e r .

I y o c h o o s e f o s c r e e n ,t h e n t h e o u t p u t w i l l b i d e n t i c a lt t h p r i n t e r o u t p u t , e x c e p tt h a t o n l y s e v e n c h a r a c t e r s a t i m e w i l l b d i s p l a y e d . Y o m a c o p y o n t o p a p e r t h p e r t i n e n ti n f o r m a t i o n t h a t y o d e s i r e .Y o u ' l l b r e t u r n e d t t h m a i ns c r e e n a f t e r y o f i n i s h g o i n gt h r o u g h a l 5 c h a r a c t e r s .

I y o w i s h t r e l o a d c h a ra c t e r s e f o r e v i e w i n g o m o d if i c a t i o n , t h e n p r e s s I n s e r t t h a p p r o p r i a t e t a p e i n t o t h D a t a s s e t t e , t y p e t h n a m e o t h c h a r a c t e r s e a n p r e s s t h r e t u r n k e y . P r e s s t h p l a y b u t o o t h D a t a s s e t t e a n

5

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 67/94

s t a n d b y w h i l e t h c h a r a c t e rs e l o a d s . W h e n t h c h a r a c t e rs e i r e a d y , y o u ' l l b r e t u r n e dt t h m a i n c o m m a n d s c r e e n .

T q u i t , p r e s s Q O V I w i t h 3 m e m o r y , e v e r y t h i n g w i l lb f i n e ( i n c l u d i n g t h n e c h a ra c t e r s e t , w h i c h w i l l b i m e o r l o c a t i o n s 7 1 6 8 t o 7 6 7 9 ) .

O V I w i t h 8 o m o r em e m o r y , h o w e v e r , d o n ' t u s u n l e s s y o u p e r m a n e n t l y m o d i f yl i n e 3 7 0 . S i m p l y d e l e t e e v e r yt h i n g b e t w e e n t h w o r d s T H E Na n E N D . N o t h V I w i l lw o r k n o r m a l l y .H o M u l t i c o l o r e dC h a r a c t e r s W o r k

F i r s t , y o m u s t c h a n g e t h v a l u e o t h R A p o i n t e r ,w h i c h t e l l s t h V I w h e r e t g e d a t a t c o n s t r u c t t h c h a r a ct e r s y o u s e e o n t h e s c r e e n . T h i sp o i n t e r i m e m o r y l o c a t i o n3 6 8 6 9 . T h e r e a r f e v a l u e st h a t y o m a P o k e i t h e r e t r e s e t t h V I t p o i n t t y o u ro w c h a r a c t e r s e t . T h e s e a r l i s t e d i t h V I P r o g r a m m e r ' sR e f e r e n c e G u i d e . T h e t w o m o s tu s e d a r 2 5 a n 2 4 0 . T h f o r m e r w i l l c a u s e t h V I t g e i t c h a r a c t e r s e f r o m m e m o r yl o c a t i o n s 7 1 6 8 t 7 6 7 9 .

B u w h a t i c h a r a c t e r s e t ?I i n o t h i n g m o r e t h a n g r o u po e i g h t b y t e s , s t a r t i n g f r o mc e r t a i n m e m o r y l o c a t i o n a n e x t e n d i n g t s o m e f i n a l l o c at i o n . I t h i s c a s e w s t a r t a 7 1 6 8 . T h i s a n t h n e x t s e v e nb y t e s w i l l d e f i n e t h " a t " s y b o ( @ ) . T h n e x t e i g h t b y t e sd e f i n e t h e s y m b o l , a n s f o r t h .

S i n c e h a v e d e f i n e d 5 s y b o l s t w o r k w i t h , y o u ' l l e n u

a 7 6 3 2 ( 7 1 6 8 + 8 * 5 8 ) .S t h f i r s t l i n e o y o u r p r

g r a m s w o u l d p r o b a b l y b P O K E 3 6 8 6 9 , 2 5 5

B u y o m u s t b c a r e f u l t p r o t e c t y o u r c h a r a c t e r s e f r o mv a r i a b l e s , w h i c h w i l l b s t o r e di t h s a m e a r e a o m e m o r y a y o u r c h a r a c t e r s e a n d w o u l dt h e r e f o r e d e s t r o y t h d e s i g n sy o u h a v e c r e a t e d . T p r o t e c tt h e m f r o m v a r i a b l e s , y o m u s tt e l l t h V I t l o w e r t h t o o m e m o r y a n v a r i a b l e s b e l o wt h c h a r a c t e r s e t . T h V I C ' s o e r a t i n g s y s t e m w i l l t h e n t h i n kt h a t y o d n o w i s h t u s t h i sm e m o r y s p a c e a n d w i l l a v o i du s i n g i t

M e m o r y l o c a t i o n s 5 1 5 2 5 a n 5 t e l l t h V I w h e r e t h e n o m e m o r y a n t h b o t t o mo s t r i n g s t o r a g e a r l o c a t e d .S o i y o P o k e i t h e a p p r o p r ia t v a l u e s h e r e , y o c a t r i c kt h V I i n t o t h i n k i n g i h a l e s sm e m o r y a n d , p o s s i b l y , p r e v e n ti f r o m m e s s i n g u p y o u r c h a r a ct e r s e t , w h i c h i n o i t h i su n u s e d a r e a o m e m o r y .

W h a t a r t h n u m b e r s t P o k e i n T p r o t e c t m e m o r ya r e a 7 1 6 8 a n u p y o w o u l dd i v i d e 7 1 6 8 b 2 5 6 . T h i n t e g e rv a l u e y o g e ( d o n ' t r o u n d o f f ! )i t h p a g e o m e m o r y y o w i s ht p r o t e c t . I y o g e r m a i n d e r , t h i s w i l l b e x t r am e m o r y b y t e s y o w i s h t p r t e c t . I t h i s c a s e , y o u ' l l g e p a g e 2 w i t h r e m a i n d e r 0

T h r e m a i n d e r w i l l b P o k e di n t o 5 a n 5 ( t h e l o b y t e s )a n t h p a g e i n t o 5 a n 5 ( t h e h i g h b y t e s ) .

P O K E 5 1 , 0 : P O K E 5 2 , 2 8 : P O K E 5 5 , 0 :P O K E . 5 6 , 2 8 : C L

5

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 68/94

N o t i c e t h C L a t h e n o t h l i n e . I t s p u r p o s e i t r e s e ti m p o r t a n t p a g e z e r o p o i n t e r s .D o n ' t f o r g e t i t

N o w , t h s e c o n d l i n e c a b e P O K E 3 6 8 6 9 , 2 5 5

A t h i s p o i n t , t h s c r e e nt u r n s t g a r b a g e ! T h i s i b c a u s e y o u h a v e n o t h i n g b u r a n d o m g a r b a g e a m e m o r yl o c a t i o n s 7 1 6 8 a n u p Y o m u s t p u s o m e m e a n i n g f u l d a t ad e s i g n s h e r e t a l l o w t h V I t d e s i g n a n p r i n t y o u r c h a r a ct e r s p r o p e r l y .

W o u l d y o l i k e t b a b l e t u s t h l e t t e r s a n n u m b e r d s i g n s t h a t y o h a b e f o r e ?W e l l , y o c a s i m p l y t r a n s f e r( o c o p y ) t h d e s i g n s f r o m t h c h a r a c t e r R O c h i p ( w h i c h i w h e r e y o w e r e g e t t i n g t h e mb e f o r e , w h e n m e m o r y l o c a t i o n3 6 8 6 9 c o n t a i n e d 2 4 0 ) . T h f o l o w i n g i s i m p l e l o o p t h a t w i l lm o v e t h e m f o y o f r o m t h R O c h a r a c t e r c h i p t t h R A a r e a y o u ' v e c h o s e n ( 7 1 6 8a n u p ) .1 F O D T 5 1 1 P O K E 7 1 6 8 + P E E K 3 2 7 5 8 + 1 N E X T

A y o r u t h i s p a r t o t h p r o g r a m , t h g a r b a g e w i l lq u i c k l y t u r n t m e a n i n g f u l a n r e a d a b l e i n f o r m a t i o n .

N o f o y o u r c h a r a c t e r s e t !A l y o u h a v e t d i c o p y f r o my o u r d a t a s h e e t o p a p e r t h c o r r e c t d a t a b y t e s y o u ' v ec r e a t e d f o y o u r n e w l y d s i g n e d c h a r a c t e r s a n p l a c et h e m i n t o t h n e c h a r a c t e r s e R A M .

S u p p o s e y o u w i s h t r e p l a c et h l e t t e r w i t h w h a t e v e r c h a ra c t e r y o h a d e s i g n e d f o t h

p u r p o s e ( n o t g o o d i d e a , s i n c ew u s t h l e t t e r s m u c h ,b u t h i s i o n l y a e x e r c i s e ) .

O y o u r d a t a s h e e t o y o u rp a p e r , y o u ' l l h a v e , l e t ' s s a y ,1 , 2 5 5 , 2 5 5 , 2 5 5 , 2 5 5 , 2 5 5 , 2 5 5 , 2 5 5 ,2 5 5 . Y o c o u l d h a v e a n y t h i n g ,b u t t h e f i r s t n u m b e r m u s t b 1 b e c a u s e t h i s i t h c h a r a c t e rn u m b e r f o t h l e t t e r A T h n e x t e i g h t n u m b e r s c a b a n n u m b e r l e s s t h a n 2 5 a n e q u a lt o g r e a t e r t h a n 0 ( T h i s p a t i c u l a r s e o b y t e s f o t h l e t t e r

w i l l p r o d u c e a r e v e r s e d b l a n ks p a c e . )

T t r a n s f e r t h i s d a t a t i t c o r r e c t p o s i t i o n i t h c h a ra c t e r s e t , u s t h e f o l l o w i n gl o o p ( a n d n o t i c e t h f l a g 1 ) 2 R E S T O R E2 R E A D2 I A = - 1 T H E N 4 2 F O T 3 R E A D3 P O K E 7 1 6 8 + A * 8 + B , D3 N E X T3 G O T O 2 4 R E T H I S W I L L B T H R E S T O

Y O U R P R O G R A M

9 9 E N 1 0 0 0D A T A 1 . 2 5 5 , 2 5 5 , 2 5 5 , 2 5 5 . 2 5 5 . 2 5 5 . 2 5 5 . 2 5 51 0 1 0 D A T A -

N o t i c e t h a t y o c o u l d e a s i l yh a v e u s e d e v e n m o r e u s e r -d e f i n e d c h a r a c t e r s . A l y o m u s t d i p l a c e t h e m i t h D a t a s t a t e m e n t s a t h e n o t h p r o g r a m ( b u t b e f o r e t h D a t a s t a t e m e n t ) . D t h o s e t h s a m e w a a t h c h a r a c t e r( t h e f i r s t n u m b e r b e i n g t h c h a r a c t e r n u m b e r a n n e x te i g h t n u m b e r s b e i n g t h d e s i g nf o t h c h a r a c t e r f r o m y o u r d a t as h e e t o y o u r p a p e r ) .

6

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 69/94

N o w , w h e n e v e r y o u e n t e rP o k e ( s c r e e n l o c a t i o n ) , 1 y o w i l l n o t g e t a " A , " b u y o w i l lg e y o u r n e c h a r a c t e r . Y o u ' l la l s o g e y o u r n e c h a r a c t e r i y o t y p e P R I N T " A " .

H o t U s M u l t i c o l o rT s e t h i s s p a c e t

M u l t i c o l o r m o d e , y o m u s tP o k e t h c o r r e s p o n d i n g c o l o rm e m o r y l o c a t i o n w i t h w h a t e v e rc h a r a c t e r c o l o r y o u h a v es e l e c t e d p l u s e i g h t . I t h i sc a s e , y o c a s i m p l y e n t e rP o k e ( s c r e e n l o c a t i o n 3 0 7 2 0 ) ,( c h a r a c t e r c o l o r 8 ) T h i s s i p l f o r m u l a w i l l a l w a y s w o r ka n i t h s i m p l e s t w a t k e e p

o n e - t o - o n e c o r r e s p o n d e n c eb e t w e e n y o u r c h a r a c t e r s c r e e na n y o u r c o l o r s c r e e n . ( A c t u a ll y t h i s w i l l a l w a y s w o r k u n l e s sy o r e s e t t h s c r e e n o c o l o rm e m o r y t d i f f e r e n t p l a c e i m e m o r y . )

S o w h e n e v e r y o p l a c ec h a r a c t e r t t h s c r e e n i m u l t ic o l o r , f i r s t P o k e t h c o l o r m e o r w i t h t h a b o v e f o r m u l a ,t h e n P o k e t h s c r e e n m e m o r yw i t h t h i s f o r m u l a : P O K E s c r e e nl o c a t i o n , c h a r a c t e r n u m b e r .

A n o t h e r w a t a c t i v a t e M u t i c o l o r m o d e i b p r i n t i n g w i t h

c o l o r c o d e g r e a t e r t h a n 7 M e m o r y l o c a t i o n 6 4 i t h l c a t i o n f o t h c u r r e n t p r i n t i n gc o l o r . N o r m a l l y , i t ' s f r o m t 7 b u i y o P o k e i w i t h n u m b e rf r o m t 1 5 y o u ' l l t h e n b p r i n t i n g i M u l t i c o l o r m o d e .

T h c o l o r y o w i l l P o k e i w i l l b t h c o l o r c h a r a c t e r n u b e f r o m t h l i s t ( t 7 ) p l u sa d d e d t a c t i v a t e t h m o d e .

F o r e x a m p l e , t b e g i n p r i n ti n i M u l t i c o l o r m o d e u s i n g

r e a t h c h a r a c t e r c o l o r , e n t e rP O K E 6 4 6 , + ( t h e f o r e a n t h t a c t i v a t e M u l t i c o l o r ) .T c u o f m u l t i c o l o r p r i n t i n g ,j u s t e n t e r P O K E 6 4 w i t hn u m b e r l e s s t h a n 8 o j u s t u s

r e g u l a r c o l o r c o m m a n d i n s i d eP r i n t s t a t e m e n t .

H o A b o u t C o l o r s ?T s e t h f o u r m u l t i c o l o r

c o l o r s i t h V I C , u s t h f o l o w i n g f o u r P o k e s .

1 S c r e e n c o l o r .P O K E 3 6 8 7 9 , P E E K ( 3 6 8 7 9 ) A N 1 O ( S C R E E N C O L O R " 1 6

2 B o r d e r c o l o r .P O K E 3 6 8 7 9 , P E E K ( 3 6 8 7 9 ) A N 2 4 O ( B O R D E R C O L O R )

N o t e t h a t t h b o r d e r c o l o r m u s tb e f r o m t o n l y !

3 C h a r a c t e r c o l o r . T h i s i s i nd i v i d u a l l y s e f o e a c hs p a c e o t h s c r e e n a d i s c u s s e d a b o v e . N o t e t h a tc h a r a c t e r c o l o r i f r o m t

o n l y , b u y o m u s t a d t i t a c t i v a t e M u l t i c o l o rm o d e i t h a t s p a c e o nt h s c r e e n .

4 A u x i l i a r y c o l o r .P O K E 3 6 8 7 8 , P E E K ( 3 6 8 7 8 ) A N 1 O 1 A U X I L I A R Y C O L O R

N o t e t h a t a u x i l i a r y c o l o r s r a n g ef r o m t 1 5

A d d r e s s a l a u t h o r c o r r es p o n d e n c e t T o m m y M i c h a e lT i l l m a n , d S q u a r e d S o f tw a r e , B o 1 1 3 3 , S a n f o r d , N 2 7 3 3 0 .

6

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 70/94

0 — b l a c k1 — w h i t e2 - r e d3 — c y a n4 — p u r p l e5 — g r e e n6 — b l u e7 — y e l l o w

8 — o r a n g e9 — l i g h t o r a n g e

1 0 — p i n k1 1 — l i g h t c y a n1 2 — l i g h t p u r p l e1 3 — l i g h t g r e e n1 4 — l i g h t b l u e1 5 — l i g h t y e l l o w

T a b l e 1 C o l o r l i s t .

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 71/94

P l a y i n g - ^ F h o P o n i o s

B G A B E G A R G I U L OP u a w a y y o u rb i n o c u l a r s a n p l a yt h h o r s e s , t h r o u g ht h i s p r o g r a m a n d y o u rV I C - 2 0 , w i t h o u t l o s i n ga n m o n e y .

T h i s h o r s e r a c i n g p r o g r a mf o t h u n e x p a n d e d V I C - 2 0 i c o n v e r s i o n o p r o g r a m w r i t t e nf o t h P E T , f o u n d i M i c r o c o mp u t i n g ( " B e t t i n g o O l P O K E Y , "O c t o b e r 1 9 8 0 ) . T h m a j o rc h a n g e m a d e i s i n t h g r a p h i c s f o t h h o r s e . u s e dt h i s y m b o l , w h i c h l o o k s b i l i k e h o r s e , o r d o o c h i c k e n , i y o u u s e y o u r i m a g i na t i o n . M v e r s i o n w i l l w o r k o n l yo t h V I C , s i n c e i u s e s P o k e s .

Y o b e g i n t h g a m e w i t h$ 5 0 0 , a n m a b e u t t h a ta m o u n t . Y o p i c k h o r s e , n u b e r e d f r o m t 5 t w i n . T h p r o g r a m r a n d o m l y c h o o s e s o n h o r s e t w i n . I y o p i c k t h w i n n e r , y o w i f o u r t i m e s t h a m o u n t t h a t y o b e t , w h i c h i a d d e d t t h m o n e y t h a t y o u ' r eh o l d i n g . I y o l o s e , y o l o s et h a m o u n t t h a t y o b e t . Y o

I I G H T

p l a y u n t i l y o l o s e a l t h m o n e y y o u ' r e h o l d i n g . ( T h i s i i n e v i t a b l e . )

T h g a m e i e a s y t t y p e i n f u t p l a y , a n a b o v e a l l , c o s t sy o n o t h i n g . T h p r o g r a m l i s ti n s h o w s g o o d p r o g r a m m i n gs t y l e , w h i c h , i a d o p t e d , g i v e sy o r e s u l t t h a t i e a s y t u n d e r s t a n d a n m o d i f y .

S t a r t w i t h r e m a r k s h o w i n gt h p r o g r a m ' s n a m e a n p u p o s e . T h e n l i s t t h e v a r i a b l e sa n e x p l a i n t h e m . A f t e r t h a t ,s t a r t t h m a i n l o g i c o f t h e p r og r a m , w h i c h c o n t a i n s i t m a j o rd e c i s i o n s . P l a c e t h s u b r o ut i n e s , w h i c h y o u u s w i t hG O S U B s t a t e m e n t s , a f t e r t h p r o g r a m ' s m a i n l o g i c , l r

A d d r e s s a u t h o r c o r r e s p o n d e n c et G a b e G a r g i u l o , 2 ' / N e m a S t . , M a n c h e s t e r , C 0 6 0 4 0 .

U n e x p a n d e d V I C - 2 0

6

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 72/94

L i n e N u m b e r1 5 S e t s R ( a m o u n t o m o n e y h e l d ) t o 5 0 0 .2 0 C l e a r s s c r e e n . C a l l s o s u b r o u t i n e 1 2 0 0 t o p u t r o o

h y p h e n s a c r o s s s c r e e n . D e s c r i b e s v a r i a b l e s M L L A 2 2 S e t s M ( M e m o r y L o c a t i o n ) t 7 6 8 0 , t h e s t a r t i n g a d d r e s s

o t h u p p e r l e f t o t h s c r e e n . S e t s L ( l i n e s a c r o s s ) t 2 2 P o k e 3 6 8 7 9 : S e t s c o l o r a n b a c k g r o u n d .

4 0 C a l l s o s u b r o u t i n e 1 2 0 0 t p u r o o h y p h e n s a c r o s ss c r e e n .

8 0 P r i n t s t h t i t l e a n c a l l s o s u b r o u t i n e 1 2 0 0 t p u a r o w o h y p h e n s a c r o s s s c r e e n .

8 5 D e l a y s b i t , t h e n s t a r t s .8 6 S e t s s t a r t i n g p o s i t i o n o h o r s e s .9 0 - 1 1 0 — G i v e i n s t r u c t i o n s .1 4 0 — C a l l s o s u b r o u t i n e 1 2 0 0 t p u a r o w o h y p h e n s a c r o s s

s c r e e n .2 7 0 — G e t s t h n u m b e r o t h h o r s e b e i n g b e o n 3 0 0 — C a l l s o s u b r o u t i n e 1 2 0 0 t p u r o o h y p h e n s a c r o s s

s c r e e n .3 1 0 — A s k s f o b e t .3 2 0 — I b e i l e s s t h a n o e q u a l t a m o u n t h e l d , g o e s t 4 0 0 .3 3 0 — ( O t h e r w i s e ) T e l l s h o m u c h i s l e f t t b e t .3 5 0 — A s k s f o b e a g a i n . ( 3 1 0 ) .4 0 0 — C l e a r s s c r e e n a n c a l l s o s u b r o u t i n e 2 0 0 0 t d i s p l a y

h o r s e s .4 1 0 — C a l i s o s u b r o u t i n e 4 0 0 0 t d i s p l a y s t a r t i n g g a t e .6 0 0 — G e t s r a n d o m n u m b e r b e t w e e n a n 5 6 2 0 — C a l l s o s u b r o u t i n e 1 0 0 0 t a d t c o u n t e r c o r r e s p o n d

i n t t h h o r s e w h o s e n u m b e r h a c o m e u p C a l l s o s u r o u t i n e 2 0 0 0 t o p u t h o r s e s o s c r e e n . ( I h o r s e ' s c o u n t e rh a b e e n i n c r e m e n t e d , i t p o s i t i o n i a d v a n c e d . )

6 3 0 — A d d s t c o u n t e r c o r r e s p o n d i n g t t h h o r s e w h o s en u m b e r h a c o m e u p 6 4 0 — I t h h o r s e t h a t j u s t m o v e d i n o n e a r t h r i g h t s i d e o t h

s c r e e n , g o e s t 6 0 t m a k e a n o t h e r h o r s e m o v e .6 5 0 — I h o r s e h a s w o n , f a l l s i n t o h e r e . D e l a y s b i t .6 6 0 — T e l l s w h i t h w i n n e r .6 6 5 — P r i n t s a r o w o h y p h e n s a c r o s s t h s c r e e n .6 7 0 — I t h h o r s e p i c k e d i t h w i n n i n g h o r s e , a d d s t h w i n n i n g s

t t h a m o u n t h e l d , g o e s t 7 5 0 .6 8 0 — I t h h o r s e p i c k e d i n o t t h e w i n n e r , f a l l s i n t o h e r e .

D i s p l a y s " Y o u l o s e . " S u b t r a c t s b e f r o m a m o u n t h e l d .6 8 5 — T e l l s h o m u c h m o n e y i l e f t .6 8 7 — I n m o n e y i l e f t , d i s p l a y s " Y o u ' r e b r o k e . " E n d s p r o g r a m .6 9 0 — A s k s i a n o t h e r g a m e i t b p l a y e d .6 9 1 — G e t s r e p l y .

T a b l e 1 D e s c r i p t i o n o m a i n p r o g r a m .

6

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 73/94

7 0 0 — I r e p l y i " Y , " g o e s t 2 t s t a r t a g a i n .7 1 0 — I r e p l y i n o " Y , " f a l l s t h r o u g h t o h e r e . R e s t o r e s s c r e e n

c o l o r a n b a c k g r o u n d . E n d s t h p r o g r a m .7 5 0 — D i s p l a y s " Y o u w i n " a n h o m u c h w o n .7 6 0 — D i s p l a y s a m o u n t h e l d .7 7 0 — G o e s t 6 9 t a s a b o u t a n o t h e r g a m e .9 9 0 — E n d s .

S u b r o u t i n e s1 0 0 0 — A d d s t X 1 , X 2 , X 3 , X 4 , o r X 5 , d e p e n d i n g o t h r a n d o m

n u m b e r t h a t c a m e u p 1 2 0 0 — P u t s a r o w o a s t e r i s k s a c r o s s t h s c r e e n .2 0 0 0 — A d v a n c e s t h h o r s e w h o s e n u m b e r h a c o m e u p L e a v e s

t h o t h e r h o r s e s w h e r e t h e y w e r e .3 0 0 0 — M a k e s t h s o u n d o s t a r t i n g g u a n g a l l o p i n g o h o r s e s .

T a b l e 2 D e s c r i p t i o n s o s u b r o u t i n e s .

V a r i a b l e sM L M e m o r y l o c a t i o n o h o r s e .L A L i n e s a c r o s s s c r e e n , 2 f o V I C .X 1 P o s i t i o n o h o r s e 1 X 2 P o s i t i o n o h o r s e 2 X 3 P o s i t i o n o h o r s e 3 X 4 P o s i t i o n o h o r s e 4 X 5 P o s i t i o n o h o r s e 5 R 1 A m o u n t o m o n e y h e l d .I I n d e x v a r i a b l e .R R a n d o m n u m b e r .H T h h o r s e b e o n B A m o u n t o b e t .B ) — A r r a y u s e d t k e e p t r a c k o p o s i t i o n o e a c h h o r s e . B ( 1 ) i

f o h o r s e # 1 B ( 2 ) i f o h o r s e # 2 e t c .Z $ R e p l y Y / N .J I n d e x v a r i a b l e .Y " Y " c o o r d i n a t e o s c r e e n . ( H o w m a n y l i n e s d o w n f r o m t o p . )J 3 I n d e x v a r i a b l e .Y I n d e x v a r i a b l e .J 2 I n d e x v a r i a b l e .L I n d e x v a r i a b l e .M I n d e x v a r i a b l e .

T a b l e 3 D e f i n i t i o n s o v a r i a b l e s .

6

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 74/94

F o r m e r l y " S p a c e R e s c u e . "

B K E G A R D N E RA c o m m a n d e r o m o t h e r s h i p i s p a c e ,c a n y o u s t e e r y o u r u m a n n e d d r o n e s i n t om i n e f i e l d t r e s c u e 1 a s t r o n a u t s w h o ' l ls o o n b g a s p i n gf o a i r ?

I S p a c e R e s c u e , a c h a l l e n gi n g a l l - g r a p h i c s g a m e f o t h u n e x p a n d e d V l C - 2 0 , y o a r e t h ec o m m a n d e r o a i n t e r s t e l l a rr e s c u e c r u i s e r f o t h S p a c e P t r o l i t h y e a r 2 0 9 0 . T h c r u i s e r i t h m o t h e r s h i p t t h r e e u n m a n n e d d r o n e s t h a ta r r e m o t e l y c o n t r o l l e d f r o m i t

s p a c e s h u t t l e , c a r r y i n g 1 a s t r o n a u t s , h a c o l l i d e d w i t h a a s t e r o i d a n d r i f t e d i n t os p a c e m i n e f i e l d . T h a s t r on a u t s e j e c t e d f r o m t h s h u t t l e ,b u t a r e f l o a t i n g h e l p l e s s l y i t h f i e l d .

T f l i a n s a v e t h a s t r on a u t s b e f o r e t h e i r a i s u p p l yr u n s o u i y o u r m i s s i o n . T h m o t h e r s h i p i t o l a r g e t e n t e rt h m i n e f i e l d , s o y o u m u s t

i I G H T

U n e x p a n d e d V I C - 2 0J o y s t i c k

s e n d t h d r o n e s t r e t r i e v e t h a s t r o n a u t s o n b o n e .

B w a r n e d , d o n ' t c o l l i d e w i t ho s h o o t a t h m o t h e r s h i p o t h a t ' l l b t h e n d . U s t h d o c ki n b a y , l o c a t e d a t h b o t t o mc e n t e r o t h c r u i s e r , t d r o p o f a s t r o n a u t s . A l s o , d o n ' t h i t h m i n e s o y o u ' l l l o s e d r o n ea n p o s s i b l y a a s t r o n a u t .

T h e n t i r e g a m e i s e e n f r o mt h r a d a r s c r e e n o t h r e s c u ec r u i s e r . T h b o r d e r l i n e s m a r kh o f a t h d r o n e s c a g w i t ho u f l y i n g o u o r a d a r r a n g e .T h t o l e f t o t h s c r e e ns h o w s y o u r s c o r e a n t h t o r i g h t s h o w s h o m a n y d r o n e sy o h a v e l e f t . U s t h j o y s t i c kt s t e e r t h d r o n e s t h r o u g h t h m i n e f i e l d t p i c k u t h a s t r o n a u t s a n r e t u r n t h e m t t h m o t h e r s h i p .

W h e n y o p i c k u a a s t r on a u t , y o u ' l l h e a r b e e p . W h e ny o r e t u r n t h a s t r o n a u t t t h m o t h e r s h i p , y o u ' l l h e a r l o w e r -p i t c h e d t o n e . I y o l o s ed r o n e b f l y i n g o u o r a d a rr a n g e o h i t t i n g m i n e , y o u ' l lh e a r a h i g h - p i t c h e d b e e p , t h e no n o t h d r o n e s h i p s o t h t o r i g h t o t h s c r e e n w i l ld i s a p p e a r . R e m e m b e r n o t p i c k u m o r e t h a n o n a s t r on a u t , b e c a u s e t h d r o n e s c a o n l y t r a n s p o r t o n a t i m e .

E a c h d r o n e i e q u i p p e d w i t hp h o t o n b l a s t e r t c l e a r m i n e s .

P r e s s t h f i r e b u t t o n o t h j o s t i c k t o o p e r a t e t h b l a s t e r . Y o c a r e l o a d b g o i n g b a c k t t h m o t h e r s h i p .

6

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 75/94

Y o w i l l h a v e t h r e e m i n u t e st r e s c u e t h 1 a s t r o n a u t s b f o r e t h e y r u o u o a i r . A t h b e g i n n i n g o p l a y , t h c o p u t e r ' s i n t e r n a l c l o c k , T l $ , i s e t " 0 0 0 0 0 0 " . O l i n e 1 4 0 , T l i c h e c k e d t s e i m o r e t h a nt h r e e m i n u t e s h a v e p a s s e d . I y o u ' d l i k e m o r e t i m e , y o c a c h a n g e t h n u m b e r i q u o t e so l i n e 1 4 0 .

B e f o r e y o s t a r t p l a y i n g , t h c o m p u t e r w i l l a s k y o u f o s k i l ll e v e l , f r o m o n t n i n e . O t h f i r s t l e v e l , y o u ' l l r e c e i v e o n p o i n t f o e a c h a s t r o n a u t s a v e d .O t h n i n t h l e v e l , y o u ' l l r e c e i v en i n e p o i n t s f o e a c h a s t r o n a u ts a v e d . T h h i g h e r t h s k i l l l e v e l ,t h m o r e c r e d i t s y o u ' l l e a r n f o y o u r w o r k . Y o u r s k i l l l e v e l a l s od e t e r m i n e s h o m a n y m i n e sa p p e a r o n t h s c r e e n a n h o m a n y s h o t s y o u r p h o t o n b l a s te r c a f i r e b e t w e e n r e l o a d i n g s .

T y p e i p a r t o n a n s a v e i o n t o t a p e w i t h p a r t t w s a v e di m m e d i a t e l y a f t e r i t I p a r t o n e ,l i n e s 1 7 0 - 3 9 0 a n d 4 1 0 - 4 2 0 ,w h i c h a r t h i n s t r u c t i o n s , c a b o m i t t e d t s a v e l i t t l et y p i n g .

I t h f i r s t p a r t o f t h i s p r g r a m , t h e t o p o m e m o r y i l o w e r e d , s t h e r e ' s e n o u g hr o o m t p u p r o g r a m m a b l ec h a r a c t e r s . I y o u u s e a P r g r a m m e r ' s A i w h i l e e n t e r i n gt h i s p r o g r a m , m a k e s u r e y o t u r n t h c o m p u t e r o f a n o b e f o r e r u n n i n g t h g a m e . T h A i r a i s e s t h e t o p o m e m o r ya n m e s s e s u s o m e o t h s p e c i a l c h a r a c t e r s . I t h c h a ra c t e r s s t i l l l o o k s t r a n g e , c h e c ka n d o u b l e c h e c k t h d a t a i p a r t o n e .

D i s k u s e r s , i y o u ' r e p l a n n i n go s a v i n g t h i s p r o g r a m o n d i s k ,r e p l a c e l i n e 4 0 i p a r t o n w i t h :4 0 P R I N T C H R $ ( 1 4 7 ) " L O A D " C H R $ { 3 4 )" ( P r o g r a m N a m e ) " C H R $ < 3 4 ) " , 8 > l : P O K E 1 9 8 ,2 : P O K E 6 3 1 . 1 9 : P O K E 6 3 2 , 1 3 1

F o h i h e l p a t h t w o t h r e e p o i n t s w h e r e r e a l l y g o s t u c k w h i l e w r i t i n g t h i s p r g r a m , w o u l d l i k e t t h a n k m d a d , D a v e G a r d n e r . E

A d d r e s s a l a u t h o r c o r r e s p o nd e n c e t K e n n e t h G a r d n e r ,2 3 4 2 B a r n e s R o a d , W a l w o r t h ,N 1 4 5 6 8 .

6

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 76/94

P a r t O n

1 L o w e r s t o o m e m o r y2 I n i t i a l i z e s v a r i a b l e s3 0 - 1 2 0 T i t l e p a g e1 3 0 - 1 4 0 P o k e c h a r a c t e r i n f o r m a t i o n a b o v e B a s i c1 5 R e s e e d s r a n d o m n u m b e r g e n e r a t o r1 6 0 - 4 3 0 I n s t r u c t i o n s4 4 T i t l e p a g e d a t a4 5 0 - 6 1 0 C h a r a c t e r i n f o r m a t i o n d a t a

P a r t T w

1 0 - 4 0 I n i t i a l i z e v a r i a b l e s5 0 - 7 0 S e s k i l l l e v e l9 P l a c e s b o r d e r1 0 0 P l a c e s m i n e s a n a s t r o n a u t s1 3 R e a d s j o y s t i c k1 4 C h e c k s t i m e1 5 0 - 1 9 0 S e d i r e c t i o n f o d r o n e o s t a r t f i r i n g s e q u e n c e2 0 0 - 2 8 0 C h e c k i d r o n e h i a n y t h i n g2 9 M o v e s d r o n e3 0 0 - 3 3 0 E x p l o s i o n r o u t i n e s3 4 0 - 3 7 0 A n d r o n e s l e f t ?3 8 0 - 4 1 0 P l a y a g a i n ?4 2 0 - 4 6 0 D r o n e d o c k s i n t o m o t h e r s h i p4 7 0 - 4 8 0 D r o n e u n d o c k s f r o m m o t h e r s h i p4 9 0 - 5 0 0 C h o o s e r a n d o m s c r e e n l o c a t i o n s f o m i n e s a n

a s t r o n a u t s5 1 F i r e s s h o t5 2 0 - 5 5 0 C h e c k i s h o t h i a n y t h i n g5 7 0 - 5 8 0 M o v e s h o t6 1 0 - 6 2 0 " Y o u h i t h M o t h e r s h i p ! " m e s s a g e6 3 0 - 6 6 0 D i s p l a y s c o r e a e n o g a m e6 7 T i m e r6 8 0 - 6 9 0 M o t h e r s h i p a p p e a r s7 0 0 - 7 1 0 M o t h e r s h i p l e a v e s7 3 A n d r o n e s l e f t ?7 5 T i m e r7 9 B e e p r o u t i n e8 0 0 - 8 1 0 U p d a t e s c o r e a n s h i p s l e f t8 2 B o r d e r d a t a

T a b l e . W h a t t h l i n e s i t h S p a c e R e s c u e p r o g r a m d o

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 77/94

A T h P r e s i d e n t

B S C O T T C A L A M A RW i t h t h i s s a t i r i c a l p r g r a m t h a t s i m u l a t e si n t e l l i g e n c e , y o u c a nt h r o w p a r t y a n l e y o u r f r i e n d s t a l k w i t h

f o r m e r P r e s i d e n t o t h e U n i t e d S t a t e s .

W h e n b o u g h t m V I C - 2 0a b o u t y e a r a g o , i w a m f i r s t h a n d s - o n e x p e r i e n c e w i t h

c o m p u t e r , a n a l t h o u g h t h V I i e x c e p t i o n a l l y u s e r -f r i e n d l y , d i d n ' t t h i n k i w a f r i e n d l y a t a l l .

I d i d n ' t s a h e l l o , d i d n ' t a s h o w a s , d i d n ' t e v e n w i s h m

h a p p y d a y . T h c u r s o r b l i n k e do a n o f f , w a i t i n g f o m t d s o m e t h i n g . T h e m a c h i n e s a i d i w a r e a d y , b u s u r e w a s n ' t .

L i k e a n g o o d V I u s e r ,t h e n r e a d m u s e r ' s m a n u a l .d i s c o v e r e d t h a t i w a n t e d t h c o m p u t e r t s a h e l l o , h a t m a k e i p r i n t h e l l o . s t a r t e d t a g i n g P r i n t s t a t e m e n t s o n t o p r g r a m s s t h e y w o u l d b e g i n o

f r i e n d l y n o t e . M V I C - 2 0 w a

i i G H E x p a n d e d V I C - 2 0

h a r d l y H A f r o m 2 0 0 1 , b u I ' m a d e s t a r t .

B u s i n g G e a n I n p u t s t a t em e n t s , y o c a s i m u l a t e i n t e l l ig e n c e f a i r l y e a s i l y . G e s t a t em e n t w i l l a c c e p t s i n g l e l e t t e ro n u m b e r a n a c o t h a t i n f o rm a t i o n . A I n p u t s t a t e m e n t w i l la c c e p t s t r i n g o f i n f o r m at i o n — w o r d s o a s e n t e n c e . Y o c a p r o g r a m t h c o m p u t e r t r e c o g n i z e t h a t d a t a a n r s p o n d a p p r o p r i a t e l y .

C r e a t e C o n v e r s a t i o n a l i s tS i m u l a t e d i n t e l l i g e n c e i

u s e d i m a n y p r o g r a m s t a c e p t i n f o r m a t i o n , a n i v i d e og a m e s t f i n d o u t t h e n u b e o p l a y e r s , s k i l l l e v e la n s o n A l t h o u g h p r o g r a m st h a t u s a r t i f i c i a l i n t e l l i g e n c ea r w r i t t e n f o s o m e c o m p u t e r sw i t h m o r e m e m o r y , I ' v e s e e nf e f o t h V I C - 2 0 . T h c o m p u te r ' s m e m o r y c o n s t r a i n t s m a k ei d i f f i c u l t t i n c l u d e e n o u g h a t e r n a t i v e s i a i n t e l l i g e n c ep r o g r a m t b c o n v i n c i n g .

A t h e P r e s i d e n t i d e o n s t r a t i o n p r o g r a m t h a t s h o w sh o e f f e c t i v e l y I n p u t a n G e s t a t e m e n t s c a s i m u l a t e i n t e ll i g e n c e . W h e n y o r u t h e p r og r a m , a n e x p a n d e d V I C - 2 0 w i l la s s u m e t h p e r s o n a l i t y o f o r m e r P r e s i d e n t o t h e U n i t e dS t a t e s . Y o u ' l l b i f o b r i e fm e e t i n g w i t h t h e l d e r s t a t e s -

6

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 78/94

m a n , b u w a t c h w h a t y o s a y !H e ' s g r o w n v e r y s e n s i t i v e i r c e n t y e a r s .

J u s t a b r i e f d i s c l a i m e r : A t h P r e s i d e n t i m e a n t a s a i r e — t h e p r e s i d e n t i c a r i c at u r e a n n o i n t e n d e d t t a r n i s ht h m e m o r y o a n p e r s o n , l i i n o d e a d .

T h o s e o y o w h o w V I C sw i t h 3 e x p a n s i o n s h o u l d b c a r e f u l n o t t y p e a n a d d it i o n a l s p a c e s w h e n e n t e r i n gt h p r o g r a m . A t h e P r e s i d e n ti a b o u t 1 0 b y t e s s h o r t o f i l li n y o u r m e m o r y . U s e r s o l a r g e r e x p a n d e r s s h o u l d f e e lf r e e t m o d i f y a n a d t t h p r o g r a m .

A t h P r e s i d e n t s h o u l dp r o v i d e y o w i t h f e m m e n t s o e n t e r t a i n m e n t a n s h o w y o u r f r i e n d s w h a t y o u rc o m p u t e r c a 6 o A d d r e s s a l a u t h o r c o r r es p o n d e n c e t S c o t t C a l a m a r ,9 1 S a n A n s e l m o A v e . # 5 S a A n s e l m o , C 9 4 9 6 0 .

7

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 79/94

N i m b o t s

B M I C H A E L B U C K L E YY o w i l l s o o n b e c o nf r o n t e d b d o z e nn a s t y N i m b o t s , w h o s es i n g l e - m i n d e d o b s e ss i o n i t p r e s i d e o v e ry o u r d e f e a t . T h i s c u n i n g g a m e o t h m i n d i b o t h f u a n c h a l l e n g i n g .

I N i m b o t s , y o u a n t h c o p u t e r — o r h u m a n o p p o n e n t -t a k e t u r n s r e m o v i n g f r o m o n t f o u r N i m b o t s a c c o r d i n g t c e r t a i n r u l e s . T m o v e , y o k e i t h l e t t e r s o t h N i m b o t st h a t y o w a n t t a k e n a w a y a n p r e s s t h r e t u r n k e y . N i m b o t st a k e n i o n t u r n m u s t b i s t r a i g h t l i n e , h o r i z o n t a l l y o d i a g o n a l l y b u t n o t v e r t i c a l l y ,a n t h e r e m u s t n o b a n g a p s . F o e x a m p l e , A D H Lw o u l d b l e g a l m o v e , b u A D w o u l d n o t — d e s p i t e w h e t h e r o n o i s t i l l i p l a c e . ( T h e c o p u t e r w i l l n o a c c e p t i l l e g a lm o v e s . ) T h p l a y e r f o r c e d t m a k e t h l a s t m o v e i t h l o s e r .

R u i R I G H T

V I C - 2 0 w i t h 8 e x p a n s i o n

E i g h t V e r s i o n sT h a b o v e r u l e s d e s c r i b e t h

s t a n d a r d v e r s i o n . W h e n y o u ' v em a s t e r e d t h a t , y o c a t r t h v a r i a t i o n i w h i c h t h o b j e c t o t h g a m e i r e v e r s e d : Y o t r t t a k e t h l a s t N i m b o t y o u r s e l f .

T h e r e a r a l s o v e r s i o n s i w h i c h t h n o - g a p s r u l e i w a i v e d — f o r e x a m p l e , F H Iw o u l d b e a n a c c e p t a b l e m o v e( r e g a r d l e s s o t h p r e s e n c e o G ) T h s t r a i g h t - l i n e s r u l e a p l i e s t a l v e r s i o n s , h o w e v e r .

A l f o u r v a r i a t i o n s m a b p l a y e d b o n o t w p e r s o n s .T h i s g i v e s y o t o t a l o e i g h tc h o i c e s , w h i c h y o s e l e c t b p r e s s i n g t h e a p p r o p r i a t e f u n ct i o n k e y , a c c o r d i n g t t h t a b l eb e l o w .F u n c t i o n N o P l a y e r s G a p s L a s t P l a y e r

F F F F F F - F F

o n o n o n o n t w t w t w t w

I t h o n e - p l a y e ry o d n o w i s h t

n n o o n n o o

l o s e sw i n s

l o s e sw i n sl o s e sw i n s

l o s e sw i n s

v e r s i o n s , i m a k e t h

o p e n i n g m o v e , s i m p l y p r e s s t h r e t u r n k e y ,w i l l g f i r s

a n t h c o m p u t e r

W h e n a s k e d t d s o y o m u s t c h o o s e d i f f i c u l t y l e v e lf r o m z e r o t n i n e . A t h e h i g h e rl e v e l s , t h c o m p u t e r p l a y sf l a w l e s s l y — b u t y o c a s t i l lb e a t i i y o m a k e a l t h r i g h t

7

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 80/94

m o v e s . A l o w e r l e v e l s , t h c o m p u t e r o f t e n a c t s r a n d o m l y .S a v e I F i r s t

N i m b o t s i w r i t t e n i B a s i c ,w i t h m a c h i n e l a n g u a g es u b r o u t i n e t h a t i P o k e d i n t ot h c a s s e t t e b u f f e r s t a r t i n g a a d d r e s s 8 2 8 . T a v o i d l o s i n g a u n t e s t e d p r o g r a m , b e s u r e t s a v e i a l e a s t o n c e b e f o r e y o r u i t

T h t o t a l o a l t h v a l u e s i t h M a r r a y i 4 9 6 8 0 , a n t h s u o a l t h n u m b e r s P o k e di n t o m e m o r y l o c a t i o n s 8 2 8 -1 0 0 3 i 2 4 6 2 7 . B e f o r e y o r u N i m b o t s , e n t e r :2 5 F O R J = 0 T O 7 1 : T = T + M % ( J ) : N E X T :

P R I N T T : E N DT h e p r o g r a m s h o u l d d i s p l a y t h n u m b e r 4 9 6 8 0 a n s t o p . I y o

g e a n o t h e r n u m b e r , y o u h a v ea e r r o r s o m e w h e r e i D a t as t a t e m e n t s 3 0 - 1 0 0 . W h e n y o g e t h c o r r e c t t o t a l , r e p l a c el i n e 2 w i t h l i n e 1 2 5 :1 2 F O R A 8 2 8 T 0 1 0 0 3 : T T P E E K ( A ) :

N E X T : P R I N T T : E N DT h i s t i m e , i y o d o n ' t g e 2 4 6 2 7 , y o h a v e D a t a e r r o r i l i n e s 8 2 8 - 9 9 1 . W h e n y o u ' v e g o i c o r r e c t , t a k e o u l i n e 1 2 5 . I y o h a v e n o t h e r m i s t a k e s ,y o s h o u l d b a b l e t " R U N I R i g h t . " ®

A d d r e s s a l a u t h o r c o r r e s p o nd e n c e t M i c h a e l F t W . B u c k l e y ,4 4 E a s t 1 9 t h S t . , N o r t h V a c o u v e r , B . C . , C a n a d a V 7 L 2 Z 6 .

N i m b o t s 1 A n c e s t o rN i m b o t s i o n o t h m a n y d e s c e n d a n t s o N i m ,

g a m e i w h i c h t w o p l a y e r s t a k e t u r n s r e m o v i n g o n o m o r e c o u n t e r s f r o m a n y o n e p i l e . T h p l a y e r u n a b l e t m a k e m o v e i t h l o s e r — i n o t h e r w o r d s , t h w i n n e rt a k e s t h l a s t c o u n t e r o c o u n t e r s .

A f t e r p l a y i n g t h e g a m e f o w h i l e , y o b e g i nr e c o g n i z i n g c e r t a i n " s a f e " p o s i t i o n s f r o m w h i c h y o u ro p p o n e n t c a n n o t w i n . T w i d e n t i c a l p i l e s a r s a f e :w h a t e v e r y o u r o p p o n e n t d o e s t o n p i l e , y o d t t h o t h e r . T h e r e f o r e , p l a y i n g N i w i t h t h r e e p i l e s , c o n t a i ni n o n e , t w a n t h r e e c o u n t e r s i s a f e b e c a u s e y o c a a l w a y s m a t c h y o u r o p p o n e n t ' s f i r s t m o v e a n f o r c e e q u a l p i l e s .

T h V I C - 2 0 i o n o t h m a n y m i c r o c o m p u t e r s b u i l ta r o u n d t h 6 5 0 2 m i c r o p r o c e s s o r . I n c l u d e d i t h 6 5 0 2i n s t r u c t i o n s e i t h E O R , o " E x c l u s i v e O R , " i n s t r u ct i o n . E O c o m p a r e s t w b i n a r y n u m b e r s , b i b b i t , g i i n a w h e n c o r r e s p o n d i n g b i t s a r e t h e s a m e a n w h e n t h e y d i f f e r .

F o i n s t a n c e , 8 E O R ' e d w i t h 1 0 w o u l d g i v e 5 3 T h i se x a m p l e s e r v e s t i l l u s t r a t e w h t h i n s t r u c t i o n i o f t e n c a l l e d " a d d w i t h o u t c a r r y . "

7

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 81/94

8 ( d e c i m a l ) 1 0 1 1 0 0 1 ( b i n a r y )1 0 ( d e c i m a l ) 1 1 0 1 1 0 0 ( b i n a r y )

5 ( d e c i m a l ) 0 1 1 0 1 0 1 ( b i n a r y )O b v i o u s l y , a n n u m b e r E O R ' e d w i t h i t s e l f i s 0 . A l s o ,

E O R ' e d w i t h E O R ' e d w i t h i 0 B e f o r e t h e r e w e r e c o m p u t e r s , m a t h e m a t i c i a n s h a

a n o t h e r n a m e f o r t h i s o p e r a t i o n : t h e y c a l l e d i n i m -s u m m i n g . T h n i m - s u m o a n s a f e p o s i t i o n i N i i s O !

O n v e r s i o n o N i s t a r t s w i t h t h r e e p i l e s o t h r e e , f i v e a n s e v e n c o u n t e r s . Y o c o m p u t e t h n i m -s u t b 1 F o e x a m p l e :

( d e c i m a l ) 0 1 ( b i n a r y )( d e c i m a l ) 1 0 ( b i n a r y )( d e c i m a l ) 1 1 ( b i n a r y )( d e c i m a l ) 0 0 ( b i n a r y )T a k i n g f r o m a n p i l e w i l l r e d u c e t h n i m - s u m t

0 Y o c a n ' t w i i y o u ' r e f a c i n g 2 5 o 3 4 o 3 5 ( u n l e s s y o u r o p p o n e n t m a k e s m i s t a k e l a t e r ) .

N o c o m e s t h s w i t c h . N o r m a l l y t h i s g a m e i p l a y e d i r e v e r s e : Y o t r t m a k e t h e o t h e r p l a y e rt a k e t h l a s t c o u n t e r . T h s t r a t e g y f o t h i s v e r s i o n i l e f t a a e x e r c i s e f o t h r e a d e r .H o t h P r o g r a m W o r k s

S i n c e t h e r e a r 1 N i m b o t s , a n e a c h o n e i t h e r i o i s n ' t t h e r e , t h e r e a r e 4 0 9 6 ( t t h e 1 2 t h p o w e r )p o s s i b l e c o n f i g u r a t i o n s . E a c h e l e m e n t o t h A a r a c o n t a i n s n u m b e r t h a t t e l l s t h c o m p u t e r w h a tm o v e t m a k e i f i t e n c o u n t e r s t h c o r r e s p o n d i n gp o s i t i o n . I a n e l e m e n t c o n t a i n s 0 t h e n t h a t p o s it i o n i s a f e ( f o r t h o p p o n e n t ) o u n a n a l y z e d ( i t h l o w - d i f f i c u l t y v e r s i o n ) , a n t h c o m p u t e r m o v e sr a n d o m l y .

L e t ' s s e u s a m p l e g a m e b o a r d d i s p l a y o w h i c h A F J a n a r v i s i b l e . A % ( 2 1 1 9 ) r e p r es e n t s t h i s s e t u p . I b i n a r y , 2 1 1 9 i 1 0 0 0 0 1 0 0 0 1 1 1 .T h a l p h a b e t l e t t e r s A - r u f r o m l e f t t r i g h t i t h i sb i n a r y n u m b e r . ( I n c l u d e t h e l e a d i n g z e r o e s s t h a tt h r e s u l t a n t 1 2 - d i g i t n u m b e r w i l l m a t c h t h 1 a l p h a b e t i z e d N i m b o t s . ) I A % ( 2 1 1 9 ) c o n t a i n s 6 w h i c h d e c o d e s t 0 0 0 0 0 0 0 0 0 1 1 0 , t h e n t h c o m p u t e rw o u l d s e l e c t N i m b o t s a n K l e a v i n g y o w i t ht h r e e i s o l a t e d N i m b o t s ( A F a n d L a n c e r t a i nd e f e a t , a s s u m i n g t h s t a n d a r d n o - g a p s - l a s t - p e r s o n -l o s e s v e r s i o n o t h g a m e .

7

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 82/94

H o d o e s A g e t c o n t a i n t h e s e v a l u e s ? T h e r ea r 7 l e g a l m o v e s , i n c l u d i n g a l v e r s i o n s , a n t h e ya r s t o r e d i t h M a r r a y . F o i n s t a n c e , M % ( 1 3 )m a o m a n o c o n t a i n 6 b e c a u s e t h i s a r r a y g e t ss h u f f l e d t r a n d o m i z e t h p l a y . I b i n a r y , i 0 0 0 0 0 0 0 0 0 1 1 0 , w h i c h , a y o s a a b o v e , s t a n d s f o N i m b o t s a n K

A i s c a n n e d f r o m b e g i n n i n g t e n d . W h e n a e l e m e n t i f o u n d t c o n t a i n z e r o , r e p r e s e n t i n gs a f e p o s i t i o n , t h e n e a c h l e g a l m o v e i M t h a tc o u l d l e a d t t h a t p o s i t i o n i a d d e d t t h ( s a f e ) i d e x , g i v i n g t h i n d e x o a n u n s a f e p o s i t i o n . T h m o v e i M i t h e n s t o r e d i e a c h l o c a t i o n t h a t i c o m p u t e d t b u n s a f e . R e f e r r i n g t t h a b o v e e x a mp l e , A % ( 2 1 1 3 ) c o n t a i n s 0 — s a f e p o s i t i o n . T h e r e a r m a n y m o v e s i M t h a t c o u l d l e a d t t h i s p o s i t i o n ,o n o w h i c h , i M % ( 1 3 ) , i s 6 . A d d i n g t 2 1 1 3 y i e l d s2 1 1 9 . S 6 g e t s s t o r e d i M % ( 2 1 1 9 ) .

O c o u r s e , a l t h i s i d o n e b e f o r e y o m a k e y o u r f i r s tm o v e . I t ' s p r o c e d u r e t h a t t a k e s o v e r 2 m i n u t e s i B a s i c , b u t o n l y c o u p l e o s e c o n d s w i t h t h e i n c l u d e dm a c h i n e l a n g u a g e s u b r o u t i n e . I y o u w a n t t c o m p a r et h t w v e r s i o n s o t h r o u t i n e , L i s t i n g s h o w s t h a s s e m b l y c o d e a l o n g s i d e t h c o r r e s p o n d i n g B a s i cs t a t e m e n t s i t h c o m m e n t s f i e l d .

A f t e r m a t hH e r e a r s o m e q u e s t i o n s h a t a n s w e r b e f o r e

c o u l d c o n v e r t t h o s e f e l i n e s o B a s i c i n t o m a c h i n el a n g u a g e . T h i s i n f o r m a t i o n w o u l d h a v e b e e n i n v a l u a b l et m f e m o n t h s a g o — I h o p e i s a v e s s o m e b o d ye l s e s o m e n e e d l e s s f r u s t r a t i o n . R e f e r e n c e t L i s t i n gw i l l h e l p y o u n d e r s t a n d t h a n s w e r s ; s o m e k n o w le d g e o t h 6 5 0 2 a s s e m b l e r i a s s u m e d .

7 W h e r e a r s o m e s a f e p l a c e s i z e r o p a g e f o i d i r e c t a d d r e s s i n g ? N i m b o t s u s e s l o c a t i o n s 1 6 3 - 1 7 6 .I ' v e u s e d t h i s a r e a w i t h o u t a n i l e f f e c t s s f a r , b u c h e c k y o u r m e m o r y m a t e n s u r e t h a t t h s y s t e m ' su s o t h e s e l o c a t i o n s d o e s n ' t c o n f l i c t w i t h y o u r s .

2 H o d y o g e i n t o B a s i c a r r a y s f r o m m a c h i n el a n g u a g e ? U s t h S t a r t o A r r a y s v e c t o r a a d d r e s s e s4 7 - 4 8 . I p o i n t s t t h p r o l o g u e o t h f i r s t d i m e ns i o n e d a r r a y — t h e a r r a y i t s e l f i s e v e n b y t e s f u r t h e ra l o n g . O t h e r a r r a y s o c c u r i o r d e r o a p p e a r a n c e , e a c h

7

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 83/94

a f t e r s e v e n - b y t e o f f s e t . I l i n e s 8 2 9 - 8 5 3 o t h a s e m b l y l i s t i n g , y o u ' l l s e h o s t o r e d t h e a d d r e s s o t h f i r s t b y t e o M % i 1 6 3 - 1 6 4 , a n o A % i 1 6 5 - 1 6 6 .

3 H o d y o m a i n t a i n r e l o c a t a b i l i t y w h e n y o n e e d t j u m p m o r e t h a n 1 2 b y t e s ? U s b r a n c h a s t e p p i n g s t o n e . L o o k a t l i n e s 9 1 a n 9 1 8 . T h e y a r b o t h B N E s . O b v i o u s l y , t h e s e c o n d o n e c a n e v e r b e x e c u t e d u n d e r n o r m a l c i r c u m s t a n c e s — i t ' s j u s td u m m y i n s t r u c t i o n . N o l o o k a l i n e 1 0 0 1 . 1 w o u l d l i k et h a v e p u B N 8 6 h e r e , b u t h a t ' s b e y o n d t h r a n g eo r e l a t i v e a d d r e s s i n g . S o i n s t e a d , p u B N 9 1 8 , a n t h e n a 9 1 8 , 1 i n s e r t e d t h B N 8 6 r i g h t b e l o w a n o t h e rB N E .

F i n a l l y , I ' b i n t e r e s t e d i h e a r i n g f r o m r e a d e r sw h f i n d s i m p l e s t r a t e g y f o a n v e r s i o n o N i m b o t s . E ]

7

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 84/94

S p e l l i n g F r i e n d

B W I L L I A M W B R A U ND o e s y o u r y o u n g s t e rn e e d h e l p i l e a r n i n gh i s / h e r w e e k l y l i s t o s p e l l i n g w o r d s ? W e l l ,m e e t C h i p p y , w h o ' st h b e s t s p e l l i n gb u d d y y o u r c h i l dc o u l d h a v e .

I S p e l l i n g F r i e n d , y o u r c h i l dc a p r a c t i c e s p e l l i n g w i t hs i m u l a t e d c o m p u t e r f r i e n d ,C h i p p y . M d a u g h t e r s , a g e sn i n e a n s i x , e n j o y u s i n g t h p r o g r a m t s t u d y t h e i r w e e k l ys p e l l i n g a s s i g n m e n t s . E v e n t h s i x - y e a r - o l d i n o a b l e t e n t e rh e w e e k l y l i s t o w o r d s .

C h i p p y , w h a p p e a r s a l a r g e s m i l i n g f a c e w i t h c u r l yh a i r , f i r s t s h o w s y o t h l i s t o s p e l l i n g w o r d s c o n t a i n e d i h i m e m o r y . H t h e n a s k s y o i

t h w o r d s a r a l r i g h t f o t h c u r r e n t s p e l l i n g s e s s i o n . I y o a n s w e r n o t h e n C h i p p y t e l l sy o t h a t y o m u s t t y p e i 2 n e w o r d s a n d p r o m p t s y o w h e n t d s o A f t e r y o u ' v e e t e r e d t h e 2 w o r d s , C h i p p y d i p l a y s t h n e w o r d l i s t , a s k i n g

I I G H T

V I C - 2 0 w i t h 3 e x p a n s i o n

i t h o s e a r a l r i g h t . Y o m a r e p e a t t h i s p r o c e s s u n t i ls a t i s f i e d .

W h e n y o i n d i c a t e t h a t t h w o r d s a r a l r i g h t , C h i p p y p r s e n t s t h p r o g r a m ' s i n s t r u ct i o n s . H i n d i c a t e s t h a t w o r dw i l l b d i s p l a y e d f o f e s e o n d s . A f t e r i v a n i s h e s , C h i p p yw i l l a s k y o u t t y p e i i c o r e c t l y . A f t e r t h i n s t r u c t i o n s a r d i s p l a y e d , y o a r g i v e n t h o t i o n o s e e i n g t h e m a g a i n o c o n t i n u i n g .

W h e n y o c h o o s e t c o t i n u e , C h i p p y s h o w s t h f i r s tw o r d i h i l i s t . T h w o r d ,w h i c h i e n c l o s e d i m u l t ic o l o r b o r d e r , a p p e a r s o n l e t t e ra t i m e . E a c h l e t t e r i a c c o mp a n i e d b y s h o r t t o n e , w h i c hi n c r e a s e s i p i t c h w i t h e a c h l e t e r . A f t e r t h w o r d d i s a p p e a r s ,y o m u s t t r t t y p e i i f r o mm e m o r y . I y o s u c c e e d , C h i pp a p p e a r s w i t h b i s m i l e ,g i v e s s h o r t m e s s a g e o e c o u r a g e m e n t a n d w i n k s a y o u .I y o s p e l l t h w o r d i n c o r r e c tl y C h i p p y f r o w n s a n i n s t r u c t sy o t t r a g a i n . I y o s p e l l t h w o r d i n c o r r e c t l y t w i c e , C h i p p ys h o w s y o t h c o r r e c t s p e l l i n g .P e r i o d i c a l l y d u r i n g t h e p r o g r a m ,a l e a s t s o m e o t h i n i t i a l l ym i s s p e l l e d w o r d s w i l l b s h o w na g a i n , g i v i n g y o m o r e p r a c t i c ew i t h t h e m .

A f t e r a l 2 w o r d s h a v e b e e nu s e d , C h i p p y s h o w s y o y o u rs c o r e a n g i v e s m e s s a g e

7

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 85/94

a b o u t y o u r p e r f o r m a n c e . A t h i sp o i n t , y o m a c h o o s e t s t a r to v e r a g a i n , s e l i s t o t h w o r d s y o m i s s p e l l e d o e n t h p r o g r a m . I y o c h o o s e t s t o p . C h i p p y i n f o r m s y o t h a ty o m a r e s a v e t h p r o g r a m i y o w a n t t h a v e t h s a m ew o r d s f o t h e n e x t p r a c t i c es e s s i o n .

A b o u t t h P r o g r a mT h r o u g h C h i p p y , t r i e d t

c r e a t e f e e l i n g o f p e r s o n a lc o m m u n i c a t i o n b e t w e e n t h c h i l d a n t h c o m p u t e r ; t h c o m p u t e r i n l o n g e r o n l ym a c h i n e t h a t d i s p l a y s w o r d sa n r e s p o n d s n e g a t i v e l y o p o i t i v e l y t c h i l d ' s i n p u t —t h c o m p u t e r h a p e r s o n a l i t y .

I y o h a v e s p e e c h s y t h e s i z e r , y o u c a n r e p l a c e o s u p p l e m e n t t h m e s s a g e s o t h s c r e e n w i t h v e r b a l s t a t em e n t s f r o m C h i p p y .

U n f o r t u n a t e l y , c o u l d n o c o d e t h i s p r o g r a m t r u o t h u n e x p a n d e d V I C ; w o u l d h a v eh a t s a c r i f i c e m o s t o t h f e a t u r e s t h a t m a k e i i n t e r e s ti n g . c o d e d i s t h a t y o c a u s i w i t h a n a m o u n t o e p a n s i o n . S o m e p r o g r a m s w i l lr u o n l y i p a r t i c u l a r a m o u n to R A i p r e s e n t . T h i s i b c a u s e t h V I o p e r a t i n g s y s t e mc h a n g e s t h s c r e e n a n c o l o rm e m o r y l o c a t i o n s w h e n y o a d m o r e t h a n 3 e x p a n s i o n . I y o u r p r o g r a m d o e s n o t a k e t h i si n t o a c c o u n t a n d p r o v i d e f o v a r i a b l e s c r e e n a n c o l o rm e m o r y l o c a t i o n s , y o m u s tr u t h p r o g r a m o n V I w i t hs p e c i f i c R A c o n f i g u r a t i o n .T h i s c a g e v e r y f r u s t r a t i n g i

y o h a v e v a r i e t y o f p r o g r a m s ,a n i c a b e r o u g h o t h e p a n s i o n p o r t c o n n e c t o r s a s y o s w i t c h a r o u n d t h R A e x p a ns i o n c a r t r i d g e s .

I S p e l l i n g F r i e n d , l i n e 9 1 0 0t a k e s c a r e o t h i s p r o b l e m . T h p r o g r a m P e e k s l o c a t i o n 4 4 w h i c h w i l l h o l d t h n u m b e r 1 i t h V I h a m o r e t h a n 3 o m e m o r y e x p a n s i o n . I t h e nc h o o s e s t h p r o p e r s c r e e n a n c o l o r m e m o r y c o n s t a n t s , w h i c ha r b a s e d o t h r e s u l t o f t h P e e k . I y o u r p r o g r a m s w i l l b P o k i n g t h i n g s a r o u n d t h s c r e e n , y o u ' l l s a v e y o u r s e l f a n o t h e r s l o o f t r o u b l e b i c l u d i n g t h i s o p t i o n i y o u rp r o g r a m s .

Y o c a o f t e n s a v e y o u r s e l fl o o c o d i n g i y o c r e a t e

s u b r o u t i n e s t h a n d l e r e p e t i t i v et a s k s . T h i s p r o g r a m u s e s m a n ys u b r o u t i n e s . F o e x a m p l e , t h e r ea r r o u t i n e s t c r e a t e C h i p p y ' ss m i l i n g o f r o w n i n g f a c e , t om a k e s o u n d e f f e c t s , t p r o d u c ed e l a y s i t h p r o g r a m a c t i o n , t or e s p o n d t c o r r e c t a n i n c o rr e c t s p e l l i n g i n p u t s a n t c r a t e t h e m u l t i c o l o r b o r d e ra r o u n d t h s p e l l i n g w o r d s .

K i d s l o v e t o p l a y w i t h t h ek e y b o a r d , j u s t t s e w h a t w i l lh a p p e n . T h i s c a n b e a p r o b l e mi t h e y d e c i d e t t r o u t h r u n / s t o p k e i t h m i d d l e o p r o g r a m . L i n e a n t i c i p a t e s t h i sp r o b l e m , a n b P o k i n g 1 1 4 t l o c a t i o n 8 0 8 , i t u r n s o f t h r u n / s t o p k e y . T h r e s t o r e k e d o e s n ' t b e c o m e d i s a b l e d , s i n c et h c h i l d w o u l d h a v e t p r e s st h e r u n / s t o p a n r e s t o r e k e y s a t h s a m e t i m e , w h i c h w o u l d b m o r e u n l i k e l y t h a p p e n .

7

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 86/94

P r o g r a m m i n g T e c h n i q u e sW h i l e w r i t i n g S p e l l i n g F r i e n d ,

h a t f i n d w a t p r e v e n tt h c h i l d f r o m t y p i n g i t h w o r d w h i l e i w a s t i l l b e i n gd i s p l a y e d o t h s c r e e n . W h e nt h I n p u t s t a t e m e n t w a e e c u t e d a f t e r t h w o r d v a n i s h e d ,t h p r o g r a m w o u l d u s t h w o r d i t h k e y b o a r d b u f f e r . T p r e v e n t t h i s , i f i n a l l y o c c u r r e dt m t u s P O K E 1 9 8 , 0 t c l e a r t h k e y b o a r d b u f f e r , i m e d i a t e l y a f t e r t h w o r d d i s a pp e a r s a n b e f o r e t h a c t u a l I p u s t a t e m e n t i e x e c u t e d . T h i so c c u r s i l i n e 6 1 T h c h i l d m a n o t y p e i t h w o r d w h i l e i i b e i n g d i s p l a y e d , b u t i w i l l n o b p i c k e d u b t h I n p u t s t a t em e n t , a n t h c h i l d w i l l h a v e t r e e n t e r i a f t e r t h w o r dd i s a p p e a r s .

N e w o r d s a r p l a c e d i C h i p p y ' s s p e l l i n g l i s t b u t i l i zi n t h " d y n a m i c k e y b o a r d "t e c h n i q u e . L i n e s 4 6 3 - 4 6 8 c o nt a i n t h r o u t i n e t h a t c r e a t e sn e D a t a s t a t e m e n t s w i t h t h n e w o r d s . A t h n e w o r d sa r e n t e r e d , t h e y a r p l a c e d i t a a r r a y , N W S .

F i v e l i n e s , b e g i n n i n g w i t hn u m b e r 9 0 0 0 , a r t h e n p r i n t e do t h e s c r e e n . T h e s e l i n e s a r D a t a s t a t e m e n t s , w h i c h c o n t a i nt h n e w o r d s . s i x t h l i n e ,w i t h o u t l i n e n u m b e r , i p r i n t e d o t h s c r e e n . T h i s l a s tl i n e d e f i n e s v a r i a b l e a n d h a s

c o m m a n d t g t l i n e 9 1 0 0 .T h c u r s o r i m o v e d t t h H o m e p o s i t i o n . T h C H R $ c o d ef o R E T U R N , 1 3 i t h e n P o k e di n t o t h k e y b o a r d b u f f e r s i t i m e s . W h e n t h E n s t a t e m e n ti r e a c h e d , i l i n e 4 6 8 , t h s i

r e t u r n s i t h k e y b o a r d b u f f e ra r e x e c u t e d , p u t t i n g t h n e D a t a s t a t e m e n t s i n t o t h e p r og r a m ( w h i l e e r a s i n g t h e o l o n e s ) a n e x e c u t i n g t h G O T O9 1 0 0 c o m m a n d .

T h v a r i a b l e V i u s e d i l i n e 9 1 1 7 , t d e c i d e w h e t h e r o n o t t h e p r o g r a m s h o u l d c o t i n u e a l i n e o l i n e 2 0 T h f i r s t t i m e t h p r o g r a m i e e c u t e d , i g o e s t h r o u g h l i n e s9 1 0 0 - 9 1 2 0 t i n i t i a l i z e v a r i a b l e s ,a n t h e n r e t u r n s t l i n e 6 T h o n l y o t h e r t i m e l i n e 9 1 0 0 i e e c u t e d i i n e w o r d s a r b i n e n t e r e d i n t o t h p r o g r a m . A t h i s p o i n t , i i n e c e s s a r y t s t a r t a t 9 1 0 0 , s i n c e t h p r o g r a ma c t u a l l y e n d e d ( a l b e i t o n l y f o s p l i t s e c o n d ) i l i n e 4 6 8 ;h o w e v e r , t h i s t i m e y o j u m p t l i n e 2 0 s i n c e y o n e e d n ' t g t l i n e t s e t h p r o g r a m t i t l es c r e e n a g a i n .

T h o n l y o t h e r w a c o u l df i n d t o c h a n g e t h s p e l l i n g -w o r d l i s t w a t a c t u a l l y e x i tt h p r o g r a m a n t y p e i n e D a t a s t a t e m e n t s , a n t h e nr e s t a r t t h p r o g r a m f r o m t h b e g i n n i n g . T h d y n a m i c -k e y b o a r d t e c h n i q u e , w h i c h y o c a p r o b a b l y f i n d m a n y u s e sf o i y o u r o w p r o g r a m s , i m u c h c l e a n e r a n e a s i e r t u s e , e s p e c i a l l y f o c h i l d r e n . I c a a l s o b u s e d t p l a c e c o m a n d s i t h k e y b o a r d , t e r a s e t h c u r r e n t p r o g r a m a n dl o a d a n r u a n o t h e r p r o g r a m .I y o p u t w p r o g r a m s , o n a f t e r t h o t h e r , o t a p e , y o c a u s t h i s t e c h n i q u e t l o a da n r u t h s e c o n d o n a t h f i r s t i e n d i n g . T h i s w o u l d b v e r y u s e f u l i y o u r p r o g r a m e c e e d e d 3 . 5 K , a s y o u c a s p l i t i

7

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 87/94

u i n t o t w s e c t i o n s . Y o c a e v e n l o a d t h i r d p r o g r a m w h e nt h s e c o n d i c o m p l e t e d , a n s o n W i t h t h i s t r i c k , y o c a m a k e t h V I r u s o m e v e r yl o n g p r o g r a m s , p r o v i d i n g t h e ya r o t y p e t h a t c a b s p l i tu i n t o p a r t s .

L o o k i n g a l i n e s 9 1 1 0 - 9 1 1 2 ,y o w i l l n o t i c e t h a t s e v e r a ls t r i n g v a r i a b l e s h a v e b e e nd e f i n e d a b e i n g e q u i v a l e n t t C H R $ c o m m a n d s . u s t h e s es t r i n g v a r i a b l e s r i g h t a f t e rP r i n t s t a t e m e n t , t e x e c u t e t h C H R $ c o m m a n d s , w h i c h p e f o r m t h s a m e f u n c t i o n a f m i l i a r k e y b o a r d p r o g r a m m i n gc o m m a n d s . F o e x a m p l e , C D i e q u i v a l e n t t m o v i n g t h c u s o d o w n o n l i n e ; B L K $c h a n g e s t h p r i n t c o l o r t b l a c k ; C H c l e a r s t h s c r e e na n m o v e s t h c u r s o r h o m e ;a n L C c h a n g e s t h c h a r a ct e r s t u p p e r - / l o w e r c a s e . T h i st e c h n i q u e p r o d u c e s l i s t i n g st h a t a r m u c h e a s i e r t u n d e rs t a n d . I n s t e a d o g e t t i n g c o f u s i n g g r a p h i c s s y m b o l s , y o ug e e a s y - t o - r e a d s t r i n gv a r i a b l e s .

T h s t r i n g v a r i a b l e s , w i t ht h e i r w e l l - c h o s e n n a m e s , m a k ei m u c h e a s i e r f o y o t r m e m b e r t h e i r f u n c t i o n s . D e f i ni n s t r i n g v a r i a b l e s i t h i s m a n e r a l s o c l a r i f i e s w h i c h s y b o l s i l i s t i n g a r c o m m a n d sa n d w h i c h a r a c t u a l l y g r a p h i c sc h a r a c t e r s . T h o n l y d r a w b a c kh a v e f o u n d t u s i n g t h i sm e t h o d i t h a t e a c h d e f i n e ds t r i n g v a r i a b l e e a t s u g o o dc h u n k o m e m o r y . I y o a r c o n f i n e d t t h u n e x p a n d e dV I C , i c o u l d u s e u p t o m u c hm e m o r y .

L i n e s 2 0 0 - 2 0 5 c o n t a i n s u r o u t i n e s t p r o d u c e d e l a y s o v a r y i n g l e n g t h . R a t h e r t h a n w r i ti n o u a F o r . . . N e x t s t a t e m e n te a c h t i m e w a n t d e l a y , s i p l c a l l u t h a p p r o p r i a t e s u r o u t i n e . p u t l o n g e r d e l a y s i c o n s e c u t i v e l y h i g h e r l i n e n u b e r s , t o m a k e i b i e a s i e r t r e m e m b e r w h i c h l i n e t h G O S U a c c e s s e s . I y o u r p r o g r a mw i l l c a l l f o u s i n g t h s a m el e n g t h d e l a y r e p e a t e d l y , t h i sm e t h o d c a s a v e y o t i m e a n b y t e s .

M a k i n g p r o g r a m s a u s e rf r i e n d l y a p o s s i b l e i a i p o r t a n t a s p e c t o p r o g r a m m i n g .T h i s i n c l u d e s t r y i n g t o a n t i c ip a t e p r o b l e m s w i t h I n p u t s t a t em e n t s . F o r e x a m p l e , l i n e s4 6 - 4 9 c o n t r o l t h p r o g r a m ' s r s p o n s e t t h c h i l d ' s i n p u t a t w h e t h e r o n o t h i n s t r u ct i o n s s h o u l d b e r e p e a t e d o t h s p e l l i n g w o r d s c o m m e n c e .

c h o s e t u s G e s t a t em e n t r a t h e r t h a n a I n p u t s t a t em e n t s i n c e o n l y o n k e n e e d st b p r e s s e d . L i n e 4 f r e e z e st h a c t i o n u n t i l k e i a c t u a l l yp r e s s e d . L i n e 4 c h e c k s t s e i t h k e w a p r e s s e d a n i t a k e s a p p r o p r i a t e a c t i o n . L i n e4 w a t c h e s f o t h k e t b p r e s s e d ; i f i t h a s , i r e p e a t s t h i n s t r u c t i o n s . I a n k e o t h e rt h a n o i p r e s s e d , t h e p r og r a m f a l l s t h r o u g h t l i n e 4 9 w h i c h p r i n t s a e r r o r m e s s a g et t h s c r e e n t h a t i n f o r m s t h c h i l d t h a t h o s h c a e n t e ro n l y o S a n t h e n b r a n c h e sb a c k t l i n e 4 6

T h s a m e t e c h n i q u e o e d i t i n g t h i n p u t i u s e d i l i n e s 4 1 8 - 4 3 0 , b u t h i s t i m e

7

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 88/94

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 89/94

P l e a s e s e n d m R e R U N V o l u m e I

C a s s e t t e v e r s i o n ( s ) a t $ 1 1 . 4 7 * e a c h . P r i c e s i n c l u d e $ 1 . 5 0 p o s t a g e a n h a n d l i n gF o r e i g n A i M a i l p l e a s e a d a a d d i t l oU . S . f u n d s d r a w n o n U . S . b a n k s O N L Y .D i s k v e r s i o n s ) a $ 2 1 . 4 7 e a c h . F o t e i s n M M a P ' e a s e a a * * * " ° ™ " < p e

C h e c k / M O M V I S A A C a r d t i E x p . D a t e .S i g n a t u r eN a m e

d d r e s sC i t y S t a t e Z i p _

R e R U N 8 P i n e S t r e e t P e t e r b o r o u g h , N 0 3 4 5 8

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 90/94

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 91/94

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 92/94

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 93/94

8/6/2019 Re-Run 1984 07-12

http://slidepdf.com/reader/full/re-run-1984-07-12 94/94

2 G r e a tN e S o f t w a r eP r o g r a m sF o Y o u rC o m m o d o r e !

a n y m a n u f a c t u r i n g d e f e c t b e c o m e s a p p a r e n t w i t h i n 3 d a y s o p u r c h a s e , t h d e f e ct i v e c a s s e t t e / d i s k w i l l b r e p l a c e d f r e e o f c h a r g e s u b j e c t t i t r e t u r n b t h c o n s u m e r b p r e p a i d m a i l . S e n d l e t t e r s p e c i f y i n g t h e d e f e c t t o

R e R U N 8 P i n e S t r e e t P e t e r b o r o u g h . N 0 3 4 5 8