MON80 Preliminary man page


NAME
MON80 - monitor program in the spirit of MIKBUG, SWTBUG, et al.

DESCRIPTION
Allows exploring and tinkering with bytes in memory.

MON80 is interactive; the user enters commands on the keyboard, and the results are displayed on the screen. Commands allow for viewing and changing the contents of memory, and reading/writing binary disk files and disk sectors from selected regions of memory. It has two bits of state: one controls whether data is to be entered and displayed in ASCII or in hexadecimal; the other controls whether files are to be loaded and saved to cassette tapes or floppy disks.

Below is a list of the commands supported:

A
ASCII mode - bytes will be displayed and entered as ASCII characters rather than hexadecimal numbers. Compare with the "H" command.

B
Break; BASIC - exit the program, return to BASIC

C Adr1 Adr2
print Checksum - calculate the checksum for a region of memory; useful as a quick check that one region exactly matches another, or that a file loaded properly.

D
Disk mode - Read and Write commands will use floppy disks rather than cassette tapes. Compare with the "T" command.

F Adr1 Adr2 d1 d2 d3 ... d16
Fill memory - fills a region of memory with the given sequence of data values. Anywhere from one to sixteen bytes of data may be given.

G
Get a disk sector - the program prompts for a track and sector number and an address at which to store it. After reading it, it immediately goes into "List mode" (see the L command) showing that address.

H
Hex mode - bytes will be displayed and entered as hexadecimal numbers rather than ASCII characters. Compare with the "A" command.

J Addr
Jump to address - begins execution of the machine-code program at the given address

L Addr
List memory block - displays eight bytes of data starting with the given address, at which point the user can do any three things:
1) type "N" or the space bar; the next eight bytes are displayed
2) type "P" or "^"; the previous eight bytes are displayed
3) press enter; ends the "L" command

M Addr
Modify memory - displays the byte at the given address, at which point the user can do any of four things:
1) type "N" or the space bar; the next address and value are displayed
2) type "P" or "^"; the previous address and value are displayed
3) press enter; ends the "M" command
4) enter a new value; that value is stored at the address, and the next address and value are displayed.

P
Put a disk sector - the program prompts for a track and sector number and an address at which to find it. It writes data from the given address into the specified sector.

R file offs
Read a file - reads the named file from the disk or tape into memory, at its original location plus the specified offset. Null filenames (ie: pressed enter or the spacebar) are okay with cassette tapes, but not with floppy disks.

S adr1 adr2 d1 d2 d3 ... d16
Search memory - searches a region of memory for the given sequence of data values. Anywhere from one to sixteen bytes of data may be given. Prints each address at which the pattern occurs.

T
Tape mode - Read and Write commands will use cassette tapes rather than floppy disks.

U
User function call - calls USR1, which may have been defined by the user, or would have been set by the most recent "J" command.

W file adr1 adr2 adr3
Write a file - writes the regions of memory from adr1 to (and including) adr2 into the file. Also saves adr3 as the transfer address, to be used if the file is executed as a binary command.

= adr1 adr2 adr3
compare memory - compares the region of memory from adr1 to adr2 (inclusive) against the region starting at adr3, and displays pairs of corresponging addresses at which the data values are not equal.

# n addr
define entry point - remembers the given address as the n'th "entry point", for use with the ">" command. "n" must be a decimal digit.

> n
use entry point - begin execution of the machine-code program at entry point number "n". "n" must be a decimal digit. See the "#" command.

?
list commands - displays a (very) terse help-screen.

INTERNAL SUBROUTINES

  8000 Display A as a four-digit hexadecimal address

  8200 Display one byte of data in D
       If M2$="A" and D is printable, displays one ASCII character;
       otherwise displays two hex digits

  8300 Display T as one hex digit

  8400 Wrap A into the range 0..65535 (ie: drop 16-bit overflow)

  9000 Enter a four-digit hexadecimal address, return it in A  (A=address)
       Returns E=0 if it was entered properly, E<>0 otherwise  (E=error)

  9200 Enter one byte of data, return it in D                  (D=data)
       If M2$="A", expect one ASCII character; otherwise two hex digits
       Returns E=0 if it was entered properly, E<>0 otherwise  (E=error)

  9400 Enter a file name, return it in FL$                     (FL=file)
       Checks for proper file name syntax as characters are entered,
       aborts as soon as any error is seen.
       Returns E=0 if it was entered properly, E<>0 otherwise  (E=error)

  9500 Enter a single character, return it in T$
BUGS
yakowenk@cs.unc.edu, 21-Feb-98