TABLE OF CONTENTS
INTRODUCTION
What's Included?
How to Use This Reference Guide
Commodore 64 Applications Guide
Commodore Information Network
1. BASIC PROGRAMMING RULES
Introduction
Screen Display Codes (BASIC Character Set)
The Operating System (OS)
Programming Numbers and Variables
Integer, Floating-Point and String Constants
Integer, Floating-Point and String Variables
Integer, Floating-Point and String Arrays
Expressions and Operators
Arithmetic Expressions
Arithmetic Operations
Relational Operators
Logical Operators
Hierarchy of Operations
String Operations
String Expressions
Programming Techniques
Data Conversions
Using the INPUT Statement
Using the GET Statement
How to Crunch BASIC Programs
2. BASIC LANGUAGE VOCABULARY
BASIC Keywords, Abbreviations, and Function Types
Description of BASIC Keywords (Alphabetical)
The Commodore 64 Keyboard and Features
Screen Editor
3. PROGRAMMING GRAPHICS ON THE COMMODORE 64
Graphics Overview
Character Display Modes
Bit Map Modes
Sprites
Graphics locations
Video Bank Selection
Screen Memory
Color Memory
Character Memory
Standard Character Mode
Character Definitions
Programmable Characters
Multi-Color Mode Graphics
Multi-Color Mode Bit
Extended Background Color Mode
Bit Mapped Graphics
Standard High-Resolution Bit Map Mode
How It Works
Multi-Color Bit Map Mode
Smooth Scrolling
Sprites
Defining a Sprite
Sprite Pointers
Turning Sprites On
Turning Sprites Off
Colors
Multi-Color Mode
Setting a Sprite to Multi-Color Mode
Expanded Sprites
Sprite Positioning
Sprite Positioning Summary
Sprite Display Priorities
Collision Detects
Other Graphics Features
Screen Blanking
Raster Register
Interrupt Status Register
Suggested Screen and Character Color Combinations
Programming Sprites-Another Look
Making Sprites in BASIC - A Short Program
Crunching Your Sprite Programs
Positioning Sprites on the Screen
Sprite Priorities
Drawing a Sprite
Creating a Sprite Step by Step
Moving Your Sprite on the Screen
Vertical Scrolling
The Dancing Mouse-A Sprite Program Example
Easy Spritemaking Chart
Spritemaking Notes
4. PROGRAMMING SOUND AND MUSIC ON YOUR COMMODORE 64
Introduction
Volume Control
Frequencies of Sound Waves
Using Multiple Voices
Controlling Multiple Voices
Changing Waveforms
Understanding Waveforms
The Envelope Generator
Filtering
Advanced Techniques
Synchronization and Ring Modulation
5. BASIC TO MACHINE LANGUAGE
What Is Machine Language
What Does Machine Code Look Like?
Simple Memory Map of the Commodore 64
The Registers Inside the 6510 Microprocessor
How Do You Write Machine Language Programs?
64MON
Hexadecimal Notation
Your First Machine Language Instruction
Writing Your First Program
Addressing Modes
Zero Page
The Stack
Indexing
Indirect Indexed
Indexed Indirect
Branches and Testing
Subroutines
Useful Tips for the Beginner
Approaching a Large Task
MCS6510 Microprocessor Instruction Set - Alphabetic Sequence
Instruction Addressing Modes and Related Execution Times
Memory Management on the Commodore 64
The KERNAL
KERNAL Power-Up Activities
How to Use the KERNAL
User Callable KERNAL Routines
Error Codes
Using Machine Language From BASIC
Where to Put Machine Language Routines
How to Enter Machine language
Commodore 64 Memory Map
Commodore 64 Input/Output Assignments
6. INPUT/OUTPUT GUIDE
Introduction
Output to the TV
Output to Other Devices
Output to Printer
Output to Modem
Working With Cassette Tape
Data Storage on Floppy Diskettes
The Game Ports
Paddles
Light Pen
RS-232 Interface Description
General Outline
Opening an RS-232 Channel
Getting Data From an RS-232 Channel
Sending Data to an RS-232 Channel
Closing an RS-232 Data Channel
Sample BASIC Programs
Receiver/Transmitter Buffer Base Location Pointers
Zero-Page Memory Locations and Usage for RS-232 System Interface
Nonzero-Page Memory Locations and Usage for RS-232 System Interface
The User Port
Port Pin Description
The Serial Bus
Serial Bus Pinouts
The Expansion Port
Z-80 Microprocessor Cartridge
Using Commodore CP/M
®
Running Commodore CP/M
®
APPENDICES
Abbreviations for BASIC Keywords
Screen Display Codes
ASCII and CHR$ Codes
Screen and Color Memory Maps
Music Note Values
Bibliography
VIC Chip Register Map
Deriving Mathematical Functions
Pinouts for Input/Output Devices
Converting Standard BASIC Programs to Commodore 64 BASIC
Error Messages
6510 Microprocessor Chip Specifications
6526 Complex Interface Adapter (CIA) Chip Specifications
6566/6567 (VIC-II) Chip Specifications
6581 Sound Interface Device (SID) Chip Specifications
Glossary
INDEX
COMMODORE 64 QUICK REFERENCE CARD
SCHEMATIC DIAGRAM OF THE COMMODORE 64
This page has been created by
Sami Rautiainen
.
Read the
small print
.
Last updated December 22, 2002.