Commodore 2001-8 User Manual page 97

Table of Contents

Advertisement

e.
g.
L D A MSB
LDY
LSB
JSR
INTFLP
USEABLE I/O ROUTINES
Read a line, pass a character
$FFCF
return char in 0
no other regs changed
Print a character on screen
$FFD2 Char in A
no regs changed
Test for stop key
$FFE1 returns =,
<>
only A changed
Get a character from keyboard
$FFE4
char or if none then null (00)
SUMMARY
There are two ways to communicate from BASIC to machine language program. The simplest of these is
SYS in which the control of the computer is turned over to the machine language program located at the
address specified in thesys command. For implementing your own functions in BASIC, there is
a
function
calfed USR which when memory locations of
1
and
2
are properly initialized to point in a machine
language program, evaluate
a
parameter specified in the user function and pass the results back to the
program using the floating accumulator. A series of useful subroutines, available in BASIC, can allow
either the USR or SYS function to perform operations on the floating accumulator without the user
running any program other than the calling routines.
In all cases, the use of the machine language program is only for the more sophisticated BASIC user.
The protection of the ROM fail safe coding is lost. Machine language programs should only be used when
BASIC is neither fast enough nor the function which is desired is implemented.
MACHINE LANGUAGE MONITOR
TIM is the Terminal Interface Monitor program for MOS Technology's 65XX microprocessors. It has been
expanded and adapted to function on the Commodore PET. PET uses a cassette tape version of this
monitor. Execution is transfered from the PET BASIC interpreter to TIM by the SYS command.
To LOAD your MONITOR, take the cassette with MONITOR and put it in the tape unit with the MONITOR
side up. Then type: LOAD "MONITOR" and, when ready, RUN.
Commands typed on the PET keyboard can direct TIM to start executing a program, display or modify
registers and memory locations, and load or save binary data. On modifying memory, TIM performs
automatic read after write verification to insure that addressed memory exists, is R/W type, and is
responding correctly.
TIM also provides several subroutines which may be called by user programs. These include reading and
writing characters on the video display, typing a byte in hexadecimal and typing a CRLF sequence.
95

Advertisement

Table of Contents
loading

This manual is also suitable for:

Pet 2001-8

Table of Contents