Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Commodore Basic 4.0 (CBM 8032)

222 views
Skip to first unread message

Hal Zabin

unread,
Jun 23, 1996, 3:00:00 AM6/23/96
to

I just bought a CBM 8032 (without handbooks) and was wondering if anyone knows
of anyplace to find the basic commands for the built in basic 4.0.
Thanks, Hal


J-Miester

unread,
Jun 23, 1996, 3:00:00 AM6/23/96
to

za...@berlin.snafu.de (Hal Zabin) wrote:

I just recieved a CBM-SP9000 (without handbooks) and was wondering if
the someone who has knowledge of the above could please forward the
same to my address. Also include anything you are looking for in case
I may be able to help. Thanx. - Jason Gould.


**************************************************************
** **
** The J-Miester strikes again! nstn...@fox.nstn.ca **
** **
**************************************************************


Onno Ebbinge

unread,
Jun 24, 1996, 3:00:00 AM6/24/96
to

> I just bought a CBM 8032 (without handbooks) and was wondering if
> anyone knows of anyplace to find the basic commands for the built
> in basic 4.0. Thanks, Hal

From petcat.c by Jouko Valta:

/*
* $Id: petcat.c,v 2.1 1996/04/01 09:01:41 jopi Exp jopi $
*
* This file is part of Commodore 64 emulator
* and Program Development System.
*
* Copyright (C) 1993-1995,1996, Jouko Valta
*
[snip]
*
* Written by
* Jouko Valta
*
*/

[snip]

/*
* CBM Basic Keywords
*/

char *keyword[] = {
/* Common Keywords, 80 - cb */
"end", "for", "next", "data", "input#", "input", "dim", "read",
"let", "goto", "run", "if", "restore", "gosub", "return", "rem",
"stop", "on", "wait", "load", "save", "verify", "def", "poke",
"print#", "print", "cont", "list", "clr", "cmd", "sys", "open",
"close", "get", "new", "tab(", "to", "fn", "spc(", "then",
"not", "step", "+", "-", "*", "/", "^", "and",
"or", ">", "=", "<", "sgn", "int", "abs", "usr",
"fre", "pos", "sqr", "rnd", "log", "exp", "cos", "sin",
"tan", "atn", "peek", "len", "str$", "val", "asc", "chr$",
"left$", "right$", "mid$", "go"};

[snip]

char *petkwcc[] = { /* PET Basic 4.0 0xcc - 0xda */
"concat", "dopen", "dclose", "record",
"header", "collect", "backup", "copy","append", "dsave","dload", "catalog",
"rename", "scratch", "directory",
/* Basic 4 Extension for C64 (0xdb - 0xe3) */
"color", "cold", "key", "dverify", "delete",
"auto", "merge", "old", "monitor"
};


Onno

Joesph Fenn

unread,
Jun 25, 1996, 3:00:00 AM6/25/96
to J-Miester
If not mistaken that basic 4 is same basic as was used in the C16 and
plus4 cbm machines.
Check with anyone using those 2 machines as they are still in use by
a few users and they can describe the differences between basic 4 and
basic 7 as used on the C128.
**** kilroy ****

Dan Amborn

unread,
Jun 25, 1996, 3:00:00 AM6/25/96
to
On 23 Jun 1996 20:46:34 GMT, za...@berlin.snafu.de (Hal Zabin) wrote:

>I just bought a CBM 8032 (without handbooks) and was wondering if anyone knows
>of anyplace to find the basic commands for the built in basic 4.0.
>Thanks, Hal
>


A nice person named Sid Davis typed most of this for me one day due to a similiar request
I had made in a Compuserve forum. Most of it is out of the Basic 4.0 manual. I've added
to it and am reposting it here. This should help you out.


These are the additional commands of Commodore Basic 4.0 over Basic 2.0
On dual drive systems all commands default to drive 0 (D0).


APPEND

format: APPEND#<FILE NUMBER>,"<NAME>"[,D<X>][ON U<Y>]
purpose: To write additional data to the end of a CBM disk sequential file.
remarks: APPEND is like a DOPEN except it applies only to sequential files.
The CBM disk pointers are positioned beyond the current end of
file. Additonal data may then be written and the file re-closed.
Whenever a variable or an evaluated expression is used as a
filename it must be surrounded in parentheses.
Unit defaults to 8, drive to 0.
example: APPEND#1,"MASTER"
Reopen master file on unit 8 drive 0 with a logical file #1 for
future PRINT#.

BACKUP

format: BACKUP D<X> TO D<Y> [ON U<Z>]
purpose: To duplicate the entire contents of a CBM disk to another diskette.
remarks: User specified drive numbers must be 0 or 1. Drive numbers in the
BACKUP command must be unique. Unit defaults to 8.
example: BACKUP D0 TO D1

COLLECT
Cleans up fragments in the disk directory after prolonged use.
example: COLLECT D1 (<D1> optional)

CONCAT

format: CONCAT [D<X>,]<"NAME1"> TO [D<Y>,]<"NAME2">[ON U<Z>]
purpose: Concatinate sequential files.
remarks: Old file name 2 is deleted and replaced with a new file which is
the concatenation of the two files. Whenever a variable or an
evaluated expression is used as a filename it must be surrounded
by parentheses.
example: CONCAT "YOURFILE"TO"MYFILE"
MYFILE becomes MYFILE + YOURFILE
CONCAT D1,"<old>" TO D1,"<new>" (<D1,> optional)
COPY

format: COPY [D<X>] TO [D<Y>]
purpose: Make a copy of a file within a disk unit.
remarks: The COPY command can only function between drives or a single drive
within one unit. COPY without file names copies all files from Dx
to Dy without altering files that already exist on Dy. Whenever a
variable or an evaluated expression is used as a filename it must
be surrounded by parentheses.
example: COPY D0 TO D1 (copy all files from d0 to d1)
COPY D1,"TEXT" TO "BACKUP" (create BACKUP on drive 1)
COPY D1,"<old>"TO D1,"<new>" (<D1,> optional)


DCLOSE

format:DCLOSE [#<1>] [ON U<x>]
purpose: Close disk files.
remarks: This command can close all files currently open on a disk unit or
only the logical file specified. If no logical file number is
specified, all files currently open will be closed. If both the
logical file number and ON unit clauses are specified, the command
still has the same effect as if only the logical file number was
specified.
In closing relative files, more records may be generated than
were asked for, in order to fill out buffers in use.
example: DCLOSE
DCLOSE#5
DCLOSE ON U7

DIRECTORY or CATALOG

Prints disk file listing to the screen without destroying the
program in memory.
example: DIRECTORY D1 or CATALOG D1 (<D1> optional)

DLOAD

Like the normal load except defaults to device number 8.
Loads into regular location at the bottom of basic memory.
example: DLOAD D1,"<file name>" (<D1,> optional)

DOPEN

format:DOPEN#<1>."<NAME>" [,L<y>] [,D<x>] [ON U<z>] [,W]
purpose: Declare a sequential or random access file for read or write.
remarks: #<1>. logical file number used to associate future disk operators
back to this file open operation. 1<=1<=255. Logical file numbers
greater than 128 cause a carriage return and line feed to be sent
with each PRINT#. Logical file numbers less than 128 send only the
carriage return. The carriage return can be suppressed by the use
of the semi-colon.
L<y>. .record length causes allocation of a random access file with
record length y: 1<=y<=255. Opened for read and write, by default.
D<x> drive number defaults to 0.
U<z> unit defaults to 8.
For sequential files, Write must be spaecified with a W, or the
file will be opened to Read. Whenever a variable or an evaluated
expression is used as a filename it must be surrounded in
parentheses.
It is possible to replace an existing file with DOPEN, using the
@:
example: DOPEN#2,"@file1",d1
DOPEN#5,(A$)
Where a$="filename"

DS/DS$
Returns a disk error code.
example: PRINT DS for error number or DS$ for complete message.

DSAVE
Like the normal save except defaults to device number 8.
example: DSAVE D1,"<file name>" (<D1,> optional)



HEADER

format: HEADER "<DISKNAME>",D<x> [,I<zz>] [ON U<Y>]
purpose: To format a blank disk or clear an old disk.
remarks: When I<zz>, a disk ID number, is specified this command formats the
disk specified. Otherwise the directory is cleared and the new name
assigned to the disk. This command requires caution in it's use.
A media error is possible with the HEADER command. This can be
caused by a missing disk, write protect tab in place, or bad media.
The HEADER command reads the disk command channel and if an error is
encountered, will return the error message "?BAD DISK".
Whenever a variable or an evaluated expression is used as a disk
name it must be surrounded by parentheses. The disk id (Izz) may
not be specified with a variable.
example: HEADER "MASTER DISK",D0,I01
HEADER"<diskname>", D1, I<ID>

IF/GOTO

Similiar to the IF/THEN command except for directing the outcome
directly to a specified line number rather than a possible action.
example: IF A>2 GOTO 10

RECORD

format: RECORD#<logical file>,<record> [<byte>]
purpose: Used before GET#, INPUT#, or PRINT# to position the record
pointer in a random access file.
remarks: Record number r such that 0<r<=65535. Byte pointer b such
that 1<=b<=254. Default value is 1.
When record pointer is set beyond last record the following
conditions occur: If PRINT# is used, the appropriate number
of records are generated to expand the file to the desired
record. If INPUT# is used, a null line is returned with EOI
in variable ST. If the record pointer is set beyond the end
of the current end-of-file, DS$ will contain "RECORD NOT
PRESENT". Whenever a variable or an evaluated expression
is used as a record number it must be surrounded in parentheses.

example: 10 DOPEN#1,"RANDOM",L80
20 FOR I = 1TO10
30 RECORD#1,(I)
40 PRINT#1,"ABCDEFG"
50 NEXT
60 DCLOSE#1

RENAME

format: RENAME [D<x>,] "<old name>" TO "<new name>" [ON U<y>]
purpose: Change the name of a disk file.
remarks: The disk will not execute RENAME on any currently open file.
Drive defaults to 0 and Unit defaults to 8.
Whenever a variable or an evaluated expression is used as a
filename it must be surrounded in parentheses.
example: RENAME "MASTER" TO "BACKUP"
RENAME D1,"<old>"to D1,"<new>" (<D1,> optional)




SCRATCH
Removes a filename specified from the disk.
example: SCRATCH D1,"<file name>",8 (<D1,> optional)

WAIT

format: WAIT <address>,I[,j]
purpose: To suspend program execution while monitoring the status of a
machine input port.
remarks: The WAIT statement causes execution to be suspended until a
specified machine address develops a specified bit pattern. The
data read at the address is exclusive ORed with the integer
expression J, and then ANDed with I. If the result is zero,
BASIC loops back and reads the data at the port again. If the
result is nonzero, execution continues with the next statement.
If J is ommitted, it is assumed to be zero.
CAUTION: It is possible to enter an infinate loop with the WAIT
statement, in which case it will be neccessary to manually
restart the machine.
example: 100 WAIT 59411,8,8
This statement suspends execution until PLAY is pressed on the
cassette unit (keep in mind this is for a PET 4032)

STATUS
STATUS is a system variable used to ascertain the status of the
last I/O operation be it from an open channel on the keyboard,
screen or a disk drive. It's name may be STATUS in the book but
you can shorten it up to ST in your programs because no variable

uses more than 2 letters anyway, to my knowledge. I use the
variable ST to detect when the end of an error message from the
disk drive has occured, for instance. This will read the error status
from a disk drive.
example:
10 open15,8,15:rem open the command channel of the serial bus
20 get#15,a$:if st=64then close15:print b$:end:rem check st for end
30 b$=b$+a$:goto 20:rem string addition, loop if not finished

VERIFY

Verifies a filename located on disk with the program in memory.
example: VERIFY"<file name>",8

-----

Dan Amborn
dam...@hutchtel.net

-----

Peter Karlsson

unread,
Jul 8, 1996, 3:00:00 AM7/8/96
to

In article <31cf1e1f...@news.polaristel.net> written on Tuesday June 25
1996, one could hear dam...@hutchtel.net (Dan Amborn) say:

> IF/GOTO
> Similiar to the IF/THEN command except for directing
> the outcome directly to a specified line number rather than a
> possible action.
> example: IF A>2 GOTO 10

What's the difference between that and the standard
IF A>2 THEN 10
?

\\//
Peter - m9...@abc.se (e-mail replies only, please)

... C'mon PUNK , make my day ..

Jens Ellerbrock

unread,
Jul 12, 1996, 3:00:00 AM7/12/96
to

Peter Karlsson (m9...@abc.se) wrote:
> > example: IF A>2 GOTO 10
>
> What's the difference between that and the standard
> IF A>2 THEN 10

Nothing, you can look it up in a ROM listing (if you have one)

Jens
--
Jens Ellerbrock * Holtenauer Str 162 * 24105 Kiel * plu...@hades.cls.de
"BELIEVE AND DECEIVE" ><> * Tel: 0431 / 806890 * Modem/x75: 0431 / 84749
-----------------------------------------------------------------------------
Tired and bored of your operating system ?
Just go ahead and write your own multitasking multiuser os !
Worked for me all the times.
-- Linus Torvalds --

Mage...@goth.org

unread,
Jul 12, 1996, 3:00:00 AM7/12/96
to

>>>>> "Peter" == Peter Karlsson <m9...@abc.se> writes:

>> IF/GOTO Similiar to the IF/THEN command except for directing the
>> outcome directly to a specified line number rather than a possible

>> action. example: IF A>2 GOTO 10

Peter> What's the difference between that and the standard IF A>2 THEN
Peter> 10 ?

none whatsoever,
--
___ . + . . . Per Olofsson
._|___|_, . . . . . + . . o
o-o + . + Mage...@Goth.Org . . + + + .
- . . . o + . . .
" + + . http://www.cling.gu.se/~cl3polof/

C++ - like C but with two trainers

0 new messages