From 36f2c887d3fba99e00eb81a17a9a04fb11710fb2 Mon Sep 17 00:00:00 2001 From: minjaesong Date: Thu, 24 Dec 2020 22:13:44 +0900 Subject: [PATCH] basicdoc: new Commands chapter --- assets/disk0/tbas/doc/commands.tex | 34 +++++++++++++++++++++++++++++ assets/disk0/tbas/doc/langguide.tex | 1 - assets/disk0/tbas/doc/tbasman.tex | 3 +++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 assets/disk0/tbas/doc/commands.tex diff --git a/assets/disk0/tbas/doc/commands.tex b/assets/disk0/tbas/doc/commands.tex new file mode 100644 index 0000000..c9e92af --- /dev/null +++ b/assets/disk0/tbas/doc/commands.tex @@ -0,0 +1,34 @@ +This chapter describes commands accepted by the \tbas\ editor. + +\section{The Editor} + +When you first launch the \tbas, all you can see is some generic welcome text and two letters: \code{Ok}. Sure, you can just start type away your programs and type \code{run} to execute them, there's more things you can do with. + +\subsection{LOAD} + \codeline{\textbf{LOAD} FILENAME}\par + Loads BASIC program by the file name. Default working directory for \tbas\ is \code{/home/basic}.\footnote{This is a directory within the emulated disk. On the host machine, this directory is typically \code{PWD/assets/diskN/home/basic}, where \code{PWD} is working directory for the \thismachine, \code{diskN} is a number of the disk.} + +\subsection{LIST} + \codeline{\textbf{LIST} [LINE\_NUMBER]} + \codeline{\textbf{LIST} [LINE\_FROM LINE\_TO]}\par + Displays BASIC program that currently has been typed. When no arguments were given, shows entire program; when single line number was given, displays that line; when range of line numbers were given, displays those lines. + +\subsection{NEW} + \codeline{\textbf{NEW}}\par + Immediately deletes the program that currently has been typed. + +\subsection{RENUM} + \codeline{\textbf{SAVE} FILENAME}\par + Re-numbers program line starting from 10 and incrementing by 10s. Jump targets will be re-numbered accordingly. Nonexisting jump targets will be replaced with \code{undefined}.\footnote{This behaviour is simply Javascript's null-value leaking into the BASIC. This is nonstandard behaviour and other \tbas\ implementations may act differently.} + +\subsection{RUN} + \codeline{\textbf{RUN}}\par + Executes BASIC program that currently has been typed. Execution can be arbitrarily terminated with Ctrl-C key combination (except in \code{INPUT} mode). + +\subsection{SAVE} + \codeline{\textbf{SAVE} FILENAME}\par + Saves BASIC program that currently has been typed. Existing files are overwritten \emph{silently}. + +\subsection{SYSTEM} + \codeline{\textbf{SYSTEM}}\par + Exits \tbas. diff --git a/assets/disk0/tbas/doc/langguide.tex b/assets/disk0/tbas/doc/langguide.tex index b86f4f8..c34461a 100644 --- a/assets/disk0/tbas/doc/langguide.tex +++ b/assets/disk0/tbas/doc/langguide.tex @@ -33,7 +33,6 @@ So you can make a loop using \code{GOTO}s here and there, but they \emph{totally What fun is the program if it won't talk with you? You can make that happen with \code{INPUT} statement. - \begin{lstlisting} 10 PRINT "WHAT IS YOUR NAME"; 20 INPUT NAME diff --git a/assets/disk0/tbas/doc/tbasman.tex b/assets/disk0/tbas/doc/tbasman.tex index 9641584..3df8e5b 100644 --- a/assets/disk0/tbas/doc/tbasman.tex +++ b/assets/disk0/tbas/doc/tbasman.tex @@ -183,6 +183,9 @@ \chapter{Language Reference} \input{langref} +\chapter{Commands} +\input{commands} + \chapter{Statements} \input{statements}