Atari BASIC Faster and Better.pdf

(104940 KB) Pobierz
299884785 UNPDF
299884785.003.png
299884785.004.png
ATARI Information Series - Volume I
Carl M. Evans
ATARIBASIC
Faster and Better
Editor - Charles Trapp - Gunslinger
Production - Cindy Hall - Bouncer ..
Production Assistant - Debbie Cooke Runner
Everybody's Assistant - David Moore - Magic
Cover - D. J. Smith - Bass Guitar
This book is dedicated to Lewis Rosenfelder . . . in grateful
acknowledgment ofhis being that sp ecial kind ofpionee r, who,
being the first to go , carried the lantern high.
ISBN 0 936200 29 4
Copyright © 1983 by IJG Inc.
10 9 8 7 6 5 4 3 2 1
All rig hts reserve d. No pa rt o f t hi s book m ay be re produ ce d by any m e ans without the express written
permi ssio n o f t he pub li s he r. Exa mple programs a re for personal use only. E ve ry re a sonable effort has
bee n ma d e to ens ure accuracy throughout t hi s boo k, but ne ithe r the author nor the publi s her can assume
res pons ibili ty fo t' an y e rro rs or o mi ssion s . No li a bility is assume d for a ny dire ct, or indirect, damages
re s ul t in g fr om the u se of information conta in e d here in.
AT ARI is a registered t ra demark of ATARI In c. , a division of Wa l'l1 er Co mmuni cat ions Company.
Printed in the United States of Am eri ca
299884785.005.png
2 Notice
Final Thoughts
About the Author
Carl studied electronic engineering at the Georgia Institute of Technology, specializing in
electro-optical communications. He first became involved with computers in 1971.
Fortunately, for those ofus wishing to know the secrets of"Atari magic," Carl's involvement
appears deep and lasting. A champion has appeared, carrying a book of !,pells and
incantations ... Atari BASIC Faster and Better.
Carl is currently the manager of IJG's publications department. IJG publishes technical
books - in non-technical language - about home computers.
He also runs VERVAN Software; a software and documentation consulting firm that has
developed an extensive series of machine-language utilities for the Atari computer.
Carl has been writing on a professional basis since 1978, and is widely published in various
technical and home computer magazines. He's been writing a regular tutorial column; Tape
Topics , and a technical help column; Tangle Angles, for ANTIC magazine since_1982 .
David E. Moore - Wizard's Assistant
From the Author
As I write my final thoughts about this book I am in a strange frame of mind. I started
writing this book like I would have started any other project. I scoped the task and laid out a
Gantt chart for it. Now, this book has changed my life. I was a successful project engineer for
an aerospace company and had a good shot at climbing the corporate ladder. Now, I am the
publications managerfor a book publisher- namelyIJG. lowe the change in my career to this
book, and Harv Pennington. I have always loved to write, but I never thought I could make a
career of it. Harv showed me that I could. As publications manager for IJG, I can continue my
writing, and help other authors bring their hopes to fruition. I couldn' t be happier. Thanks,
Harv.
Carl M. Evans
August 1983
299884785.006.png 299884785.001.png
ATARI BASIC Faster & Better 3
.",
Contents
Preface .... .. .. . . . .... . . ...... ... ....... . .. .............................. 10
Introduction
What is Faster and Better? . .. . .. ... ...... ...... ..... .......... .......... 12
How to Use this Book
14
Chapter One
Subroutines, Handlers and Shells ............................ . ......... 16
Subroutines .. . ... .. . . .. .. .............................................. .. 16
Handlers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 17
Shell Programs ............... .. .......................................... 18
Programming Conventions Used in This Book ................................ 18
Chapter Two
How to Program Efficiently in BASIC . ...................... . ............ 20
Fundamental Concepts ... .................................. .. . .... .... . ... 20
Good Habits to Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 22
Making Backup Copies . .. . .......................................... . ... 22
Planning Video Layouts .......... ...... ............... ...... ........ . ... 22
Setting Up Error Traps . ................................................. 28
Minimizing Program Execution Time ..................................... . .. 29
Minimizing the Size of a Program ........................................... 30
Chapter Three
Using Machine Language in BASIC ..................................... 33
Writing USR Routines with an Assembler/Editor ..... .. . . .................... 34
How to Load and Execute USR Routines from Disk ... .. .. .. ....... . ..... .. .... 37
POKEing USR Routines into Memory . ................................... . .. 37
SFILL.DEM (DEMO) ........ ... ..... ........ ... ...... . ........... . . ... . 38
CONVERT.BAS (PROGRAM) .... . ..................................... 39
Object File into BASIC Data Statements .. ...... . . .......................... 40
Saving USR Routines to Disk .............. ... ............................. 41
SFILL.LST (SUBROUTINE) ... . .. .. . . .............. . ............. . .. . .. 41
Loading USR Routines into Strings .... ......... . .... .................... . .. 42
DATAPAKBAS (PROGRAM) ........................................... 42
299884785.002.png
Zgłoś jeśli naruszono regulamin