Pocket_Guide_Commodore_64.pdf

(4263 KB) Pobierz
Pitman Programming Pocket Guides
Programming
BASIC
COBOL
FORTRAN
Pascal
FORTRAN 77
Programming for the BBC Micro
Assembly Language for the 6502
Assembly Language for the
zao
Programming for the Apple
The Sinclair Spectrum
The Commodore 64
John Shelley
Roger Hunt
Ray Weiland
Philip Ridler
David Watt
Clive Page
Neil Cryer and Pat Cryer
Bob Bright
Julian Ullmann
John Gray
Steven Vickers
Boris Allan
--
I
w
w
This series of pocket size reference guides provides you with
reliable descriptions of the salient features of all the important
languages and micros.
The Pocket Guide Programming is intended for those who have
had no programming experience and provides you with the lead-
in to the other programming language titles.
The Publishers would welcome suggestions for further
improvements to this series. Please write to Alfred Waller at the
address below.
PITMAN PUBLISHING LTD
128 Long Acre. London WC2E 9AN
Associoted companies
Pitman Publishing Pty Ltd. Melbourne
Pitman Publishing New Zealand Ltd. Wellington
Copp Clark Pitman. Toronto
Consultant Editor: David Hatter
First edition. 1984
©
Boris Allan 1984
All rights reserved.
Printed in Great Britain at The Pitman Press. Bath
ISBN 0 273 02125 7
Index
How to use this Pocket Guide
AND truth table 21
Arithmetical bugs 3,16
Arithmetical evaluations 18
Arithmetical operators 15
Arraying information 10
BASIC keywords 24
BASIC pointers 27
BASIC syntax 15
BASIC variables 1
Cataloguing on cassette 50
Classes of values 2
Computing values 5
File secondary addresses
File tables 49
Function names 9
Garbage collection 33
GOSUB bugs 35
GOTO and GO TO bugs
51
INPUT bugs 38
INT and two's complement 41
Keyboard buffer
34
LIST bugs 42
LOADing details 44
Logical functions 20
Loops and UNTIL 31
Nested expressions
OR truth table 21
POKEs and logical input
Stacking information
String bugs 46
13
24,
22
13
Two's complement arithmetic
41
Types of expression
36
Variable information
6
ii
ODD 0 0 0 DOn
DO
~--
.....
~-
.....
~
__
J....o
How to use this Pocket Guide
To understand the workings of the Commodore 64 (henceforth
shortened to the C64), the user needs a solid understanding ofC64
BASIC. This Guide gives the essential knowledge necessary for
that understanding.
The Guide starts with a discussion of the way in which
variables and functions are stored in C64 BASIC, and in so doing
enables us to investigate some ofthe arithmetical procedures of
the computer. In this investigation certain errors appear within
the C64 BASIC system.
After the discussion of variables and arrays, there is an
examination of arithmetical operators, relational evaluations, and
logical connectives. When we discuss logical connectives we also
examine the form of computer arithmetic known as 'two's
complement' .
The main part of the text examines in detail each keyword in
C64 BASIC, to show the limitations and potential of the C64. For
some keywords other bugs are discovered, and knowledge of these
bugs may help explain some of the strange results one sometimes
produces on the C64.
The abbreviations MUM and PREG are used extensively
throughout the guide. MUM is the MicroComputer User's
Manual
you get together with the C64, and PREG is the Programmer's
Reference Guide for the
C64,
produced separately by Commodore.
Variables in C64 BASIC
It
helps in the study ofC64 BASIC to clarify the nature of the items
with which the language deals. The term 'item' is deliberately
vague, and the purpose ofthis Guide is partly to make the nature
of this vague term rather clearer.
An item or a collection of items is known as an 'expression', of
which there are three main types.
Types
of
expression
(a) Constants are actual values in the line of program, such as 3,
3.4, or "HELP". They are-as the name implies-constant, and do
not vary: "HELP" is always "HELP".
1
Zgłoś jeśli naruszono regulamin