home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 242
/
242.d81
/
t.biii
< prev
next >
Wrap
Text File
|
2022-08-26
|
10KB
|
420 lines
u
B A S S E M
Fernando Buelna Sanchez
from Compute! Gazette
April/May 1990
Part III
PROGRAMMING AIDS
In addition to the commands which
affet how your programs assemble,
BASSEM also has commands that aid
program development. Although most of
these commands are intended to be used
only in immediate mode, some can be in
cluded in your source file.
LABEL <((number/label/string)
<,<(number/label/string)>>/CLR)>
Displays the labels defined by
BASSEM. Once you have assembled your
source file, typing LABEL displays all
the labels defined in your program
along with their hexadecimal values.
Press <CTRL> to slow the display,
<SHIFT> to freeze it, or <STOP> to
stop it.
You can display a range of labels
by typing the LABEL command followed
by the first and last values of the
range, separated by a comma. For
example
LABEL $A000, 49152
displays all the labels with values
between 40960 and 49152. The LABEL
command is similar to BASIC's LIST
command in that you can specify
open-ended ranges by leaving off one
of the range delimiters.
LABEL ,&021
LABEL $FF81
Also note that you can use any of the
numeric formats (binary, octal,
decimal, or hexadecimal) supported by
BASEM.
Another feature of the
LABEL command allows you to display
the value of a specific label or the
values of a range of labels using the
label names.
LABEL CHROUT
LABEL FRELO1,ENV3
If you can't remember exactly how a
label name is spelled or you need to
know the values of several labels with
similar names, you can search for them
using a wildcard string. As with C=DOS
commands, use the question mark to
match any one character and the
asterisk <*> to match any number of
characters.
LABEL "?E*"
HERE = $C000 RESET = $FEC3
2 LABELS DEFINED
Once you have viewed all the
defined labels, you can erase them
with the LABEL command's CLR option.
Typing LABEL CLR clears or erases the
label buffer as defined by the SET
command.
FIND chr string chr
Searches the source code in memory
for the given string and lists all
lines in which a match is found. The
[string] parameter is the string you
want to search for and the [chr]
parameters are the delimiting
characters. You can use any character
that is not found in the search string
as your delimiter. If you use the
double-quote mark <"> as the
delimiter, the search string will be
used as is; otherwise, the string will
be tokenized before the search begins.
As BASSEM searches, it lists each
line containing a string that matches
the search string. If the lines begin
to scroll off the scree, you can slow
the display by pressing <CTRL>, freeze
it with <SHIFT>, or stop it with
<STOP>. The followinig are some
examples of valid search commands:
NOTE: Because of the way BASSEM
tokenizes the new commands, you may
have lines that do not contain your
search string when it is a command.
FIND /PRINT/
(search for PRINT command)
FIND "PRINT"
(search fo the work "PRINT")
FIND ZXYZ
(search for the varable XY)
FIND _LOOP_
(search for label _LOOP)
AUTO <increment>
Prints line numbers automatically.
The increment parameter determines how
BASSEM calculates the next line
number. To hve BASSEM print the line
numbers for you, enter the AUTO
command with the increment valuse and
then enter your first line of code.
When you press <RETURN> to enter the
line, BASSEM prints the next line
number. The line number it prints is
the current line number plus the
increment value.
For example, if you enter the
command AUTO 10 and then type
100 'WORLD'S GREATEST PROGRAM
BASSEM will print 110 as the next line
number. To turn off the automatic line
number option, enter AUTO command by
itself. Valid increment values are 0 -
65535.
When you are in AUTO mode, if a
new line number already exists, the
computer prints a <'> prior to the
line number. If this happens, you can
press <RETURN> and the old line won't
be changed.
You can stop AUTO in one of three
ways: by pressing <RETURN> on a line
beginning with a <'>, press <RETURN>
over an empty line, or Press <Shift-
RETURN> anywhere.
RENUM <start line <,increment>>
Changes the line number of the
program so that they increment by a
constant value. The first parameter
indicates the line number for the
first line of the program. The second
parameter gives the step values used
between successive line numbers.
For example,
RENUM 100,5
will renumber the program so the first
line number is 100, and all other
lines are by 5's. Entering RENUM
without any parameters uses the
default values of 10,10. This command
does [NOT] change any GOTO or GOSUB
line numbers. (Not particularly useful
-- Ed.)
DEL (line# <- <line#>>/-line#)
Works just like LIST, except that
lines in the given range disappear
forever.
OLD
Recovers a source file erased
using BASIC's NEW command. Does not
rescue a program erased with the DEL
command.
LFT (SET/CLR)
List FormaT -- displays LISTing of
program in an easy-to-read style. You
can add new lines while in LFT SET
mode, but [do not] edit a line that is
formated. LFT CLR turns off feature.
DISK COMMANDS
In addition to all the above,
BASSEM adds seven commands for
controlling your disk drive. These
default to drive 8 unless you specify
otherwise. Also, commands that require
a string or filename as a parameter
can accept up to 41 characters.
DISK <(string <,dev>/new default dev)>
Sends string to the disk drive
command channel, displays drive
status, or sets default device drive
number. If you enter DISK followed by
a string, BASSEM send the string to
the default drive's command channel.
This is useful for performing tasks
such as scratching files or validating
disks. When typed alond, DISK displays
the drives current status.
Another feature of DISK is that it
allows you to change the default
drive, with
DISK dev
where dev is a device number (8-11).
DIR <string <,dev>>
Displays a disk directory on the
screen. By itself, DIR lists the whole
directory. The string parameter is
like using LOAD"$:b?.*",dv (except
with DIR, your program is not
bothered). And the dev parameter lets
you get directories from any drive.
WRITE filename <,dev>
Writes the object code generated
by BASSEM to disk. Do not forget the
",P,W" extension on the filename! You
can write to any drive by including
the dev parameter.
For BASSEM to write the object
code correctly, you must place the
WRITE command before the BAS and PASS
1 commands. This is all handled for
you if you use SHELL.BC.
PUT (line# <-<line#>>/-line#),filename
<,dev>
Saves protions of the source code
in given range to filename. Sort of
LIST meets SAVE!
AFFIX filename <,dev>
Appends a source file to the end
of the program in memory. AFFIX works
like LOAD, except the file doesn't
overwrite the current program.
AFFIX does not merge the file from
the disk with the program in memory.
It does no replace existing lines. It
does not arrange the two files in
line-number order. It just AFFIXes!
DLIST filename <,dev>
Lists a source program file from
disk without disturbing memory. You
can control how the listing scrolls
with <CTRL>, <SHIFT>, and <STOP>.
(Note: Excellent for recovering lines
that got screwed up. DLIST the BC
file, stop the listing at the right
place, then press <RETURN> over each
line to be replaced.)
MERGE filename <,dev>
Merges a program from disk with
the one in memory by reading the
program from the disk, listing each
line to the screen, and adding it to
the program in memory. When programs
have common line number, the merged
line takes precedence. (Be sure LFT is
CLR before using MERGE.)
ERROR MESSAGES
To help you debug your program,
BASSEM adds several error and warning
messages to BASIC.
OUT OF LABEL MEMORY
The buffer you SET is full. Make
it bigger.
LABEL ALREADY EXISTS
You have tried to define a label
that is already there. To fix the
problem,
FIND _LABEL_
then change one instant or set of the
offending of the label.
LABEL NOT FOUND