aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-06-17 18:48:32 -0400
committerB. Watson <urchlay@slackware.uk>2024-06-17 18:48:32 -0400
commit51436978dd762b0f7ed9ccca60802665bcab3514 (patch)
treeae682448aa6c9ed9145a05205eca27c1aa3de49a
parent7e359d5a95b28e59d2a3e97bef12f028d2ab0ad0 (diff)
downloadbw-atari8-tools-51436978dd762b0f7ed9ccca60802665bcab3514.tar.gz
cxrefbas: update doc.
-rw-r--r--cxrefbas.146
-rw-r--r--cxrefbas.rst32
2 files changed, 74 insertions, 4 deletions
diff --git a/cxrefbas.1 b/cxrefbas.1
index 15dd6c1..6572532 100644
--- a/cxrefbas.1
+++ b/cxrefbas.1
@@ -37,8 +37,8 @@ cxrefbas [\fB\-v\fP] \fBinput\-file\fP
.sp
\fBcxrefbas\fP reads an Atari 8\-bit BASIC tokenized program. For each
line number in the program, it prints a list of lines that reference
-it. Each reference is followed by a letter that indicates the type
-of reference:
+it. Each line number reference is followed by a letter that indicates
+the type of reference:
.INDENT 0.0
.TP
.B \fBG\fP
@@ -82,6 +82,48 @@ Print version number and exit.
Verbose operation. When displaying a number in verbose mode, it will
be prefixed with \fI$\fP if it\(aqs in hex, or no prefix for decimal.
.UNINDENT
+.SH EXAMPLE
+.sp
+This program:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+10 GOSUB 100:GOSUB 200
+100 RESTORE 1000:IF A THEN 120
+110 GOTO 200
+120 ON B GOTO 300,310,320
+200 RETURN
+300 PRINT 1
+310 PRINT 2
+1000 DATA XYZ
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Produces this output:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+100: 10:S
+120: 100:I
+200: 10:S 110:G
+300: 120:O
+310: 120:O
+!320: 120:O
+1000: 100:R
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Note that line 320 doesn\(aqt exist in the program, so it\(aqs shown with
+\fI!\fP in the output. Line 120 has \fI100:I\fP; if the \fITHEN 120\fP were
+changed to \fITHEN GOTO 120\fP, line 120 would read \fI100:G\fP\&.
.SH EXIT STATUS
.sp
0 for success, 1 for failure.
diff --git a/cxrefbas.rst b/cxrefbas.rst
index 62346cd..50c4dbc 100644
--- a/cxrefbas.rst
+++ b/cxrefbas.rst
@@ -18,8 +18,8 @@ DESCRIPTION
**cxrefbas** reads an Atari 8-bit BASIC tokenized program. For each
line number in the program, it prints a list of lines that reference
-it. Each reference is followed by a letter that indicates the type
-of reference:
+it. Each line number reference is followed by a letter that indicates
+the type of reference:
**G**
*GOTO* (without *ON*) or *GO TO*.
@@ -63,6 +63,34 @@ General Options
Verbose operation. When displaying a number in verbose mode, it will
be prefixed with *$* if it's in hex, or no prefix for decimal.
+EXAMPLE
+=======
+
+This program::
+
+ 10 GOSUB 100:GOSUB 200
+ 100 RESTORE 1000:IF A THEN 120
+ 110 GOTO 200
+ 120 ON B GOTO 300,310,320
+ 200 RETURN
+ 300 PRINT 1
+ 310 PRINT 2
+ 1000 DATA XYZ
+
+Produces this output::
+
+ 100: 10:S
+ 120: 100:I
+ 200: 10:S 110:G
+ 300: 120:O
+ 310: 120:O
+ !320: 120:O
+ 1000: 100:R
+
+Note that line 320 doesn't exist in the program, so it's shown with
+*!* in the output. Line 120 has *100:I*; if the *THEN 120* were
+changed to *THEN GOTO 120*, line 120 would read *100:G*.
+
EXIT STATUS
===========