home *** CD-ROM | disk | FTP | other *** search
/ Más de 2,500 Juegos / CD1.iso / ZIPDAT / 0951 / 0951.ZIP / ATR2.DOC next >
Encoding:
Text File  |  1997-03-04  |  82.1 KB  |  1,852 lines

  1.  
  2.                         Advanced T-Robots (AT-Robots)
  3.                                  version  2
  4.                                    (ATR2)
  5.  
  6.                      Copyright (C) 1997, Ed T. Toton III
  7.                             All Rights Reserved.
  8.  
  9.  
  10. ----------------------------------------------------------------------------
  11. For current CONTACT INFORMATION see:   NBONES.DOC
  12. ----------------------------------------------------------------------------
  13. CONTENTS:
  14.  
  15.   Introduction
  16.   Things you should have
  17.   Running AT-Robots
  18.     - Settings
  19.     - During the Simulation
  20.   Locking Robots
  21.   Acronyms, Abbreviations, and Definitions
  22.   What's new to ATR2
  23.   Basics and General Info
  24.   Hexidecimal
  25.   Programming Robots
  26.     - Statements
  27.     - Compiler Directives
  28.     - Registers
  29.     - Instructions
  30.     - Ports
  31.     - Interrupt Calls
  32.     - Memory Map
  33.     - Constants
  34.     - Writing the code
  35.     - Errors
  36.     - Designing the perfect robot
  37.   The Physics of AT-Robots
  38.   Staging a Competition
  39.   Trouble-Shooting & Speed-Control
  40.   Legal Shtuffs
  41.     - Registration
  42.     - Vendors
  43.     - Disclaimer
  44.   Revision History
  45.   Final note
  46.  
  47. ----------------------------------------------------------------------------
  48. INTRODUCTION:
  49.  
  50.   Welcome to Advanced T-Robots, a game in which players write programs to
  51. control robots which will battle to the death in a simulated arena, using
  52. a programming language similar in design and concept to PC assembly language.
  53.  
  54.   This particular game is ATR2, or rather, the second AT-Robots.
  55. Unfortunately, though much remains the same, some fundamental changes made
  56. downward compatablility impossible. If you used AT-Robots 1.x, you will
  57. either need to make new robots from scratch or convert your old ones by hand.
  58. Further down, I will explain what has changed and what is the same.
  59.  
  60.    AT-Robots stands for "Advanced T-Robots". T-Robots was the predecessor 
  61. program to this. It was inspired by P-Robots (written by David Malmberg), 
  62. which was in turn inspired by C-robots (written by Tom Poindexter). T-Robots 
  63. and AT-Robots are designed with the idea of programming robots, without going 
  64. to the lengths of learning to program in high-level languages, but to still 
  65. allow fairly simple program design. In the case of AT-Robots, the language 
  66. has some similarities to assembly. Basically, T-Robots allowed you to use 
  67. T-Robot-Basic to program the robots, and now in AT-Robots you use T-Robot 
  68. assembly. Instead of having complex commands for complex tasks, you have
  69. simple commands to do simple tasks. You will have to design subroutines to
  70. access the specific devices/ports/memory areas of the robot specifically in
  71. your program. The language has a small amount of available commands, thus 
  72. making it easy to learn, while offering experienced programmers an interesting
  73. challenge. Though it is not a real programming language of sorts, it can
  74. still teach the basic concepts of programming and logical thinking.
  75.  
  76.    The system may still have bugs or discrepencies. Please contact me 
  77. if you spot one!! Also, please let me know if I have left anything out of 
  78. the documentation that you think I should include. And in addition to that,
  79. please inform me if you have any ideas of new commands to add to the 
  80. programming language.
  81.  
  82. ----------------------------------------------------------------------------
  83. THINGS YOU SHOULD HAVE:
  84.  
  85.   First of all, you need DOS 3.3 or higher (or Win95's DOS), some free
  86. hard drive space, a VGA or SVGA, and at least a 286 PC processor. That
  87. covers the hardware.
  88.  
  89.   You will also need a text editor. DOS (starting with 5.0) comes with
  90. a built-in text editor called EDIT. Whatever you use doesn't matter
  91. specifically, as long as you save your robot programs in "DOS Text" or
  92. "ASCII format" (must be the DOS standard of CR,LF ending each line).
  93.  
  94. Files:
  95.  
  96.   ATR2.EXE      - The main program.
  97.   ATR2.DOC      - This document.
  98.   NBONES.DOC    - Contact information.
  99.   READ.EXE      - A text viewer.
  100.   ATRLOCK.EXE   - Encrypts robots for distribution.
  101.   demo.bat      - Demo batch file
  102.   demo.ats      - Demo config file.
  103.   file_id.diz   - BBS auto-description file
  104.   ********.at2  - These are robot programs, all ending in .AT2
  105.  
  106. ----------------------------------------------------------------------------
  107. RUNNING AT-ROBOTS:
  108.  
  109.   Before we get into the language, let me first explain how to run the game.
  110. If you try running AT-Robots just by typing ATR2, this is what you will see:
  111.  
  112. Error #5: Robot names and settings must be specified.
  113.  
  114.   Well, here's how you do just that. ATR2 must be run using command-line
  115. parameters. Here's an example:
  116.  
  117. ATR2 /s #myconfig
  118.  
  119.   Any parameter that is preceded by a slash (/) or a dash (-) is a setting.
  120. Any parameter preceded by a pound sign (#) is a configuration file (in this
  121. case "MYCONFIG.ATS"). If no extension is specified in the filename, ".ATS"
  122. is asswumed.
  123.  
  124.  Parameters not starting with these characters are assumed to be robot
  125. filenames.
  126.  
  127. Example:   ATR2 /s /m2 myrobot yourobot
  128.  
  129.   In this case two settings are specified, and two robots are loaded,
  130. specifically "myrobot.at2" and "yourobot.at2" (if a filename extension
  131. is not specified, it is assumed to be ".AT2").
  132.  
  133.   If you want to load a locked robot, you can either specify the ".ATL"
  134. extension (i.e. "MYROBOT.ATL") or precede the namee with a question mark (?)
  135. (i.e. "?MYROBOT").
  136.  
  137. Settings:
  138.  /S  = Do not show source code during compile (must appear before robot names)
  139.  /D# = Specify game-delay (timing control), [default=30], example: /D20
  140.  /T# = Specify time-slice for robots [default=5] (cpu cycles per game cycle)
  141.  /L# = Specify battle time-limit in 1000's, 0 means no limit [default=0]
  142.  /Q  = Quiet Mode, no sound effects.
  143.  /M# = Specify number of matches to play. ex- /M10 is 10 matches.
  144.  /G  = No graphics, just generate a quick result.
  145.  /R  = Generate a report file after battle (for use with tournament program)
  146.  /C  = Compile only, do not run battle (for debugging and verifying)
  147.  /A  = Show scan arcs during battle
  148.  
  149. Creating a config file is very easy, simply use the same parameters that
  150. you would on the command line, except in the file they are placed one per
  151. line. For an example, see DEMO.ATS. In a config file, any blank lines or
  152. lins starting with a semi-colon (;) are ignored.
  153.  
  154.  
  155. DURING THE SIMULATION:
  156.  
  157.   While the simulation is running, there are several keyboard commands you
  158. can use:
  159.  
  160.   A = Turn on/off the displaying of scan arcs
  161.   S = Turn sound effects on/off
  162.   G = Turn graphics on/off
  163.   T = Turn timing on/off
  164.   + = increase timing delay (game runs slower)
  165.   - = decrease timing delay (game runs faster)
  166.   C = recalibrate timing (timer might have mis-calibrated if
  167.       a cache program such as smartdrive was still writing data).
  168.   ESC or Q = Quit.
  169.  
  170.   If the game is running without graphics, timing and sound will also be off
  171. since they only make sense when you're watching the action. You can use these
  172. keyboard commands whether the game started in graphics mode or not.
  173.  
  174.  
  175. ----------------------------------------------------------------------------
  176. LOCKING ROBOTS:
  177.  
  178.   When it comes time for you to use your robot in a competition, you may
  179. want to allow others access to your robot but without making it easy for
  180. them to discover its secrets. For this reason, there is a program included
  181. with AT-Robots called ATRLOCK. It removes all remarks from the robot and
  182. then encrypts it. It's not a particularly complex encryption scheme, just
  183. enough to make it unreadable.
  184.  
  185.   For all you hackers out there who are thinking of cracking it or making
  186. an un-lock program, I ask you nicely to please not do so.
  187.  
  188.   To use ATRLOCK, simply specify the robot to be locked:
  189.  
  190. example:
  191.   ATRLOCK sniper
  192.  
  193.   This will encrypt "SNIPER.AT2" into "SNIPER.ATL". To use the LOCKed
  194. SNIPER in a game, you could simply load it as "?SNIPER".
  195.  
  196.  
  197. ----------------------------------------------------------------------------
  198. ACRONYMS & ABREVIATIONS & DEFINITIONS:
  199.  
  200.   Here in ATR (see, there's one already) we use several acronyms that you
  201. may or may not already be familiar with. At anyrate, here they are (but
  202. don't worry about memorizing them):
  203.  
  204.   Acronym:          Meaning:
  205.     ATR                 AT-Robots, or a robot for AT-Robots.
  206.     ATR1                AT-Robots, versions 1.0 and 1.1
  207.     ATR2                AT-Robots, versions 2.0+
  208.     ATRA                Advanced T-Robots Assembly.
  209.     BIOS                Basic Input/Output System
  210.     ERR                 Error
  211.     GSB                 Gosub (a call to a subroutine)
  212.     I/O or IO           Input/Output
  213.     INT                 Interrupt
  214.     JMP                 Jump  (like a GOTO in basic)
  215.     OP                  Op-Code (numeric codes that represent instructions)
  216.     RAM                 Random-Access Memory.
  217.     REG                 Register
  218.     ROM                 Read-Only Memory.
  219.     ROS                 Robot Operating System.
  220.     SPD                 Speed
  221.     VAR                 Variable
  222.     LOCK                Encryption for robot distribution
  223.  
  224. ----------------------------------------------------------------------------
  225. WHAT'S NEW TO ATR2:
  226.  
  227.   If you've never used AT-Robots 1.x, skip this section.
  228.  
  229.   One of the most important changes is the memory addressing system, and
  230. how operands are stored and decoded internally. In ATR1, what an operand
  231. did was completely defined by its value. Anything over 10000 was a memory
  232. address. Now you have the full range of integer values to use as numbers,
  233. or as values in variables, since there is now seperate microcode stored
  234. to define the function of an operand.
  235.  
  236.   A few of the I/O ports have changed, but most are the same. All of the
  237. Interrupts have been redefined. Most of the instructions in the language
  238. are the same, except conditional jumps can not be used as conditional
  239. gosubs, and basic math functions use only 2 operands instead of 3.
  240.  
  241.   The list of registers has also changed. However, if you were simply using
  242. some of the old ones as generic variables, why not create them as variables
  243. if you convert your robots over? The variables that are used for passing
  244. values back and forth to interrupts have changed of course.
  245.  
  246.   The accuracy setting parameter that you send to the weapon port is
  247. no longer translated into degrees automatically. You must do this yourself
  248. before passing the parameter.
  249.  
  250.   One more MAJOR change is that the game uses a 256 degree circle instead
  251. of 360.
  252.  
  253.   Why so many changes? Especially that circle thing? Here's why- I designed
  254. the original AT-Robots before my programming expertise really allowed me to
  255. do as good of a job as this project deserved. I was only starting to learn
  256. assembly at the time, and here I was making my own version! I was not yet
  257. used to dealing with powers of two, individual bits, bit-manipulation
  258. instructions, and hexidecimal. I ended up making the language in such a way
  259. as to steer you away from these valuable programming techniques, and was
  260. therefore teaching the wrong lessons! Now I'm going to beat hexidecimal and
  261. powers of two into everyone's skulls...  :-)
  262.  
  263. 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048,
  264. 4096, 8192, 16384, 32768, 65536, to name a few...   :-)
  265.  
  266. ----------------------------------------------------------------------------
  267. BASICS & GENERAL INFO:
  268.  
  269.   The arena is 1 kilometer wide and 1 kilometer long. The coordinate system is 
  270. set up such that (0,0) is at the upper-left corner and (1000,1000) is at the 
  271. lower-right.
  272.  
  273.   The screen is set up as follows:
  274.  
  275.    0,0  ________________________________________  1000,0  
  276.        |                                        |          |
  277.        |                                        |          |
  278.        |                                        |----------|
  279.        |                                        | status   |
  280.        |                                        |   areas  |
  281.        |                                        |----------| (side of
  282.        |               Arena                    |          |  screen)
  283.        |                                        |          |
  284.        |                                        |----------|
  285.        |                                        |          |
  286.        |                                        |          |
  287.        |                                        |----------|
  288.        |                                        |          |
  289.        |                                        |          |
  290.        |                                        |          |
  291. 0,1000 |________________________________________| 1000,1000|
  292.  
  293.  
  294.  
  295.  
  296.    Navigation is done in a 256 degree circle, with 0 being north. Here are
  297. the directions for each course:
  298.  
  299.                      0 (256)                            000h (100h)
  300.     Decimal:         |               Hexidecimal:        |
  301.                 224  |  32                         0E0h  |   020h
  302.                    \ | /                               \ | /
  303.            192 ----- + ----- 64               0C0h ----- + ----- 040h
  304.                    / | \                               / | \
  305.                 160  |   96                        0A0h  |   060h
  306.                      |                                   |
  307.                     128                                 080h
  308.  
  309.                                (hexidecimal will be briefly explained later)
  310.  
  311.  
  312.    The Robots are all equipped with a scanner, armor, and a weapon.
  313.  
  314.    Firing the weapon generates heat, which can impair the robots performance.
  315. When the projectile hits an enemy robot, the amount of damage that the
  316. target takes will depend entirely on how accurate the shot was. When a robot
  317. is destroyed, it explodes, possibly causing damage to nearby robots.
  318.  
  319.    Firing the weapon at point-blank can be dangerous, since the weapon blast
  320. can hit everything within a given range. How much damage the weapon does
  321. depends on how "on-target" the shot was.
  322.  
  323.    Each robot is also equipped with a feature called "overburn" which allows
  324. the robot to increase its performance by crancking more energy out of its
  325. power-supply (by disengaging certain safety measures), but at the cost of
  326. easily over-heating. When on overburn, missiles will work more effectively, 
  327. and the robot will drive faster. 100% throttle is still maximum speed,
  328. as the speed of the robot is automatically scaled based upon it's current
  329. performance.
  330.  
  331.    Robots don't stop, start, or turn on a dime. When you tell the robot to 
  332. move at a certain speed, it will accelerate until it reaches that speed or
  333. it collides with something. Once it has reached that speed it will remain 
  334. there until you change it or it collides with something. When the robot
  335. does in fact collide with something, it's speed and throttle are reduced
  336. to zero. If the velocity was greater than half of it's maximum non-overburn
  337. and non-overheated velocity, it takes a point of damage.
  338.  
  339.    When you instruct the robot to turn, it will rotate until it faces the
  340. new direction, or you tell it to do otherwise. The robot will always rotate
  341. in the direction that is shortest to face the target heading. if you tell
  342. it to turn 270 degrees to the right, it will turn 90 to the left (it's 
  343. shorter, and is still the same heading). Also note that since it takes time
  344. to start/stop/turn, that the program may have executed many commands before
  345. the machine actually gets to it's new speed or heading.
  346.  
  347.    Each robot has two status bars on the right-hand side of the screen.
  348. The upper one (marked with an "A"), is the robot's armor. The one below
  349. it (marked with an "H") is the robot's heat scale. Also in the robot's
  350. status area is a space dedicated to displaying error codes. These codes
  351. will be displayed in both decimal and hexidecimal format. They can be
  352. extremely useful as a means of output to see what's going on "in your
  353. robot's head".
  354.  
  355.   Damage:
  356.   ~~~~~~~
  357.    Collision at high speed:          1
  358.    Heat is 300 - 349:                1 every 64 game cycles
  359.    Heat is 350 - 399:                1 every 32 game cycles
  360.    Heat is 400 - 449:                1 every 16 game cycles
  361.    Heat is 450 - 474:                1 every  8 game cycles
  362.    Heat is 475 - 499:                1 every  4 game cycles
  363.    Heat is 500 or higher:            Robot explodes.
  364.    Missile blast:                    14-range (i.e. 14 for dead center,
  365.                                                  and 1 at 13 meters)
  366.    Robot detonation:                 25-range (i.e. 25 for dead center,
  367.                                                  and 1 at 24 meters)
  368.    Overburn Missile blast:           (14-range)*1.25
  369.    Overburn Robot detonation:        (25-range)*1.30
  370.  
  371.  
  372.    It is assumed that the robot bodies have a radius of 4 meters, and
  373. thus the closest you can get to an enemy is 8 meters. Therefore the most
  374. damage you will actually take from another robot exploding is 17, assuming
  375. that it is not on overburn. The missiles however can go off at 0 meters
  376. from the robot if it is targetted precisely. Robot detonations cause the
  377. same amount of damage whether the robot was killed with a missile or it
  378. used a destruct command.
  379.  
  380.  
  381.    Robot performance:              per game cycle:
  382.    ~~~~~~~~~~~~~~~~~~              ~~~~~~~~~~~~~~~
  383.    Normal missile velocity:         32 meters
  384.    Maximum non-overburn speed:       4 meters
  385.    Turn rate:                        8 degrees
  386.    Acceleration                      4% of max forward speed
  387.    Turret rotation                  Instantaneous
  388.  
  389.  
  390.  
  391. WATCH YOUR HEAT!!  Over-heated robots can easily become DEAD robots!
  392.  
  393.   Here is the heat scale:
  394.  
  395.      80+   Max speed reduced to 98%
  396.     100+   Max speed reduced to 95%.
  397.     150+   Max speed reduced to 85%.
  398.     200+   Max speed reduced to 70%.
  399.     250+   Max speed reduced to 50%.
  400.     300+   Heat starts burning armor off (the hotter, the faster)
  401.     400+   Robot stops executing commands until cools below 350 (shutdown).
  402.     500+   Robot explodes.
  403.  
  404.     Also note that during shutdown, the robot's speed is reduced to 0,
  405.     making it a sitting duck.
  406.  
  407.     The shutdown temperature can be altered by accessing port 20.
  408.  
  409.   Normal heat exchanges:
  410.  
  411.     Firing weapon:                 20
  412.     Dissipation per game cycle:     1   ( +1/8 if throttle is -25% to 25% )
  413.  
  414.  
  415. OVER-BURN SHOULD BE USED WITH CAUTION!!!
  416.  
  417.   Overburn effects the following:
  418.              1) faster driving speed                          (130%)
  419.              2) weapon does more damage                       (125%)
  420.              3) weapon projectiles move faster                (125%)
  421.              4) weapon generates more heat                    (150%)
  422.              5) nastier explosion from death or self-destruct (130%)
  423.              6) worse heat dissipation                        ( 66%)
  424.  
  425.    (all percentages are of original total- i.e. 130% means 30% increase).
  426.  
  427.    Firing your weapon generates 20 points of heat normally, and normally
  428. you dissipate 1 point for each game cycle.
  429.  
  430.  
  431. ----------------------------------------------------------------------------
  432. HEXIDECIMAL:
  433.  
  434.   This section is intended just as a refresher, not as a lesson in
  435. hexidecimal.
  436.  
  437.   Hexidecimal is very useful to programmers since each digit perfectly
  438. represents 4 bits (a nybble, which is half of a byte). 4 bits can store
  439. a number from 0 to (2^4)-1, or 0 - 15. Since there are no single-digit
  440. symbols for 10 to 15, we use A to F:
  441.  
  442.   0 =  0
  443.   1 =  1
  444.   2 =  2
  445.   3 =  3
  446.   4 =  4
  447.   5 =  5
  448.   6 =  6
  449.   7 =  7
  450.   8 =  8
  451.   9 =  9
  452.   A = 10
  453.   B = 11
  454.   C = 12
  455.   D = 13
  456.   E = 14
  457.   F = 15
  458.  10 = 16
  459.  
  460.   The right-most digit in a hexidecimal number is still the one's column,
  461. but instead of 10's, 100's and 1000's we have 16's, 256's, and 4096's.
  462. To convert a hexidecimal number to decimal, simply take the digit from each
  463. column and multiply by the columns value:
  464.  
  465.   A148 =    A * 4096     =   40960
  466.          +  1 *  256     =  +  256
  467.          +  4 *   16     =  +   64
  468.          +  8 *    1     =  +    8
  469.                            ~~~~~~~~~
  470.                             = 41288
  471.  
  472.  
  473.  Like I said, just a refresher.
  474.  
  475.  
  476. ----------------------------------------------------------------------------
  477. PROGRAMMING ROBOTS:
  478.  
  479.   When a program is loaded into AT-Robots, it undergoes a process called
  480. "compiling" where each number, word, and instruction is converted into a
  481. number. These numbers are called OP-CODES, or OPs for short. As you will
  482. see below, the compiler is extremely flexible, and you can get away with
  483. all sorts of bizarre combinations and still get a not only a clean compile,
  484. but also a functional robot program.
  485.  
  486. The programming language consists of several basic types of statements.
  487.  
  488. 1) Remarks.   - These are not compiled into your program, they are simply
  489.                 notes that you can read when viewing programs. Use these
  490.                 to put comments in about what the program is doing, to make
  491.                 it more understanable when looking through it.
  492. 2) Directives - These are used exclusively by the compiler, and are not
  493.                 executed at run-time. The best examples are Var Defs (#def)
  494. 3) Labels.    - These are the target locations for JUMP/GOTO and GOSUB/CALL
  495.                 commands. They are not executed and do not use your robots
  496.                 processor time.
  497. 4) Commands.  - These are the functions of your robot. They command the robot
  498.                 to perform specified activities.
  499. 5) Variables  - You can have up to 256 variables. They are 16 bits (holding
  500.                 a value from -32768 to 32767). Their names must contain only
  501.                 letters, numbers, and underscores, and must begin with a
  502.                 letter. NO symbol-characters! A variable name can be up to
  503.                 16 characters long.
  504.  
  505.  
  506.   The word "Instruction" will often be using in place of "Command". Also note
  507. that "registers" are simply special cases of variables.
  508.  
  509. Now for more detail on these types of statements...
  510.  
  511. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  512. STATEMENTS:
  513.  
  514.  
  515. Remarks: 
  516.  
  517.   Syntax:
  518.           ;      <statement>
  519.      The semi-colon MUST come before the comments/remarks on a line, and
  520.    whatever you put on the line after it will be ignored by the
  521.    compiler.
  522.    OP-CODE: none, ignored
  523.  
  524.  
  525. Indirect (colon) Labels:
  526.  
  527.   Syntax: 
  528.           :####
  529.      The colon MUST be the FIRST character on the line (except for spaces).
  530.    RIGHT after it, without any spaces in-between, you put a number anywhere
  531.    from 0 to 32767. That number is the label. Do not use the same number
  532.    twice within the same program. You can not use a hexidecimal number in
  533.    a label.
  534.    OP-CODE: <label number>
  535.  
  536.  
  537. Direct (exclamation) Labels:
  538.  
  539.   Syntax:
  540.           !####
  541.      The exclamation mark  MUST be the FIRST character on the line (except
  542.    for spaces).  RIGHT after it, without any spaces in-between, you put an
  543.    identifier, be it a word or a number. Unlike the colon labels, these
  544.    are not compiled into the program, but rather a note is made of the
  545.    position within the program to use as a destination for jumps, etc.
  546.    OP-CODE: <none>
  547.  
  548.  
  549.  
  550. Commands/Instructions:
  551.  
  552.   Syntax: 
  553.           Command [parameters]
  554.      The command may or may not have parameters, but if there are, you 
  555.    seperate them from the command with spaces, tabs, or commas. Only one
  556.    instruction may be put on each line. 
  557.    OP-CODE: defined on chart below.
  558.  
  559.  
  560. Variable Definitions:
  561.  
  562.   Syntax:
  563.         #def <variable name>
  564.      The definition MUST come BEFORE the first time the variable is used
  565.    in the program. Don't worry about putting the definitions inside loops,
  566.    or after the program starts, these can be put just about anywhere, and 
  567.    are not compiled into the program. They are used to figure out how to 
  568.    compile the program, but do not get turned into executable code.
  569.    OP-CODE: none, used by compiler only to assign memory addresses.
  570.  
  571.  
  572. Variables:
  573.  
  574.      Once a variable has been declared, it can be used anywhere in the 
  575.    program any way you like. The compiler is VERY flexible. All the things 
  576.    you can get away with are described later, but remember, you can do just 
  577.    about anything with these suckers..
  578.    OP-CODE: <mem address>
  579.  
  580. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  581. COMPILER DIRECTIVES:
  582.  
  583.   The most important compiler directives are variable definitions, which
  584. are shown above. Here are the others currently implemented:
  585.  
  586.   #TIME <number>     - Specifies the maximum timeslice for the robot.
  587.                        If higher than the current robot timeslice that
  588.                        the game is using, it will not speed up your robot
  589.                        to give it an unfair advantage. This simply sets
  590.                        a limit, so that your robot will not execute its
  591.                        program any faster than this. i.e. TIME 5 means that
  592.                        the robot will never execute more than 5 CPU cycles
  593.                        per game cycle, no matter how high the timeslice
  594.                        setting is.
  595.  
  596.   #MSG <message>     - This displays a message in the robot's display area.
  597.                        Currently, the message may be 31 characters long,
  598.                        but only 19 will be shown in the display area. Since
  599.                        this is a compiler directive and not a run-time
  600.                        instruction, your robot may only have one overall
  601.                        message.
  602.  
  603.  
  604.   Remember that these are COMPILER instructions. They are executed at
  605. compile-time and not at run-time. Therefore the LAST one of each
  606. specified in the robot is the one that will be used throughout the
  607. simulation. You ca not have multiple #MSG's that let you know what
  608. the robot is doing at different points in the program (text strings
  609. can not be stored in compiled robot programs).
  610.  
  611.   Future enhancements to the game that may require the use of compiler
  612. directives might be options that allow you to choose some of the physical
  613. characteristics of your robot, such as engine type, armor class, weapon
  614. type, etc. All versions of AT-Robots-2 simply ignore (without an error)
  615. any unknown directives, so using them will not make your robot useless
  616. on earlier versions of ATR2.
  617.  
  618.  
  619. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  620. REGISTERS:
  621.  
  622.   The ROS (Robot Operating System) has a series of several memory locations
  623. that are set aside for certain functions. They are called registers. They
  624. are used for various things, including interrupt parameters, loop control,
  625. and comparisons. The following are their most common uses and their memory
  626. locations and op-codes.
  627.  
  628.   Register:   Mem/Op:    Function:                            Name:
  629.   ~~~~~~~~~   ~~~~~~~    ~~~~~~~~~                            ~~~~~
  630.      Flags      64       Comparisons, conditional jumps.      Flags
  631.      AX         65       Interrupt instruction, general use   Accumulator
  632.      BX         66       General use                          Base Reg.
  633.      CX         67       Loop control                         Counter Reg.
  634.      DX         68       General use                          Data Register
  635.      EX         69       Returns from interrupt calls         Extended Reg.
  636.      FX         70       Returns from interrupt calls         Function Reg.
  637.      SP         71       Controls the stack.                  Stack Pointer
  638.  
  639.  
  640. FLAGS:
  641.  
  642.   Individual bits in the flags register have specific meanings:
  643.   R = Reserved, O = Open for you use
  644.  
  645.   Note that the lower nybble of the upper byte is available for your uses.
  646.  
  647.  15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00  Name:                Mask:
  648.   R  R  R  R  O  O  O  O  R  R  R  R  |  |  |  +- Equal flag     (eq)  0001h
  649.                                       |  |  +---- Less-than flag (lf)  0002h
  650.                                       |  +------- Grtr-than flag (gf)  0004h
  651.                                       +---------- Zero flag      (zf)  0008h
  652.  
  653.   Executing a CMP or a TEST changes the entire low nybble.
  654.  
  655.   CMP results:
  656.   ~~~~~~~~~~~~
  657.   Equal flag:    Set when operands are equal.
  658.   Greater flag:  Set when operand#1 > operand#2
  659.   Less flag:     Set when operand#1 < operand#2
  660.   Zero flag:     Set when operands are equal AND are 0.
  661.  
  662.   All comparisons are done as SIGNED values. That means 0xF000 < 0.
  663.  
  664.   Examples: (results show flags value in binary)
  665.  
  666.   CMP 1, 1   ; 0001
  667.   CMP 0, 1   ; 0010
  668.   CMP 1, 0   ; 0100
  669.   CMP 0, 0   ; 1001
  670.  
  671.   TEST results:
  672.   ~~~~~~~~~~~~~
  673.   Equal flag:    Set when operands are equal.
  674.   Zero flag:     Set when the binary "AND" of operands #1 & #2 = 0.
  675.  
  676.   After a TEST, the Greater flag and the Less flag are always 0.
  677.  
  678.   Examples: (results show flags value in binary)
  679.  
  680.   TEST 1, 1  ; 0001
  681.   TEST 0, 1  ; 1000
  682.   TEST 1, 0  ; 1000
  683.   TEST 0, 0  ; 1001
  684.  
  685.   Because the zero-flag is dependant on the "AND" result of the two operands,
  686. it is a good way to see if a bit is turned on. Let's say you want to look
  687. at the lowest USER bit in flags, the following code will TEST this bit.
  688.  
  689.    mov   ax, flags   ; make a copy of "flags", just to be safe
  690.                      ; since TEST will change "flags".
  691.    test  ax, 0100h   ; Test bit 8 (mask of 256 or 0100h)
  692.    jz    100         ; If bit is off, goto :100
  693.    jnz   200         ; If bit is on,  goto :200
  694.  
  695.  
  696. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  697. INSTRUCTIONS/COMMANDS:
  698.  
  699.   The instructions in a robot program tell the robot what to do. The
  700. following list shows their names, syntax, and how many CPU clock-ticks
  701. they require (some take longer than others to execute). The chart below
  702. is for your reference. To read a discussion about how to use them skip
  703. along.
  704.  
  705.   The parameters that come after an instruction are called operands, and
  706. sometimes they must be of specific types. The types are as follows:
  707.  
  708.  N = number, of any type. Could be a number or value from a variable.
  709.  V = variable, meaning it must be a variable, register, or memory access.
  710.  
  711.  In the chart header below, T refers to the time it takes to execute
  712. an instruction
  713.  
  714. Op: T: Name: Alt:    Syntax/Description:
  715. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  716.  0  1  NOP           NOP        Simply wastes a clock-cycle.
  717.  1  1  ADD           ADD V N    Adds      V+N, result stored in V
  718.  2  1  SUB           SUB V N    Subtracts V-N, result stored in V
  719. 33  1  INC           INC V      Increments V, (v=v+1)
  720. 34  1  DEC           DEC V      Decrements V, (v=v-1)
  721. 35  1  SHL           SHL V N    Bit-shifts  V left  N bit positions
  722. 36  1  SHR           SHR V N    Bit-shifts  V right N bit positions
  723. 37  1  ROL           ROL V N    Bit-rotates V left  N bit positions
  724. 38  1  ROR           ROR V N    Bit-rotates V right N bit positions
  725. 43  1  SAL           SAL V N    Bit-Shifts, same as SHL
  726. 44  1  SAR           SAR V N    Same as SHR, except preserves bit 15.
  727. 45  1  NEG           NEG V      Negates V:   V = 0-V  (aka "two's compliment")
  728.  3  1  OR            OR  V N    Bitwise OR,  V or  N, result stored in V
  729.  4  1  AND           AND V N    Bitwise AND, V and N, result stored in V
  730.  5  1  XOR           XOR V N    Bitwise XOR, V xor N, result stored in V
  731.  6  1  NOT           NOT V      Bitwise NOT, not(V),  result stored in V
  732.  7 10  MPY           MPY V N    Mulitplies V*N, result stored in V
  733.  8 10  DIV           DIV V N    Divides    V/N, result stored in V (integer)
  734.  9 10  MOD           MOD V N    MOD's    V & N, result stored in V (modulus)
  735. 10  1  RET  RETURN   RET        Returns from a subroutine (pops the ip)
  736. 11  1  CALL GSB      CALL N     Calls subroutine at label #N (pushes ip)
  737. 12  1  JMP  GOTO     JMP N      Jumps program (ip) to label #N
  738. 20  1  CMP           CMP N N    Compares two numbers, results in flags reg.
  739. 13  0  JLS  JB       JLS N      Jumps to label N if last compare was <
  740. 14  0  JGR  JA       JGR N      Jumps to label N if last compare was >
  741. 15  0  JNE           JNE N      Jumps to label N if last compare was <>
  742. 16  0  JEQ  JE       JEQ N      Jumps to label N if last compare was =
  743. 41  0  JAE  JGE      JAE N      Jumps to label N if last compare was >=
  744. 42  0  JBE  JLE      JBE N      Jumps to label N if last compare was <=
  745. 39  0  JZ            JZ  N      Jumps to label N if last compare was 0
  746. 40  0  JNZ           JNZ N      Jumps to label N if last compare was not 0
  747. 46  1  JTL           JTL N      Jumps to line N of compiled program.
  748. 17  3  XCHG SWAP     XCHG V V   Exchanges the values of two variables
  749. 18  1  DO            DO N       Sets CX = N
  750. 19  1  LOOP          LOOP N     Decrements CX, If CX>0 then Jumps to label N
  751. 21  2  TEST          TEST N N   Ands two numbers, result not stored, flags set
  752. 22  1  MOV  SET      MOV V N    Sets V = N
  753. 23  2  LOC  ADDR     LOC V V    Sets first V = memory address of second V
  754. 24  2  GET           GET V N    Sets V = number from memory location N
  755. 25  2  PUT           PUT N1 N2  Sets memory location N2 = N1
  756. 26  ?  INT           INT N      Executes interrupt number N
  757. 27  4+ IPO  IN       IPO N V    Inputs number from port N, result into V
  758. 28  4+ OPO  OUT      OPO N1 N2  Outputs N2 to port N1
  759. 29  ?  DEL  DELAY    DEL N      Equivelant to N NOPS.
  760. 30  1  PUSH          PUSH N     Puts N onto the stack (sp incremented)
  761. 31  1  POP           POP  V     Removes a number from the stack, into V
  762. 32  0  ERR  ERROR    ERR N      Generate an error code, useful for debugging
  763.  
  764.   Note that some instructions take 0 time to execute. This was done so as
  765. to not discourage making complex jump-lists. Not however that 0-time
  766. instructions made it theoretically possible to send the SIMULATOR into
  767. and endless loop if you specifically designed robots to do so. Therefore,
  768. if 20 0-time instructions are executed within a single game-cycle, they
  769. count as using 1 robot cpu cycle. There is also an implied NOP at the end
  770. of each program (so that 0-length programs are impossible).
  771.  
  772.   All comparisons, conditional jumps, and math function are based on
  773. SIGNED 16-bit operations.
  774.  
  775.   JTL is the only jump instruction that does not assume the older, indirect,
  776. colon-prefix labels. You can use the newer, direct labels (exclamation-prefix)
  777. with ALL jump, but if you wish to specify a program location by number,
  778. for which there is no label, you must use JTL.
  779.  
  780.   JTL jumps to the program line number specified as an operand. Remember
  781. that this uses COMPILED lines, with the counting 0-based (i.e. first
  782. program instruction is line 0). Indirect labels (:labels) also count
  783. as compiled lines.
  784.  
  785.   Just remember that you can only have 256 !labels.
  786.  
  787.   example:
  788.  
  789.         xor ax, ax    ; ax = 0,   this is position 0.
  790. !begin                ; label is at position 1, right after position 0.
  791.  
  792.         ;...   30 instructions and :labels have passed
  793.  
  794. !start                ; Let's assume this represents compiled line 30
  795.         XOR ax, ax    ; this is the actual line 30...  ax = 0
  796.  
  797.         JTL !start    ; Jump to !start
  798.         JMP !start    ; Also Jump to !start
  799.                       ;   (both cases are endless loops of ax=0)
  800.  
  801.                       ; Assuming we get past them magically...
  802.         mov ax, 1     ; ax = 1
  803.  
  804. :1                    ; Now we get to see the difference:
  805.         JTL ax        ; Jumps to position 1, which is at !begin
  806.         JMP ax        ; Jumps to :1, because all jumps other than JTL
  807.                       ;   assume the old :label system instead of the
  808.                       ;   newer !label system.
  809.  
  810.  
  811.   All of the conditional jumps work the same way as JMP above.
  812.  
  813.  
  814. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  815. PORTS:
  816.  
  817.   I/O ports are how your robot program accesses the various devices that
  818. the robot is equipped with. Each device is assigned a port number. It might
  819. be handy to have a print-out of this chart at the very least.
  820.  
  821.   If you have used ATR1, take notice that ports 1 through 17 remain the same.
  822.  
  823.   In the chart header below, once again T represents the time it takes to
  824. access the port in addition to the execution time for the port access
  825. instruction.
  826.  
  827. Num:  T:  I/O Name:             Function:
  828. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  829.   1   0    I  Spedometer        Returns current throttle setting[-75- 100]
  830.   2   0    I  Heat Sensor       Returns current heat-level       [0 - 500]
  831.   3   0    I  Compass           Returns current heading          [0 - 255]
  832.   4   0    I  Turret Sensor     Returns current turret offset    [0 - 255]
  833.   5   0    I  Turret Sensor     Returns absolute turret heading  [0 - 255]
  834.   6   0    I  Damage Sensor     Returns current armor level      [0 - 100]
  835.   7   1    I  Scanner           Returns range to nearest target in scan arc
  836.   8   1    I  Accuracy          Returns accuracy of last scan     [-2 - 2]
  837.   9   3    I  Radar             Returns range to nearest target
  838.  10   0    I  Random Generator  Returns random number     [-32768 - 32767]
  839.  11   0    O  Throttle          Sets throttle                    [0 - 100]
  840.  12   0    O  Rotate Turret     Offsets turret (cumulative)
  841.  13   0    O  Aim Turret        Sets turret offset to value      [0 - 255]
  842.  14   0    O  Steering          Turn specified number of degrees
  843.  15   3    O  Weapon control    Fires weapon w/ angle adjustment  [-4 - 4]
  844.  16  40    I  Sonar             Returns heading to nearest target[0 - 255]
  845.  17   0   I/O Scan-Arc          Sets/Returns scan-arc width.      [0 - 64]
  846.  18   0   I/O Overburn          Sets/Returns overburn status
  847.  19   0   I/O Transponder       Sets/Returns current transponder ID
  848.  20   0   I/O Shutdown-Level    Sets/Returns shutdown-level.
  849.  
  850.   Port 13, Aim-Turret, sets the turret offset to the value given. This is
  851. an OFFSET, which means that it is RELATIVE to the robot body. (0 is straight
  852. ahead, 128 is straight back, etc). Port 12 is similar, but it is a rotation
  853. command, meaning that the turret rotates the specified number of degrees
  854. (10 is 10 to the right, -10 or 246 is 10 to the left). Port 12 is therefore
  855. much like the steering port (port 14).
  856.  
  857.   There is no port that allows you to set your turret to an absolute
  858. compass heading. You will have to calculate this yourself. However, you
  859. can access port 5 to GET your absolute turret heading (this is simply a
  860. compass mounted on the turret). Port 4 returns the turret offset, which
  861. once again is the heading of the turret relative to the robot body.
  862.  
  863.   The compass (port 3) returns your current absolute heading, which may
  864. not yet have caught up with the last turn command.
  865.  
  866.   The spedometer (port 1) returns what your current velocity is relative
  867. to your maximum. The maximum can be affected by heat level and overburn
  868. status. i.e., setting your throttle to 100 will always cause the spedometer
  869. to report 100 once the robot reaches full speed, unless you change the
  870. throttle, shutdown, reset, or collide with something. Sending a negative
  871. number to the throttle port (port 11) will make the robot drive backwards.
  872.  
  873.   The scan-arc is defined as being the number of degrees to EACH side of
  874. the center of your scan. If you set your arc to 64, you actually get a
  875. 128 total arc (half of the full circle!) (64 is the maximum).
  876.  
  877.   The scanner returns a very large number somewhere over 1500 (such as
  878. MAXINT) if no target is found.
  879.  
  880.   The weapon can fire as much as 4 degrees in either direction without
  881. turning the turret or the robot. If you leave off the final operand on
  882. the port access, as usual a 0 is assumed and the weapon fires straight
  883. ahead.
  884.  
  885.   The Sonar has a maximum range of 250. It returns a negative number if
  886. no target is within range. Also notice that it is extremely slow to access.
  887. It also has a poor accuracy. The number returned could be as far off as 32
  888. degrees in either direction (equivelant of 45 degrees in a normal 360
  889. degree circle). You'll notice that sonar is SO slow, and SO innacurate,
  890. that it is almost useless. It is merely here to give you a simple method
  891. to find the nearest target, yet encourage you to create your own search
  892. routines with the scanner.
  893.  
  894.   When accessing the overburn port, 0=off, and anything non zero is on.
  895.  
  896.   Port 19, the transponder, simply sets or returns your robots ID number.
  897. At the beginning of the battle, the transponder starts off being a number
  898. from 1 to 6 depending on which "slot" your robot is taking up in the
  899. simulation.
  900.  
  901.   Port #20, Shutdown-level, sets/returns the heat-level at which automatic
  902. shutdown will ocurr. When the robot shuts down, it will remain so until
  903. it cools down below the shutdown level minus 50 (default level is 400,
  904. therefore the robot will start up again at 350), or when the heat
  905. drops to 0.
  906.  
  907.  
  908. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  909. INTERRUPT CALLS:
  910.  
  911.   In addition to I/O ports, the robot is equipped with some built-in 
  912. functions that can be used. These functions are called interrupts. When
  913. and interrupt is initiated, In your programs you can use the INT command
  914. to execute an interrupt. When you call an interrupt, you will often need
  915. to set some of the system registers before executing it, to tell it what
  916. to do.
  917.  
  918.   Unlike in ATR1, you can not specify your own interrupt vectors. Also,
  919. all of the interrupts have been redefined and are not the same as they
  920. were in ATR1.
  921.  
  922.   In the chart header below, once again T represents the time it takes to
  923. execute the interrupt call, although unlike with the ports, this is the
  924. total time usage.
  925.  
  926. Num: T: Name:        Function:
  927. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  928.   0   - Destruct     Detonate the robot (if I go down, you go down with me!)
  929.   1  10 Reset        Resets robot program.
  930.   2   5 Locate       Sets EX,FX registers equal to X,Y coordinates.
  931.   3   2 Keepshift    Sets Keepshift, input:     AX 0 = off, non-0 = on
  932.   4   1 Overburn     Sets Overburn,  input:     AX 0 = off, non-0 = on
  933.   5   2 ID           Returns robot ID number in FX
  934.   6   2 Timer        Returns game clock in EX:FX (32-bit number)
  935.   7  32 Find Angle   Returns angle to point specified in EX,FX; AX=result
  936.   8   1 Target-ID    Returns ID of last robot scanned (with any scan) in FX
  937.   9   2 Target-Info  Returns info on last scanned target (EX=dir,FX=throttle)
  938.  10   4 Game-Info    Returns info: DX=Total number of robots active,
  939.                                    EX=Match number,
  940.                                    FX=Number of matches
  941.  11   5 Robot-info   Returns info: DX=Robot speed (in cm per game-cycle),
  942.                                    EX=Time since last damage taken
  943.                                    FX=Time since a fired shot hit a robot.
  944.                                    (time measured in game-cycles)
  945.                                    (robot speed is current as of int call)
  946.  12   1 Collisions   Returns collision count in FX
  947.  13   1 Reset ColCnt Resets collision count back to 0.
  948.  
  949.   Keepshift, when active, makes it so that whenever the robot body turns,
  950. the turret turns by the same amount in the opposite direction, thus the
  951. turret always faces the same way relative to the arena.
  952.  
  953.   Int 5 returns your current transponder ID, as described in the PORTS
  954. section.
  955.  
  956.   The timer call returns the 32-bit game clock value. Since everything in
  957. the game is handled as signed numbers, the next value above 32767 is -32768,
  958. therefore you can only reliably access the clock for 32767 cycles into the
  959. game. Most battles are completed in less than 10000 cycles though. EX holds
  960. the upper 16 bits, and FX holds the lower 16 bits of the clock value.
  961.  
  962.   Interrupt 7 is very slow to execute, since it is basically doing a
  963. trigonometric function. You put the X,Y coordinates you want into EX,FX,
  964. call the int, and afterwards AX will hold the heading you should take to
  965. get there. If you specify numbers outside the range of 0-1000, they will
  966. be truncated into this range before the calculation is performed (i.e.
  967. calling as EX=12345, FX=-500 will return the results for EX=1000, FX=0).
  968.  
  969.   Interrupt 8 will return whatever transponder ID the target robot has
  970. set.
  971.  
  972.   Interrupt 9 returns info on the last target scanned using the primary
  973. scanner (port 7). The direction of the target (relative to your scan) is
  974. returned in EX (i.e. 64 means it is facing to the right of your scan and 0
  975. means it is facing the same way you are scanning, which of course is away
  976. from you). FX returns the targets current throttle (not the "desired 
  977. throttle"), so that you may make some assesments of where it is going and 
  978. how quickly.
  979.  
  980.   Interrupt 11 has a nice feature, being able to tell how recently you've
  981. actually hit someone. This can facilitate making robots that can realize
  982. they're not hitting anything.
  983.  
  984.   Interrupts 12 and 13 allow you to easily detect collisions, without
  985. relying on your spedometer or damage totals to tell you these things
  986. (especially considering that if you were already sitting still, and
  987. someone rammed you very slowly, there would be no other way to know that
  988. a collision ocurred). Int 12 simply returns the collision-count value
  989. that is stored in memory location @8. This value is incrememnted everytime
  990. a collision ocurrs, so any time it has changed you have been involved in
  991. a collision, whether it was robot-to-robot or robot-to-wall. Int 13 resets
  992. it back to zero, so that you could have some simple code that simply
  993. checks to see if the count is non-zero (and hence a collision has ocurred
  994. since the last reset with int 13).
  995.  
  996.  
  997. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  998. MEMORY MAP:
  999.  
  1000.   The robot's memory core has 1024 memory locations, each storing a 16-bit
  1001. integer value. When the robot is initialized, all memory addresses store
  1002. a zero.
  1003.  
  1004.   The first 128 addresses are the system area. You can define up to 256
  1005. variables, which are stored right after the system area. The remaining 128
  1006. memory locations are available for you to do whatever else you want, such
  1007. as storing self-modifying code (if you are up to such a nasty challenge!)
  1008. (self-modifying code may become more practical in later revisions, for now
  1009. though you would have to have all of the instructions set up as memory
  1010. assignments, like follows:   @384 @385, @386 ; rewritable instruction #1)
  1011.  
  1012.   Each memory location stores 16 bits, as stated above. A signed 16 bit
  1013. number can be in the range of -32768 to 32767. If you look at it as a
  1014. hexidecimal number, you will ignore the "sign" of the number. If it were
  1015. unsigned, it would appear to have a range of 0 to 65535, or in hexidecimal
  1016. 0000h to FFFFh.
  1017.  
  1018. Memory map:
  1019.  
  1020.  Addr:       Name:       Function:
  1021.  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1022.     0        t-spd       Desired speed robot is trying to achieve.
  1023.     1        t-hd        Desired heading robot is trying to achieve.
  1024.     2        tpos        Current turret offset
  1025.     3        acc         accuracy value from last scan
  1026.     4        swap        temporary swap space used by swap/xchg instruction
  1027.     5        tr-id       ID of last target scanned (by any scan).
  1028.     6        tr-dir      Relative heading of last target scanned.
  1029.     7        tr-spd      Throttle of last target scanned.
  1030.     8        ColCnt      Collision count.
  1031.   9-63       res         reserved
  1032.    64        flags       flags register
  1033.    65        ax          ax register
  1034.    66        bx          bx register
  1035.    67        cx          cx register
  1036.    68        dx          dx register
  1037.    69        ex          ex register
  1038.    70        fx          fx register
  1039.    71        sp          stack pointer
  1040.  72-95       res         reserved for future registers
  1041.  96-127      res         reserved
  1042. 128-384      var         variable space
  1043. 385-511      user        user space
  1044. 512-767      com-queue   Communications receiving queue
  1045. 768-1023     res         Reserved space
  1046. 1024...      code        Robot program (code segment) (ROM)
  1047.  
  1048.   Please note that the first 4 memory locations make for an easy and
  1049. effective way to get info about your robot's status. Robots can be made
  1050. to be more efficient by accessing these. However, these are here ONLY for
  1051. getting info about the robot. If you try changing these values, it will have
  1052. no effect. To actually cause the robot to turn or whatever, you must still
  1053. access the appropriate ports.
  1054.  
  1055.   The robot's program is technically not stored in the robot's RAM, but
  1056. rather is in the robot's ROM along with the robot's BIOS (which handles
  1057. the interrupt calls).
  1058.  
  1059.   You can now access the robot program as though it were in RAM, starting
  1060. at address 1024. Please remember though that you can not jump or RET or
  1061. anything below 1024. As far as the robot's IP (instruction pointer) is
  1062. concerned, memory address 1024 is instruction address 0.
  1063.  
  1064.  
  1065. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1066. CONSTANTS:
  1067.  
  1068.   As you will see described further down under "writing the code",
  1069. the instructions are nothing more than pre-defined constants representing
  1070. numbers. Here is a chart of all of the pre-defined constants that you can
  1071. use in your programs, so that you don't have to memorize port and interrupt
  1072. numbers.
  1073.  
  1074. Value:      Mnemonic:   Port-Constant:  Interrupt-Constant:  Generic Constant:
  1075. -32768                                                           MININT
  1076.  32767                                                           MAXINT
  1077.   0          NOP                                  I_DESTRUCT
  1078.   1          ADD          P_SPEDOMETER            I_RESET
  1079.   2          SUB          P_HEAT                  I_LOCATE
  1080.   3          OR           P_COMPASS               I_KEEPSHIFT
  1081.   4          AND          P_TURRET_OFS            I_OVERBURN
  1082.   5          XOR          P_TURRET_ABS            I_ID
  1083.   6          NOT          P_DAMAGE, P_ARMOR       I_TIMER
  1084.   7          MPY          P_SCAN                  I_ANGLE
  1085.   8          DIV          P_ACCURACY              I_TID, I_TARGETID
  1086.   9          MOD          P_RADAR                 I_TINFO, I_TARGETINFO
  1087.  10          RET          P_RANDOM, P_RAND        I_GINFO, I_GAMEINFO
  1088.  11          GSB, CALL    P_THROTTLE              I_RINFO, I_ROBOTINFO
  1089.  12          JMP, GOTO    P_OFS_TURRET, P_TROTATE I_COLLISIONS
  1090.  13          JLS, JB      P_ABS_TURRET, P_TAIM    I_RESETCOLCNT
  1091.  14          JGR, JA      P_STEERING
  1092.  15          JNE          P_WEAP, P_WEAPON, P_FIRE
  1093.  16          JEQ, JE      P_SONAR
  1094.  17          XCHG, SWAP   P_ARC, P_SCANARC
  1095.  18          DO           P_OVERBURN
  1096.  19          LOOP         P_TRANSPONDER
  1097.  20          CMP          P_SHUTDOWN
  1098.  21          TEST
  1099.  22          SET, MOV
  1100.  23          LOC
  1101.  24          GET
  1102.  25          PUT
  1103.  26          INT
  1104.  27          IPO, IN
  1105.  28          OPO, OUT
  1106.  29          DEL, DELAY
  1107.  30          PUSH
  1108.  31          POP
  1109.  32          ERR, ERROR
  1110.  33          INC
  1111.  34          DEC
  1112.  35          SHL
  1113.  36          SHR
  1114.  37          ROL
  1115.  38          ROR
  1116.  39          JZ
  1117.  40          JNZ
  1118.  41          JAE, JGE
  1119.  42          JBE, JLE
  1120.  43          SAL
  1121.  44          SAR
  1122.  45          NEG
  1123.  46          JTL
  1124.  
  1125.  
  1126. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1127. WRITING THE CODE:
  1128.  
  1129.   Ok, now that you've seen the reference charts, how 'bout learning the
  1130. syntax of the language, and a few of the subtleties? Below is a crash course,
  1131. emphasizing CRASH. It is assumed that you have some familiarity with
  1132. programming concepts. Even though the explanations start out being
  1133. extremely basic, it gets into the more specific nuances of the language
  1134. very quickly. Everything else you may need to teach yourself, perhaps
  1135. through trial and error.
  1136.  
  1137.   Every command line consists of an instruction (sometimes called a
  1138. command, or an operator), and usually one or two operands. The compiler
  1139. is not too picky about what is used where, so most things are interchangable.
  1140. Also remember that capitalization is totally irrelevant.
  1141.  
  1142.   Let's look at an example:
  1143.  
  1144.   Add   ax,  2
  1145.  
  1146.   This takes the value in the register AX, adds 2, then stores it
  1147. back into the AX register.
  1148.  
  1149.   You can create remarks/comments by using the semi-colon. From now on
  1150. you will see comments next to the instructions explaining them.
  1151.  
  1152.         Add     ax,      2      ; ax = ax+2
  1153.  
  1154.   If you wish, you can use loop commands to repeat something
  1155. several times:
  1156.  
  1157.         do      5               ; cx = 5
  1158. :1
  1159.         add     ax,     2       ; ax = ax+2
  1160.         loop    1               ; decrement cx, if >0 goto :1
  1161.  
  1162.   In this previous example, it would have the effect of simply
  1163. adding 10 (2 added 5 times) to AX. Make sure the loop is structured
  1164. properly though. Here is what NOT to do:
  1165.  
  1166. :1
  1167.         do      5               ; cx = 5
  1168.         add     ax,     2       ; ax = ax+2
  1169.         loop    1               ; decrement cx, if >0 goto :1
  1170.  
  1171.   In this past example, CX is reset to 5 everytime through the loop,
  1172. therefore never reaching 0. What you have is an infinite loop. Of course,
  1173. making infinite loops is easy:
  1174.  
  1175. :1
  1176.         jmp     1
  1177.  
  1178.   To put a specific number into a variable/register, simply
  1179. use SET/MOV:
  1180.  
  1181.         mov     ax,     15      ; ax = 15
  1182.  
  1183.   Or you could use the memory address:
  1184.  
  1185.         mov    @65,    15       ; ax = 15
  1186.  
  1187.   Or copy a variable:
  1188.  
  1189.         mov    @65,    @66      ; ax = bx
  1190.         mov    ax,     bx       ; ax = bx
  1191.  
  1192.   In this past example, as far as the compiler is concerned, both lines
  1193. are identical. Variable names simply get replaced with the addresses that
  1194. they represent. For that matter, so do the instructions themselves, as you
  1195. will see further down.
  1196.  
  1197.   For now, let's look at how you would define your own variable:
  1198.  
  1199. #def x
  1200. #def my_var
  1201.  
  1202.         xor     x,      x       ; x = 0 (anything xor'ed with itself is 0)
  1203.         mov     my_var, x       ; my_var = x (and therefore equals 0)
  1204.  
  1205.   Now, as stated above, the instructions are nothing more than words that
  1206. represent numbers, just like everything else:
  1207.  
  1208.        add      ax,     ax      ; ax = ax+ax (in other words, ax = ax*2)
  1209.        1        ax,     ax      ; Same thing! (add = 1)
  1210.        1        @65     @65     ; Same thing!!
  1211.  
  1212.   In fact, you can use variables in place of instructions:
  1213.  
  1214. #def inst
  1215.  
  1216.         mov     inst,   1       ; inst = 1
  1217.         inst    @65,    @65     ; same as "ADD AX, AX"
  1218.  
  1219.   If you leave off an operand, a 0 is assumed:
  1220.  
  1221.         mov     ax              ; ax = 0
  1222.  
  1223.   If you execute an interrupt this way, you get an interesting effect:
  1224.  
  1225.         int                     ; call int #0, kaboom! farewell cruel world!
  1226.  
  1227.   You could make a destruct deciding routine that would simply change a
  1228. variable. INT is 26, by the way
  1229.  
  1230.         xor     dx,     dx      ; dx = 0
  1231.  
  1232.         ipo     6,      armor   ; armor = armor value from armor sensor
  1233.         cmp     armor,  10      ; campare armor to 10
  1234.         ja      1000            ; if greater than 10, skip to :1000
  1235.         je      2000            ; if equal to 10, skip to :2000
  1236.         mov     dx,     26      ; dx = 26
  1237. :1000
  1238.         dx                      ; if dx=26 then kaboom! if 0, then nothing.
  1239. :2000
  1240.  
  1241.   You can also use the stack to store numbers if it is convenient:
  1242.  
  1243.         push    ax              ; put ax on the stack.
  1244.         pop     bx              ; pop a number off the stack into bx,
  1245.                                 ;    since the last thing pushed was ax,
  1246.                                 ;    whatever was in ax is now in bx.
  1247.  
  1248.   Be careful with the stack though, since it is the same stack used for
  1249. CALL/GOSUB/GSB and RET instructions. If you use PUSH and POP in a subroutine,
  1250. be sure to pop everything back off before you use RET.
  1251.  
  1252. :1
  1253.         CALL    1000    ; call subroutine at :1000
  1254.         jmp     1       ; loop back to :1, thus endlessly repeating the CALL
  1255.  
  1256. :1000
  1257.         opo     15      ; FIRE! (Output to port 15 fires weapon)
  1258.                         ;   no second operand, so 0 is assumed. Fire straight.
  1259.                         ;   (weapon can fire up to 4 degrees off center)
  1260.         ret             ; return to source of CALL.
  1261.  
  1262.   As shown above, you can easily create subroutines, which of course
  1263. facilitate making code that you can access from multiple places in the
  1264. program, and still have it always return to where you called it from.
  1265.  
  1266.   Now let's discuss nested loops. Since CX is used for loops, CX has to
  1267. be temporarily stored elsewhere during inner loops:
  1268.  
  1269.         DO      5               ; cx = 5
  1270. :1
  1271.         opo     13,     8       ; turn turret 8 degrees right
  1272.  
  1273.         mov     bx,     cx      ; bx = cx
  1274.         DO      5               ; cx = 5
  1275. :2
  1276.         opo     15              ; fire!
  1277.  
  1278.         LOOP    2               ; loop up to :2
  1279.         mov     cx,     bx      ; cx = bx
  1280.  
  1281.         LOOP    1               ; loop up to :1
  1282.  
  1283.   This would fire the weapon 25 times, 5 times at each angle. Perhaps
  1284. a better and less confusing method would be to use PUSH and POP, that way
  1285. we don't accidently screw up by doing something with bx.
  1286.  
  1287.         DO      5               ; cx = 5
  1288. :1
  1289.         opo     13,     8       ; turn turret 8 degrees right
  1290.  
  1291.         push    cx              ; put cx on stack
  1292.         DO      5               ; cx = 5
  1293. :2
  1294.         opo     15              ; fire!
  1295.  
  1296.         LOOP    2               ; loop up to :2
  1297.         pop     cx              ; get cx from stack
  1298.  
  1299.         LOOP    1               ; loop up to :1
  1300.  
  1301.  
  1302.   Also keep in mind how long it takes to do something. The following
  1303. three instructions all double the value of ax.
  1304.  
  1305.         MPY     ax,     2       ; ax = ax*2           time used: 8
  1306.         shl     ax,     1       ; ax = ax shl 1       time used: 1
  1307.         add     ax,     ax      ; ax = ax + ax        time used: 1
  1308.  
  1309.   Also compare these two:   (both quadruple AX)
  1310.  
  1311.         MPY     ax,     4       ; ax = ax*2           time used: 8
  1312.         shl     ax,     2       ; ax = ax shl 2       time used: 1
  1313.  
  1314.   Also note that by breaking any multiplication or division down into
  1315. powers of two you can also exectute fast math. For instance, a multiply
  1316. by 3 takes 10 clock cycles. The following example uses only 3, and achieves
  1317. the same result:
  1318.  
  1319.         MPY     ax,     3       ; ax = ax*3   (10 cpu cycles)
  1320.        ; or try the following instead
  1321.         MOV     bx,     ax      ; bx = ax       (1 cpu cycle)
  1322.         SHL     ax,     2       ; ax = ax * 2   (1 cpu cycle)
  1323.         ADD     ax,     bx      ; ax = ax + bx  (1 cpu cycle)
  1324.                                 ; net result is:  ax = (ax*2)+ax
  1325.                                 ;             or  ax = ax*3
  1326.  
  1327.   Please note however that bit shifts don't work so reliably with very
  1328. large numbers or negative numbers.
  1329.  
  1330.   Now that you've seen how to do loops, and some of the slick little
  1331. tricks you can use, I'll end this segment by meantioning the use of the
  1332. pre-defined constants to help with all those confusing port numbers.
  1333. Back with the other charts you will find a chart of these constants, and
  1334. below are a few examples:
  1335.  
  1336.         opo     p_fire          ; same as "opo 15"   - FIRE!
  1337.  
  1338.         p_spedometer   ax, ax   ; same as "1 ax ax" or "add ax ax"
  1339.  
  1340.  
  1341.   I hope that was enough to get you started. Believe me, if you can do
  1342. this stuff (and this isn't too hard), then you've tackled the basics
  1343. necessary for doing REAL programming in assembly on the PC. Just remember
  1344. that the PC is not as forgiving as ATR2!
  1345.  
  1346.   Now don't go away yet! Below are the error codes your robot might
  1347. generate...
  1348.  
  1349. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1350. ERRORS:
  1351.  
  1352.   Your robots should never generate a runtime error (either in terms of the
  1353. robot, OR the main game itself, but in this case we mean in terms of the 
  1354. robot). If they do make one, and you have the graphics and status bars turned
  1355. on, you'll be made aware of it. If the sound is on, then you'll hear it as 
  1356. well. If you have the graphics on, the bottom row of the status display
  1357. shows the last error code genereated by your robot. If your robot works
  1358. properly, and you aren't using the ERR command, it should always be "None".
  1359.  
  1360.   When a robot has a runtime error, the program will continue on and simply
  1361. not do the command that created the error. Note that the command that had
  1362. the error STILL uses your robot's time.
  1363.  
  1364.   If you use the ERR instruction to output info, you might want to display
  1365. numbers that aren't listed below, so you can tell the difference between
  1366. your error and a real robot error.
  1367.  
  1368. Here are the error codes:
  1369.  
  1370. Code:  Meaning:
  1371.   1     Stack full - This means that you have used too many PUSHes and/or
  1372.                      CALL/GOSUB/GSB commands without using the appropriate
  1373.                      POPs and RETs. This is a common problem for novice
  1374.                      programmers.
  1375.  
  1376.   2     Label not found - This means you're trying to jump or call or
  1377.                           something to a label that does not exist. Go
  1378.                           make sure all of the labels you call actually
  1379.                           exist somewhere. If you are using JTL, maybe
  1380.                           the location you are jumping to is outside of
  1381.                           the program.
  1382.  
  1383.   3     Can't assign value - This means you're trying to store the result
  1384.                              of an operation into something that is not
  1385.                              a variable of some sort. Maybe you got the
  1386.                              operand order confused on an IPO command.
  1387.  
  1388.   4     Illegal memory reference - You're accessing a memory address that
  1389.                                    does not exist! Remember, there are only
  1390.                                    so many memory addresses in your robot!
  1391.  
  1392.   5     Stack empty - This is the reverse of error #1, meaning you're calling
  1393.                       too many POPs and RETs compared to your use of PUSH and
  1394.                       GOSUB/CALL/GSB commands. This is a much less likely
  1395.                       mistake to make.
  1396.  
  1397.   6     Illegal instruction - Hey! Trying to invent a new instruction eh?
  1398.                               This error ocurrs when you try to execute an
  1399.                               instruction that does not exist. If you program
  1400.                               with actual instruction mnemonics instead of
  1401.                               using variables and numbers in their place you
  1402.                               will not get this error, unless you redefine
  1403.                               a mnemonic as a variable.
  1404.  
  1405.   7     Return out of range - Your RET command yielded a number that is
  1406.                               outside your program. You must have called
  1407.                               a RET when the last thing still on the stack
  1408.                               was PUSHed there.
  1409.  
  1410.   8     Divide by ZERO  - You executed a DIV or MOD instruction with
  1411.                           the second operand being a 0. 
  1412.  
  1413.   9     Unresolved !label - You should never see this happen. No unresolved
  1414.                             !labels should make it past the compiler.
  1415.  
  1416.  10     Invalid Interrupt Call - This simply means that the interrupt
  1417.                                  you are trying to call does not exist.
  1418.  
  1419.  11     Invalid Port Access - Either the port you are accessing does not
  1420.                               exist, or you are writing to an input port,
  1421.                               or you are reading from an output port.
  1422.  
  1423.  
  1424. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1425. DESIGNING THE PERFECT ROBOT:
  1426.  
  1427.   Ok, I'll bet you just glanced through the above information and are
  1428. thinking, "Ok, great. It looks nice, but how do I use it?" I hope to explain
  1429. a few details here, but I think the sample robot programs are by far the
  1430. best source of information. By looking through the samples robots, you can
  1431. pick up a few tricks and tips. Below are a few charts to refer back to at
  1432. later times, and a few general rules to go by. Afterwards is some more text
  1433. to help teach you about those strange little features that make the robots
  1434. so much more deadly, but require some understanding first.
  1435.  
  1436.   As you create your robot, you will want to first make sure it can handle
  1437. a stationary target. Afterwards you will want to slowly increase the
  1438. difficulty. Here is the order in which you should try some of the sample
  1439. robots as opponents:
  1440.  
  1441.    1. SDUCK
  1442.    2. CIRCLES
  1443.    3. TRACKER
  1444.    4. SNIPER and/or RANDMAN3
  1445.  
  1446.   General rules:
  1447.            1.  Try to make all the parameters line up in single columns,
  1448.                they're easier to read that way (hint: use the tab key).
  1449.            2.  You MAY leave blank lines. The compiler ignores them.
  1450.            3.  One command is executed each cycle unless otherwise noted.
  1451.            4.  Examining the sample robots is the best teacher.
  1452.            5.  Commands may be upper-case, lower-case, or any combination.
  1453.            6.  Never make multiple labels of the same ID number within the 
  1454.                same program.
  1455.            7.  All robots MUST have the extension AT2.
  1456.                   ex- MYROBOT.AT2, or THISGUY.AT2
  1457.  
  1458.   When you perform a scan, the number that is returned is the distance to
  1459. the nearest target within the scan arc. If no target is found, a huge number
  1460. is returned (specifically MAXINT, or 32767). This sets an internal variable
  1461. as well which is referred to as the "scan accuracy". This number can be
  1462. accessed by reading from the "accuracy" port. It will be a number from -2 to
  1463. +2. If the target was all the way on the left side of the scan, this number
  1464. will be -2. If it were on the right, +2. Dead center is 0, half-way to the
  1465. left is -1 and half way to the right is +1. Based upon the size of your scan
  1466. arc, you can use this number to figure out where the target is. The weapon
  1467. is capable of firing up to 4 degrees in either direction without turning the
  1468. turret or the whole robot, and so using the accuracy setting can be very
  1469. useful.
  1470.  
  1471.   There are several "setting" ports, such as the turret, and arc-width ports.
  1472. The default settings are as follows:  
  1473.  
  1474.   Item:               Value:
  1475.   --------------------------
  1476.    Turret Offset/shift  0
  1477.    Throttle             0
  1478.    Scan arc radius      8
  1479.    Overburn           off
  1480.    Keepshift          off
  1481.  
  1482.   All variables are set to 0 at the beginning of the battle. These settings
  1483. are all restored to default if the reset interrupt is called.
  1484.  
  1485.   Note that when you rotate the turret, EVERYthing that is on it turns 
  1486. with it. This includes the scanner AND the weapon.
  1487.  
  1488.   Remember to be careful with the stack. A program can get very mixed up if
  1489. you don't call the approprite RETs and POPs, in proper order, for all of
  1490. your CALL/GOSUB/GSB and PUSH commands.
  1491.  
  1492.   Also remember that if you aren't sure whether a particular section of
  1493. code is doing what you want, or your not sure whether it is even executing
  1494. a section of program code, then try using the ERR instruction to display
  1495. the results of your calculations. The ERR command does not use up your
  1496. robot's CPU time, and can be very useful in tracking down bugs in the robot
  1497. (or in the game itself!) You may also want to turn on the display of
  1498. scan-arcs (/A parameter, or "A" key during battle) so that you can see
  1499. where your robot is looking.
  1500.  
  1501.  
  1502. ----------------------------------------------------------------------------
  1503. THE PHYSICS OF AT-ROBOTS:
  1504.  
  1505.   This section is purely theoretical and hypothetical, as it hopefully
  1506. will remain...  :-)
  1507.  
  1508.   Assuming that the arena is a square kilometer, and that the actual
  1509. simulated time runs at 10 cycles/second, we can extrapolate and extract
  1510. the following information: (you can see the game run at roughly this speed
  1511. with the /D100 parameter):
  1512.  
  1513. Robot Technical info:
  1514.  
  1515.   Length:                       8 meters   or  26.25 feet
  1516.                                 (in other words, a reasonably sized TANK)
  1517.  
  1518.   Max velocity (normal):        144.0 kph  or  089.48 mph
  1519.   Max velocity (overburn):      187.2 kph  or  116.32 mph
  1520.   Time from 0 to max speed:     2.5 seconds (0 to 116 in 2.5 seconds!?)
  1521.   Time to turn fully about:     1.6 seconds (even at full speed!?
  1522.                                              and without skidding!?!)
  1523.  
  1524.   Normal missile velocity:      1152 kph   or  715.84 mph
  1525.                                                (nearly 3/4 of mach 1)
  1526.  
  1527.   Processor speed:              50 hertz
  1528.   Maximum ROM program size:     8k
  1529.   RAM capacity:                 2k
  1530.  
  1531.   Ammunition supply:            Unlimited (missiles are generated from
  1532.                                         the on-board fusion power-plant).
  1533.  
  1534.  
  1535.   scary, huh?
  1536.  
  1537.   If you wanted to assume that the game runs at the default of about
  1538. 30 cycles per second, triple the speeds above. Even more scary, eh?
  1539.  
  1540.   And an even more scary thought is that these huge, fast tanks are
  1541. controlled by processors whose speed is measured in hertz, not megahertz.
  1542.  
  1543.  
  1544. ----------------------------------------------------------------------------
  1545. STAGING A COMPETITION:
  1546.  
  1547.   When staging a competition, be sure to specify the rules and the settings
  1548. that will be using in the game (such as timeslice, time limit, and number
  1549. of matches to be fought). These things must be decided ahead of time, so
  1550. that the players may optimize their robots for these settings.
  1551.  
  1552.   Make sure that all players involved are aware of the ATRLOCK program, so
  1553. that they don't have to give away their secrets easily.
  1554.  
  1555. ----------------------------------------------------------------------------
  1556. TROUBLE-SHOOTING & SPEED-CONTROL:
  1557.  
  1558.   The AT-Robots program is basically fully automatic and self-contained. It
  1559. will probably either work or it won't. If there is a problem, most likely
  1560. (but not definitely) you are out of luck. Here are some possible causes of
  1561. your difficulty:
  1562.  
  1563.                  1.  Not enough memory.
  1564.                  2.  Incompatable graphics adapter.
  1565.                  3.  Damaged copy of AT-Robots.
  1566.                  4.  Computer is not sufficiently IBM compatable.
  1567.                  5.  You haven't followed any of the instructions.
  1568.                  6.  Computer is damaged or not performing properly.
  1569.                  7.  You're using too early a version of DOS.
  1570.                      (suggest DOS 3.3 or higher)
  1571.                  8.  Hardware/software conflict
  1572.  
  1573.   If you HAVE gotten the program to run, but it's too slow, there are some
  1574. things you can do to speed it up. First, You can try putting only 2 or 3 
  1575. robots in the arena at once. You will find that the program slows down a lot
  1576. when you put 5 or 6. Another thing you can do is put the /D0 setting in. That
  1577. will turn off the delay that is placed in the program to keep it running at
  1578. the proper speed on faster computers. Usually the delay won't need to be
  1579. cranked down unless you're using an older computer (286 or 386).
  1580.  
  1581. ----------------------------------------------------------------------------
  1582. LEGAL SHTUFFS:
  1583.  
  1584.    This game is being distributed as "shareware", which basically means
  1585. "try before you buy". You are entitled to try out this program to evaluate
  1586. its use to you. If you continue to use it you are expected to pay for it,
  1587. as outlined in the REGISTRATION section below. You are also encouraged to
  1588. give copies of the unregistered version to your friends, and upload it to
  1589. bulletin boards. The copies you distribute MUST be unmodified, and must be
  1590. the unregistered version of the program. If you are a shareware disk vendor,
  1591. (CD, floppy, or on-line) please see the section labelled "VENDORS" below.
  1592.  
  1593.  
  1594. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1595. REGISTRATION:
  1596.  
  1597.    This program is being distributed on the "shareware" concept. This means
  1598. that you can distribute it on BBS's, give copies to your friends, etc, as
  1599. long as you don;t turn it into a commercial venture. However, in terms of
  1600. its use, it is by no means completely free. If you think the program is of
  1601. use to you, or you use it for any reasonable amount of time, please send a
  1602. registration fee of $14 (US). If you think that is rediculous, then send
  1603. less (or more for that matter). If you hate the program or found too many
  1604. bugs, write me and tell me, and include a graphic explanation (but don't be
  1605. too harsh!! Heheheh). In any event, write to:
  1606.  
  1607.                            Ed T. Toton III
  1608.                          7101  Talisman Lane
  1609.                        Columbia MD. 21045-4804
  1610.                                 (USA)
  1611.  
  1612. For current CONTACT INFORMATION see:   NBONES.DOC
  1613.  
  1614.   We accept cash, checks (ones that are paper, not rubber, if you catch my
  1615. meaning), or money orders. Please make sure all checks and money orders
  1616. are from US banks/postal-services, and all cash must be US legal tender.
  1617.  
  1618.   We regret to inform you that we no longer accept the following forms of
  1619. payment: briefcases full of drugs, top secret documents, women, firstborn
  1620. children, slaves, work animals, crates of firearms, and thumbtacks. Ok,
  1621. maybe we'll still take women...   :-)
  1622.  
  1623.   Please make sure you clearly spell out your name the way you would
  1624. like it to appear in the program. If you would like copies of some of my
  1625. other software, or a current copy of this program, please send me a blank
  1626. disk to send them to you on.
  1627.  
  1628.  
  1629.       And WHY should you register it?
  1630.         1.  To support my continuing efforts to bring you some level of
  1631.              functional programs. If I get no cash, you get no improvements
  1632.              in these programs, and I won't be encouraged to make new and
  1633.              better software!
  1634.         2.  To get that warm glow for knowing that you supported the author 
  1635.              of at least one of the many shareware programs you probably use.
  1636.         3.  To find out if there is a newer version. All you need to do is 
  1637.              ask! But letters with money take priority!
  1638.         4.  You could be sick and demented and thus register everything you
  1639.              get your hands on.
  1640.         5.  It's the right thing to do.
  1641.         6.  Registration code required to use the tournament program
  1642.             (which has not been made available yet)
  1643.         7.  Registration code removes those nag messages!
  1644.  
  1645.  
  1646.   Once you register you will get a registration code that will disable
  1647. the nag-messages. To use it, either enter the info using the ATROBS SHELL
  1648. or enter it into a data file manually.
  1649.  
  1650.   To do it manually, simply do the following from the DOS prompt:
  1651.  
  1652. COPY CON ATR2.REG<enter>
  1653. <reg name goes here> <enter>
  1654. <reg number goes here> <enter>
  1655. ^Z
  1656.  
  1657.   In the above, anything inside angle brackets indicates what to put.
  1658. Also, ^Z means Ctrl-Z or F6.
  1659.  
  1660.   Another way is to simply enter the two lines in a text editor and save
  1661. it under the filename of ATR2.REG.
  1662.  
  1663. example:
  1664.  
  1665. John A. Smith
  1666. 1234567
  1667.  
  1668.   The capitalization COUNTS! It must appear precisely as it does on your
  1669. registration response.
  1670.  
  1671.  
  1672. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1673.  
  1674.   This Program, Manual, and Data Files, are all protected by U.S. Copyright
  1675.  Law (title 17 United States Code). Unauthorized reproduction, distribution
  1676.  and/or sales may result in imprisonment of up to one year and fine up to
  1677.  $10,000 (17 USC 506).  Copyright infringers may also be subject to civil
  1678.  liability. If you mess with us, we'll delete you!
  1679.  
  1680.          The author of this program makes no warranties of any
  1681.       kind, expressed or implied, as to the fitness, functionality,
  1682.       effectiveness, or safety of this software and accompanying
  1683.       documentation. Under no circumstances shall the author and
  1684.       developer be liable for any damages incurred during or as a
  1685.       result of the use of, or misuse of, or inability to use, this
  1686.       software and documentation. All risk is assumed by the user,
  1687.       and we hereby disclaim any implied warranties of fitness or
  1688.       performance of this software. Use at your own risk.
  1689.          The developer and author reserves the right to make
  1690.       revisions and changes to the software and documentation without
  1691.       warning at any time. Any and all changes and revisions will be
  1692.       made without obligation to inform any person or persons of said
  1693.       changes.
  1694.  
  1695. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1696. VENDORS:
  1697.  
  1698.    Recently I have altered my policies concerning shareware vendors. Now you
  1699. must first obtain written permission from the author before you can
  1700. distribute this program. One reason for this is so that I may try to avoid
  1701. certain "unpleasant" situations, but the main reason is merely so that I
  1702. may keep track of what is being distributed where, and by whom.
  1703.  
  1704.    To obtain permission to distribute this program, simply write to me
  1705. using snail-mail or e-mail (same address as listed above for registration),
  1706. and include the following information:
  1707.  
  1708.    1. Your name (or company name) and address.
  1709.    2. Your policies for encouraging your customers to
  1710.       register the shareware they obtain from you.
  1711.    3. The cost the customers will pay for the program.
  1712.    4. The means of distribution (i.e. mail order, disks in computers stores,
  1713.       disks at computer shows, on-line services etc).
  1714.  
  1715.    If you do not include this information, your request will be denied.
  1716. If you do include the information, your request will most likely be granted.
  1717. I simply need to know where my programs are going, and I need to make sure
  1718. that I at least have the option to regulate the pricing.
  1719.  
  1720. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1721.  
  1722. Disclaimer:
  1723.  
  1724.    Before installing, backup your hard-drive (what!?). The program is
  1725. harmless, but if by some chance it blows up in your face, burns down your
  1726. house, or attacks your cat with a fake pickled trout, or incurs any other
  1727. damage (to data or otherwise), I am not responsible. If you can not accept
  1728. these terms, delete this package now and don't use it.
  1729.  
  1730.  
  1731. ----------------------------------------------------------------------------
  1732. REVISION HISTORY:
  1733.  
  1734.   2.00a   -  In-house test version.
  1735.  
  1736.   2.00b   -  First public release, beta test.
  1737.  
  1738.   2.00c   -  INC and DEC instructions fixed (used to be backwards)
  1739.  
  1740.   2.00d   -  Fixed a documentation error: Port 12 & 13
  1741.           -  General DOC updates, spelling fixes, & clarifications added
  1742.           -  New LOCK feature to encrypt/scramble robots for distribution.
  1743.  
  1744.   2.00e   -  More Documentation clarifications
  1745.           -  'S' key to toggle sound on/off now works.
  1746.           -  LOCK program now copies header of comments over to
  1747.                LOCKed copy before encoding.
  1748.           -  Heat generation/dissipation is now itemized in DOCs.
  1749.           -  Reverse throttle added
  1750.           -  You can now add comments after labels and compiler
  1751.                directives (on the same line).
  1752.           -  Find-Angle interrupt added.
  1753.           -  Find enemy ID interrupt added.
  1754.           -  Registration codes added.
  1755.           -  #MSG compiler directive added (message display was
  1756.                already implemented in version 2.00a, but there was
  1757.                no way to define the message).
  1758.           -  #TIME directive added.
  1759.           -  AT-Robots Shell now included.
  1760.           -  TABs are handled more effectively by the compiler now.
  1761.  
  1762.   2.00f   -  New error code:  Divide by 0. (It would have previously
  1763.                 caused the GAME, not the robot, to have a runtime error).
  1764.           -  Shell is now complete  :-)  (was missing a file)
  1765.  
  1766.   2.00g   -  Bug fixed with robots taking missile damage. (bug was
  1767.                introduced in 2.00e)
  1768.  
  1769.   2.00h   -  JLE/JBE and JAE/JGE instructions now work (they used to
  1770.                see if something was less/greater than AND equal instead
  1771.                of OR, and would therefore never jump).
  1772.           -  SAL and SAR instructions added, for signed bit-shifts.
  1773.           -  NEG instruction added
  1774.           -  Heat-bar graphs are now only re-drawn when a visible
  1775.                change ocurrs. (for the sake of run-time efficiency)
  1776.           -  Robots now dissipate an extra point of heat every 8 game
  1777.                cycles if abs(throttle)<=25.
  1778.           -  Interrupt 9 (target info) added.
  1779.           -  Collision distance reduced (robots now have a radius
  1780.              of 4 meters instead of 6).
  1781.  
  1782.   2.00i  -  "The Physics of AT-Robots" added to DOC file.
  1783.          -  RAM address 3 "accuracy", now works
  1784.          -  RAM addresses 0 and 1 were reversed in DOC file, now fixed.
  1785.          -  New GIF to replace old robot schematic.
  1786.          -  LOCK program renamed ATRLOCK to avoid confusion with
  1787.               LOCK command for locking files in Win95.
  1788.          -  More documentation clarifications and explanations.
  1789.          -  Program code can now be accessed (but not changed) by
  1790.               normal pointers ("@" codes).
  1791.          -  Constants added for interrupts 7 through 9.
  1792.          -  Range-checking on GET and PUT added.
  1793.          -  New label-addressing mode added.
  1794.          -  JTL instruction added.
  1795.          -  Jump/CALL range-checking improved.
  1796.          -  Find-angle interrupt sped up.
  1797.          -  New sample robots: SWEEPER, TRACON
  1798.          -  Scan "accuracy" fixed. Used to return -2,0,+2,
  1799.               but never -1 or +1.
  1800.          -  Minimum scan-arc reduced from 1 to 0.
  1801.          -  Interrupt 10 (Game-info) added.
  1802.          -  Interrupt 11 (Robot-info) added.
  1803.          -  Missiles now have a little more room along the walls
  1804.             (they don't dissappear within the viewport anymore)
  1805.          -  Number of wins is now displayed in robot status display.
  1806.  
  1807.   2.00j  -  Compiler is even more accepting of TABs and other
  1808.               extraneous control-characters.
  1809.          -  Collision count (interrupts 12 and 13) added.
  1810.          -  Error #10 added (invalid interrupt call).
  1811.          -  Error #11 added (invalid port access).
  1812.          -  SDUCK now accesses the correct port to randomly
  1813.               aim its turret...  ooh yay.
  1814.          -  RANDMAN has been slightly improved (so as not to get
  1815.               stuck on the walls as much)
  1816.          -  Minor adjustment to the missile blast algorithm.
  1817.  
  1818.   2.00k  -  Minor adjustment made to the movement routine. A rounding
  1819.               error made it impossible to go at heading 192 (left)
  1820.               at a Y of 0 (north wall). This has been fixed.
  1821.  
  1822.   2.00l  -  Minor internal re-arrangements to make the code a little
  1823.               more organized.
  1824.          -  Transponder functions added- Port 19.
  1825.          -  Robots can no longer start a battle inside of each
  1826.               other (I never actually saw this happen, but it was
  1827.               theoretically possible).
  1828.          -  Port 20, shutdown level added.
  1829.          -  Robots now take damage faster in the heat range
  1830.               of 475 to 499.
  1831.          -  Minor adjustment to the rounding in the scan accuracy returns.
  1832.  
  1833.   All of the 2.00 versions are beta versions. The first non-beta will
  1834. most likely be version 2.01 (unless I run out of letter of the
  1835. alphabet!)  :-)
  1836.  
  1837.  
  1838. ----------------------------------------------------------------------------
  1839.  
  1840.  
  1841. Well, that's all! Have fun!!!
  1842.  
  1843.  
  1844. For current CONTACT INFORMATION see:   NBONES.DOC
  1845.  
  1846.  
  1847.                                                         -Ed T. Toton III
  1848.                                                           "Necromancer"
  1849.                                                       NecroBones Software.
  1850.  
  1851. ----------------------------------------------------------------------------
  1852.