Editor/Assembler

From Ninerpedia
Jump to navigation Jump to search

The Editor/Assembler cartridge is one of the most important cartridges for the TI system. Together with the two companion floppy disks (one contains source code for a TI games module) it provides an Integrated Development Environment (IDE) for assembly programming.

Overview

This is the start screen of the cartridge.

Editor assembler.png

Requirements

To use the Editor/Assembler you require memory expansion, disk interface and at least one disk drive.

Menu selections

Editor

Enters the editor part of the E/A. When selecting LOAD or EDIT, the editor is loaded from the disk in drive 1. The editor's file name is EDIT1. Using the editor you create files of 9900 Source code.

Assembler

Enters the assembler part of the E/A. First, the assembler must be loaded from the disk in drive 1. The assembler consists of the two files ASSM1 and ASSM2.

The assembler takes your Source code and produces Object code which can be run with various modules. Different modules require different assembly, although later utilities allowed eg Extended Basic to run most forms. Extended Basic uses different internal memory mapping, and therefore you have to use different memory locations for example to print to the screen unless a utility is used to modify the Extended BASIC mapping.

The three types of Object file were-

Standard (display fixed 80 files), required if you wish to run the program with the Extended Basic module.

Condensed (display fixed 80 files), which uses less disk space but would not load with Extended Basic.

Program format (memory image): Which uses even less space but but cannot be loaded by a BASIC program. Utilities became available which allowed Extended Basic to load and run program format files, however if you only want to load a machine code utility to CALL in your own program you still have to use the DF80 format)

Load and Run

Loads one or more tagged files (Display Fixed 80 format) into memory, and allows the user to start a program. A tagged file is a machine language file which is relocatable, that is, it can be loaded into memory at (almost) any free location. This is quite comfortable when you have several modules to be loaded before the program can be started.

If the file currently being loaded ends with an autostart tag, the system will execute that program. Otherwise the user gets a prompt for entering the name of the program to be started.

Run

Any file that has been loaded by option 3 (Load and run) may be started by providing the program name here. This is the same functionality as in option 3, just without prior loading.

Run Program File

This option loads a memory image file or a set of files if the program is longer than 8 KiB. Execution starts immediately after loading the last file.

Loading memory images is particularly fast, but comes at the cost of flexibility. The program code is not relocatable anymore and must be previously saved as a memory image. Unlike programs loaded by option 3, memory images cannot rely on external utilities, so all required utilities must be included.

Device Names- Print, Run, List

The Editor/Assembler module REQUIRES a full stop after the first part of the device name. To print to a parallel printer PIO will not work but PIO. will work. This was an error in an Ed/As disk file as issued. After TI exited the market the bug was fixed but many disks remain with the error remaining.

In a similar fashion if you select "RUN PROGRAM" you can use CS1. - with the full stop at the end. This will allow you to load multiple file program from CS1, where on a disk they would be for example GAME,GAMF and GAMG.

This difficulty was not intended behaviour and can be traced to a routine in the file ASSM2 using the wrong register. The error lies in the DSRLNK routine which the assembler uses - it does not use the same routine that YOUR programs call. The assembler internally uses a modified VSBR routine which returns data to R0 instead of the usual R1, but the internal DSRLNK doesn;t take this into account.

Consequently, the assembler looks at R1, and the program uses an incorrect name length when scanning for the device name! Adding the period causes the routine to exit, and "catches" the error.

Want to fix it? If you still have the original ASSM2 file, use a sector editor look for the code 04 20 AA BE 00 00 D1 C1. It is usually in the 8th sector of the file.

Change that last C1 into a C0 and the Assembler will work as it is supposed to! No need to add a full stop after PIO now!

Editor Assembler Manual errata

  • p42. 3.1.3.1 In the last sentence of the first paragraph, change 'least' to 'most'
  • p92. 6.10 In the second line of the example explanation, change "value of ADDR" to "value in ADDR".
  • p104. 6.14.2 In the example, change "MOV *11,1" to "MOV *11+ ,1"
  • p127. 7.20.1 In the next-to-last line, change ">2220" to ">C220"
  • p168. 10.5 In the example, change ">2A41" to "@ >2A41" and "Register 3" to "Register 2"
  • p262. 16.2.4. (Add the following.) NOTE: Some devices modify the GROM read address. RS232 and TP are known offenders. If your program accesses these devices, save the current GROM address (see section l6.5.2) before the I/O operation, and restore it (see section 16.5.1) after your program has accessed the device. Otherwise, the program will not be able to return to the Editor/Assembler or BASIC or to perform a BLWP @GPLLNK properly.
  • p289. 17.2.6 Change line 130 in the BASIC program to CALL LOAD("DSK1.BSCSUP","DSK2.STRINGO") This assumes that you have entered the source file on the next page by means of the Editor, saved the file as DSK2.STRING, and run the Assembler, using DSK2.STRING for a source file and producing DSK2.STRINGO as an object file.
  • p328. 21.1 The default for VDP Register 7 is >07 in TI BASIC and Extended BASIC
  • p335. 21.5.2 In the last paragraph, change ">00 or >04" to ">03 or >07"
  • p335. 21.5.3 In the last paragraph, change ">00 or >04" to ">7F or >FF"
  • p415. 24.4.8 Change the second instance of GRMRD to "GRMRA EQU >9802"
  • p416. 24.4.8 Change the second line to "NUMREF EQU >200C"
  • p420. 24.5 (Add the following.) NOTE: A program to be saved using the SAVE utility should not have an entry point defined on the END statement. If you want to save the Tombstone City game in memory image format, you must first change the last line from "END START" to "END" and then reassemble the program. Otherwise, the game starts to run as soon as it is loaded, and you will not have a chance to execute the SAVE utility.
  • p465 Index VDP Write-Only Registers: add page 267 to references