home *** CD-ROM | disk | FTP | other *** search
/ CBM Funet Archive / cbm-funet-archive-2003.iso / cbm / c128 / os / unix128v3 / unix311b.sfx / intro.2 < prev    next >
Encoding:
Text File  |  1990-02-12  |  19.5 KB  |  463 lines

  1.  
  2.  
  3. Unix 128 v3.10 Manual           15 January 1992                          Page 8
  4.  
  5.  
  6. 12.  Introduction to nroff.
  7.  
  8. nroff is a text formatting package that is "mostly" compatible with plain nroff
  9. and  troff  source  files  (no  macros are included with this release for table
  10. (tbl) or equation (eqn) processing).   nroff  is  not  a  "word  processor"  or
  11. "editor", but a pass-thru text formatter.  You must enter text on any editor or
  12. word processor (emacs is fine) and then type  % nroff -p file to print it or  %
  13. nroff  -v  file  to preview it. nroff provides the powerful features associated
  14. with many word processors.
  15.  
  16. 12.1  Command Line Options:
  17.  
  18. nroff may be invoked with several command-line options in the format:
  19.     % nroff (options) filename
  20. The options are:
  21.       -i  Interactive formatting setup first.
  22.       -v  Video preview only
  23.       -p  Print document
  24.       -S  Use my own symbol table instead of 'nroff.tbl.'  Example:  -Smytable
  25.  
  26. A command line might look like: % nroff -i -Smytable -p thisfile.
  27. The nroff command takes a single document filename,  which  must  be  specified
  28. last on the command line.
  29.  
  30. 12.2  Formatting Commands:
  31.  
  32. All formatting commands must begin with a period (.) that is at  the  far  left
  33. (first column) of the source document.   A complete list of formatting commands
  34. can be viewed by typing % more nroff.hlp from the shell, or from  within  emacs
  35. by typing ESC-X NROFF.
  36.  
  37.  
  38. 13.  Introduction to the as Assembler Development Package
  39.  
  40. as is the Unix 128 8510 assembler.  It takes a single  source  file,  processes
  41. the  Unix  128 extensions, writes an object file (*.o) that contains only valid
  42. 8510 assembler opcodes / operands, then converts the object  files  and  writes
  43. the C128 machine language file 'a.out.'
  44.  
  45. The first two bytes of 'a.out' contain the start address of the code (where  it
  46. is loaded) and the rest of the file contains the machine language code.
  47.  
  48. 13.1  Language Extensions:
  49.  
  50. The extensions to standard assembler are as follows:
  51. 1.  The first line of any assembler  source  code  must  be  the  word  'start'
  52. followed by either a decimal number or a '$' and a hexidecimal number.  This is
  53. the start address of the code which is  written  directly  to  'a.out.'   If  a
  54. 'start' line is not found, an error will be printed, and the compiler will halt
  55. and catch fire.
  56.  
  57. 2.  One or more lines may be given that begin with the  word  'include'  and  a
  58. source  filename that contains valid macro definitions (see 4).  The purpose of
  59. this statement is similar to the C #include <library.h>: to include  macros  of
  60. standard  code.   An include file, 'stdlib.i', is given with this package as an
  61. example.  Example:  include stdlib.i
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69. Unix 128 v3.10 Manual           15 January 1992                          Page 9
  70.  
  71.  
  72. 3.   A  data  section  may be given, so that you may label common constants.  A
  73. data section consists of the word 'data' on its own line, followed  by  one  or
  74. more data lines, and followed by the word 'endd' (end-data) on its own line.  A
  75. data line consists of a data label, the word 'equ', and a decimal  value  or  a
  76. hexidecimal value preceeded by a '$'
  77. Example:
  78.    data
  79.      zero equ $00
  80.      two equ 2
  81.    endd
  82. Wherever the names 'zero' or 'two' are encountered, they are replaced with  the
  83. appropriate data value.
  84.  
  85. 4.  Macros are units of code that are given a name.  They are defined once, and
  86. expanded  wherever the macro name is found.  A macro definition begins with the
  87. word 'macro', a single space, and the macro name.  One or more lines  of  valid
  88. 8510  source  code are given on separate lines, and the word 'endm' (end-macro)
  89. is given to conclude the macro definition.
  90. Example:
  91.    macro foo           (start a macro named foo)
  92.      lda #$00
  93.    endm                (end of this macro)
  94. Whenever the name 'foo' is encountered in the source code, it is replaced  with
  95. the  line  'lda #$00'.  Macros cannot be given parameters.  Standard macros are
  96. usually used for system calls such as setting fast mode or clearing the screen.
  97.  
  98. 5.  Comments can be given on separate lines  by  beginning  that  line  with  a
  99. semicolon (;).  Example:
  100.    ;This is a comment
  101.  
  102. 6.  Any line may be given a name by which it can be referred.  This removes the
  103. tedium  of keeping track of addresses for jumps and branches.  The name must be
  104. followed immediately by a colon (:).  Example:
  105.  line:  ldx #zero
  106.         sta $0400,x
  107.         jmp line
  108.  
  109. **WARNING**  Be very careful not to use valid operand names  for  line  labels,
  110. data labels or macro names.  The preparser will replace all occurences of label
  111. names with the appropriate data.  (For example, if you label a line with  jsr:,
  112. every  time  you used jsr in your program it will be replaced by the address of
  113. the line to which the line label refers!)
  114.  
  115. 13.2  Command Line Options:
  116.       as can be invoked with  several  different  options  from  the  Unix  128
  117. command line:
  118.    % as -h           :Prints a help screen.
  119.    % as -d beg end   :Disassembles memory from beg to end
  120.    % as -v beg end   :Views memory from beg to end
  121.    % as filename     :Parses 'filename' --> 'filename.o' --compiles--> 'a.out'
  122.  
  123. as accepts all valid 8510 opcodes, and the following reserved keywords:
  124.    start   macro   endm    data    endd    include equ
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133. Unix 128 v3.10 Manual           15 January 1992                         Page 10
  134.  
  135.  
  136. 13.3  General Notes:
  137. 1.  Use all lower case for keywords and op-codes, and use a single space
  138.        between op-codes and operands.  
  139. 2.  There is a limit of 1500 lines of source code (255 characters per line)
  140. 3.  There is a limit of 75 macros of 50 lines (255 char/line) each.
  141. 4.  There is a limit of 100 unique line labels.
  142. 5.  There is a limit of 100 data items in the data section.
  143.  
  144.  
  145. 14.  Programming in BASIC Under Unix 128.
  146.  
  147. It is quite feasible to write BASIC 7.0 code using emacs.  There are no special
  148. features  included  for  writing  BASIC code under emacs.  To convert an editor
  149. (SEQ) file to BASIC format,  simply  type  '%  basic'.   The  BASIC  conversion
  150. utility  will  load  the  requested  file  into  memory,  where you can run it.
  151. Remember to save the file after the conversion is complete (When the conversion
  152. completes,  either  a  syntax  error will occur or the disk drive will halt and
  153. you'll need to press RUN/STOP - RESTORE; either is normal  -  your  program  is
  154. safely in memory.)
  155.      To convert a BASIC program to SEQ format for emacs, load the file normally
  156. from BASIC then type:
  157.            OPEN 5,8,4,"0:seq-filename,s,w"
  158.            CMD5:LIST
  159.            PRINT#5
  160.            CLOSE 5
  161.  
  162.  
  163. 15.  Introduction to the emacs Text Editor.
  164.  
  165. Emacs is a powerful text editor for use under Unix 128.  It is not  a  document
  166. formatter  or  'word  processor'-  the most advanced text previewing feature is
  167. word-wrap.  Text should be  passed  to  nroff  for  formatting  (line  spacing,
  168. columns, justification etc.)
  169.  
  170. Emacs allows up to 700 lines of text (of 80 characters / line).  It  loads  and
  171. saves  SEQ  type  files  that  are  compatible with most other word processors.
  172. Emacs also features DiskEd, to enter CBM-DOS commands.  It has help screens for
  173. itself  as  well as a command reference for writing nroff source files.  It has
  174. multiple text editing features like setting and copying regions, 'killing'  and
  175. 'yanking' lines of text, commands to move to the start and end of lines, up and
  176. down by screens, and commands to move to the start and end of text.  Files  can
  177. be inserted into the text.  There is font support, and 2 partial fonts (one for
  178. special Polish characters and one for  the  Russian  (cyrillic)  alphabet)  are
  179. included.
  180.  
  181. 15.1  Regions:
  182.       A region is defined as all the text in between the 'mark' and the current
  183. cursor  position.   A mark is set by typing (Commodore) (SPACE).  Once a region
  184. is defined, you can:
  185.         CONTROL-c : copy region as kill.  This allows you to  copy  the  region
  186. into the kill buffer to be copied back into the text with CONTROL-y (yank).
  187.         Rot-13 region : Perform the rot-13 transformation on the region  (which
  188. maps each letter 13 positions away; a-->m, b-->n, m-->a etc)
  189.  
  190. 15.2  Expanded Command Reference:
  191. (C-key - Control+key    E-key - Hit ESC then key)
  192. C-a      Move the cursor to the beginning of the current line.
  193. C-b      Move the cursor back one character (same as 'cursor left')
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201. Unix 128 v3.10 Manual           15 January 1992                         Page 11
  202.  
  203.  
  204. C-c      Copy the currently marked region into memory, to be retrieved with
  205.          C-y (yank line)
  206. C-d      Enter DiskEd, which allows CBM DOS commands to be executed.
  207. C-e      Move the cursor to the end of the current line.
  208. C-f      Move the cursor forward one character (='cursor right')
  209. C-g      Quit prompt (general abort for commands)
  210. C-h      Get Help!!!
  211. C-k      Delete line from cursor to end of line, copying the line to memory.
  212. C-l      Redraw the screen.
  213. C-n      Move the cursor to the next line (='cursor down')
  214. C-p      Move the cursor to the previous line (='cursor up')
  215. C-r      Rot-13 a previously marked region
  216. C-v      Move down by a full screen
  217. C-w      Write this file as...
  218. C-y      Yank a line from memory to the current cursor position.
  219. C-x c    Clear text memory.
  220. C-x e    Copy the keyboard macro defined with C-( and C-)
  221. C-x f    Find phrase (maybe).
  222. C-x i    Insert a file at the current cursor position.
  223. C-x p    Print the contents of memory.
  224. C-x s    Save file with current filename.
  225. C-x v    View document with word-wrap.
  226. C-x C-c  Quit to Unix 128.
  227. C-x C-f  Load a file into memory, erasing current memory contents.
  228. C-x (    Write keyboard macro
  229. C-x )    End keyboard macro
  230. C-x =    Cursor information (what line, character etc)
  231. C-x +    Insert a line at the cursor.
  232. E-<      Move the cursor to the beginning of the file.
  233. E->      Move the cursor to the end of the file.
  234. E-v      Move up by 1 full screen.
  235. E-x ?    Show bound commands (nroff help, fonts etc.)
  236.  
  237. Of course, the abbreviated command reference may  be  viewed  at  any  time  by
  238. typing C-h, without disturbing your document.
  239.  
  240.  
  241. 16.  The tip Telecommunications Program.
  242.  
  243.      Tip is used to connect to mainframes or other Unix 128 systems  using  the
  244. telephone  lines.   It can use a wide variety of protocol and terminal settings
  245. and will be compatible with most systems.
  246.      All of the features of tip can be accessed  through  the  main  menu.   To
  247. bring  up  the  main menu, press the ALT key on the upper left of the keyboard.
  248. This brings up the following menu heirarchy (may not be in the same order):
  249.  
  250. 16.1  Protocol Menu:
  251.      -Baud Rate:    the speed of communication (300 and 1200 are most common)
  252.      -Data Bits:    7 or 8 data bits are supported
  253.      -Parity:       even, odd, space, mark or no parity are supported
  254.      -Stop Bits:    1 or 2 stop bits are allowed
  255.      -Duplex:       full(no local echo) or half(local echo) duplex
  256. 16.2  Terminal Type Menu:
  257.      -VT100:        use VT100 emulation.  For some reason, not all of the codes
  258.                      work all of the time.  Hope to have that fixed soon....
  259.      -VT52:         use VT52 emulation.
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267. Unix 128 v3.10 Manual           15 January 1992                         Page 12
  268.  
  269.  
  270.      -Commodore:    also called 'raw' mode, this doesn't interpret any of the
  271.                      control codes encountered.  This is useful when talking
  272.                      to other Commodore systems.
  273. 16.3  Dial:
  274.        Enter a phone number (no parentheses or hyphens, a comma (,) makes a 2
  275.        second pause) and tip will dial it and attempt to connect.  One of the
  276.        the following messages will be returned:
  277.          CONNECT       = connected at 300 baud
  278.          CONNECT 1200  = connected at 1200 baud
  279.          BUSY          = the host is busy
  280.          VOICE         = a human being answered the phone.
  281. 16.4  Hang Up Menu:
  282.          Hang Up: obviously, hang up the phone.
  283.          Don't Hang Up: obviously, don't hang up the phone.
  284. 16.5  Clear Display:
  285.          This just clears the screen.
  286. 16.6  Buffer Menu:
  287.          Capture On:   This will copy everything that comes across the screen
  288.                         (except menus etc.) to memory
  289.          Capture Off:  This turns off the copy-to-memory feature.
  290.          Clear Buffer: Erase all buffer memory.
  291.          Save Buffer:  Save the contents of the buffer in a disk file.
  292.          Print Buffer: Print the contents of the buffer on the printer.
  293.          View Buffer:  Type the contents of the buffer on the screen (use the
  294.                         NO SCROLL key to pause / resume.)
  295. 16.7  ASCII Upload:
  296.          Enter a filename and tip will just type the file to the modem.  To
  297.          receive a file, you must first type:
  298.            VAX / VMS:  $ create filename  (when upload is done, type CTRL-Z)
  299.            Unix:       % cat > filename   (when done, type CTRL-D)
  300. 16.8  Quit to Unix:
  301.          Returns to the Unix 128 shell prompt (%).  You can leave tip without
  302.          hanging up, do other work, and return to tip safely.  Remember to hang
  303.          up the phone when you're all done (note that shutting off the computer
  304.          will hang up the phone automatically)
  305. 16.9  (Terminal Mode):
  306.          Return to terminal mode without doing anything.
  307.  
  308.  
  309. 17.  dc:
  310.      dc is the  Unix  128  desktop  calculator.   It  can  be  used  for  doing
  311. arithmetic  calculations,  base conversions and trigonometry.  dc can be run in
  312. one of two modes: interactive and single expression.
  313.      If you type % dc at the shell prompt, dc will load and  place  you  in  an
  314. interactive environment.  Pressing '?' will list all of the features.
  315.      If you type % dc (expr) at the shell prompt (example:  % dc 3+2), dc  will
  316. be  loaded,  and  it  will evaluate the given expression, print the result, and
  317. return to the shell immediately.
  318.      The valid operations are:
  319.           Help:       ?
  320.           Arithmetic: + - * /  ( ) !
  321.           Functions:  (functions take a single argument)
  322.                       log sqr sqrt sin cos tan sec csc cot
  323.           Arguments:  can be:
  324.                       -numeric (example: 3+2)
  325.                       -e or pi (defined constants)
  326.                       -ans (ans is the previous answer variable)
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333. Unix 128 v3.10 Manual           15 January 1992                         Page 13
  334.  
  335.  
  336.  
  337.           Conversion: hd (hex arg)    hexadecimal to decimal
  338.                       hb (hex arg)    hexadecimal to binary
  339.                       dh (dec arg)decimal to hexadecimal
  340.                       db (dec arg)    decimal to binary
  341.                       bd (bin arg)    binary to decimal
  342.                       bh (bin arg)    binary to hexadecimal
  343.                 Example:  to convert $ff to decimal, type:  hd ff.
  344.  
  345. 18.  mail:
  346.  
  347. mail invokes the Unix 128 mail system.  This mailer was set up so that multiple
  348. users  of  Unix 128 on a single system could send mail between each other.  The
  349. operation of mail is almost exactly identical to Berkeley mail (/usr/ucb/mail).
  350.      
  351. The mailer uses 'mailboxes' named username.mbox; if one doesn't exist  for  you
  352. it  will  be created if needed.  If you have no mail, mail will probably return
  353. an error message like 'user.mbox doesn't exist.'.
  354.      
  355. mail contains all the standard Unix mailer commands: n (next message), s  (save
  356. message(s)), p (print message(s)), mail (mail to another user), and d (delete).
  357.  
  358.  
  359. 19.  spread:
  360.      spread is the Unix 128 spreadsheet program.  It is similar in function  to
  361. Lotus  1-2-3,  but  a  lot  smaller  and  skimpier.   spread provides a maximum
  362. spreadsheet size of 26 rows (A-Z) by 99 columns (1-99).  There  are  facilities
  363. for entering text strings, numbers, functions, and math expressions.  Functions
  364. and math expressions may apply to multiple cells ('ranges').
  365.      In most cases, ranges are entered in two ways:
  366.         -explicitly:  two opposite corners (usually top-left and  bottom-right)
  367. are  given,  separated by a hyphen (-).  The column letter must come before the
  368. row number.  Example: a1-b10
  369.         -by name:  commonly used ranges may be given a  name  (type  CTRL-n  to
  370. name  a  range.)   Once  a  range  is  named,  its name may be given instead of
  371. explicitly defining the range.
  372.      In some cases (such as when entering a range to print) you  can  also  use
  373. the  cursor  keys  to  scroll the top left cell address, press '.', and use the
  374. cursor keys to select a bottom right cell address.
  375.      Functions act on ranges.  Functions are preceded by the  '@'  sign.   Some
  376. available  functions  are  sum  (@sum),  average  (@avg), maximum value (@max),
  377. minimum value (@min), number of numeric items in a range  (@count),  log,  sin,
  378. cos,  tan,  and  sqrt  (square root).  Ranges are specified after the function:
  379. @sum a1-b9.
  380.      Spread can also calculate binary math expressions  (expressions  with  two
  381. numbers).   Math  expressions  are  preceded by a percent sign, contain a singe
  382. operator (+,-,* or /), and two arguments (arguments may be  either  numeric  or
  383. single cell names).  Examples:  %497-334  %a1-b1  %d49-10.
  384.      NOTE:   Functions  or  expressions  that  act  on  other  cells  are   not
  385. automatically changed to reflect changes in arguments; a screen redraw (CTRL-r)
  386. will make these changes.
  387.      Complete information on the current version  of  spread  is  available  by
  388. typing Control-h.
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399. Unix 128 v3.10 Manual           15 January 1992                         Page 14
  400.  
  401.  
  402. 20.  Other miscellaneous applications:
  403.  
  404. 20.1  Games:
  405.      Four 'games' have been included with Unix 128:  banner, maze, puzzle,  and
  406. wump (these are traditionally found in /usr/games on "real" unix systems.)
  407.      -Banner will print the given phrase  in  large  letters  on  the  standard
  408. output device.  Thus, % banner i love unix 128 {SHIFT-POUND} lpr   will print a big sign on
  409. your printer.
  410.      -Maze creates a random maze and prints it to the standard output.   Again,
  411. you'll probably want to pipe this command to the printer.
  412.      -Puzzle is a Unix 128 implementation of the sliding tile game whose object
  413. is to get the tiles in numerical order by sliding them around.
  414.      -Wump is an implementation of Hunt The Wumpus, a game by Gregory Yob  that
  415. has  been  on  Unix  systems since their inception.  The object is to shoot the
  416. Wumpus while avoiding hazards like pits and Superbats.
  417.  
  418. 20.2  Tar:
  419.      Tar is the tape archive program that exists to  take  multiple  files  and
  420. concatenate them into a single archive file (called a tarfile) for archiving or
  421. mailing.  The Unix 128 version seems to be compatible with Sun's  tar  and  DEC
  422. Ultrix tar.  Other mainframe Unix tarfiles have not been tested.
  423.      The command line to archive multiple files into a single tarfile is:
  424.          % tar -c [ tarfile ] [ filelist...]
  425. and the command to unarchive (eXtract) a tarfile is:
  426.          % tar -x [ tarfile ].
  427.      Tar is very slow in either archiving or de-archiving  files.   Also,  note
  428. that  mainframe-produced  tarfiles  will unarchive in ASCII format, not CBMSCII
  429. format, so that all the cases will be reversed (lIKE tHIS).
  430.  
  431. 20.3  uuencode/uudecode:
  432.      Also in the area of things that are binary compatible with Unix mainframes
  433. are  uuencode  and  uudecode.   Uuencode  (pronounced you-you-encode; short for
  434. unix-to-unix  encode)  takes  an  input  file  and  maps  all  the   bytes   to
  435. ASCII-printable  characters.   The  original purpose of this was to make binary
  436. files (programs) readable by the mail system for file transfers.
  437.      To encode a file, type %  uuencode  (-c)  inputfile  outputfile.   The  -c
  438. option will convert ASCII<>PETSCII as it encodes.  The inputfile is the file to
  439. be encoded, and the outputfile is the encoded file.
  440.      To decode a file, type % uudecode  (-c)  filename.   The  -c  option  will
  441. convert ASCII<>PETSCII as it decodes.
  442.  
  443. 20.4  style:
  444.      style will analyze the surface characteristics of the writing style  of  a
  445. document.   It  reports  on  readability,  sentence  length and structure, word
  446. length and usage.  The grade it gives is somewhere around 0-12, and the  higher
  447. the grade the better the document.
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.