SOURCGEN Re-assembler for Atari 800 XL

ATARI HOME
Introduction
Definitions
Disk Contents
Starting SOURCGEN
Symbol-Table & Editor
Generating Source Code
- from an SMB file
- for the ATARI OS
Creating SMB files
The Function Keys
The Functions A - U
A. ADDR/symb search
B. BYTE-change
C. CODE-search
D. DELETE symbols
E. EDIT
F. FILE
G. GO
H. HEAD
I. INDEX
J. JUNK?
K. KEY (0..9)
L. LIST symbols
M. MINIMUM-label
N. NEW
O. OBTAIN symbols
P. PREPARE labels
Q. QUIT (1)
R. RE-ADDRESS
S. SAVE symbols
T. TRACE
U. UTILITY (V. 3.2)
The Fram-disk
Output Menu
Error Messages
Reference card
New in V.3.2

New in SOURCGEN V. 3.2

SOURCGEN V.3.2 requires an XL or XE ATARI.
Here is a list of the most important new features:

  • Ram-disk in the free RAM under the operating system. The ram-disk can be used independently from SOURCGEN.
  • Several commands can be combined and executed with a single key stroke.
  • Automatic recognition of Double-Density-Diskette formats under TURBO-DOS and thus the support of 256K ram-disks.
  • Any disk file can be read. (SOURCGEN Version 2.01 only reads Load-Files.)
  • Fast search function.

The Fram-disk: not just for SOURCGEN users

If you've been using the SOURCGEN re-assembler without a ram-disk, you know how much stress this program can put on a disk drive. If SOURCGEN is creating a source code listing to a file and writing it to the same disk, the read/write head of the disk drive must continually shift from one file to another. Even if you have been using a ram-disk you will have encountered the problem that SOURCGEN will only read from a file that exists as a continuous block on the disk. You may sometimes have had to first copy the file to an empty disk before you could work with it.

To solve this problem, the special ram-disk "FRAMDISK" was created. FRAMDISK uses the free RAM under the XL operating system. This is 14K in every XL and XE ATARI which due to its relative inaccessibility usually remains unused. We will call the ram-disk created by the program FRAMDISK the "Fram-disk ".

FRAMDISK has been kept short and simple. The Fram-disk is accessed using "F:" in the same way as a disk drive. It can contain just one file and thus needs no name other than "F:" (though in TURBODOS you must give it a name.)
Copying a file into the "Fram-disk" will obviously delete the previous content.
FRAMDISK has been written to be used not just by SOURCGEN users. It is an independent program which can be used from the DUP of DOS 2.x or TURBODOS and by other programs

FRAMDISK contains the most important routines used by disk oriented programs: OPEN, CLOSE, GETBYTE, PUTBYTE, NOTE and POINT.

FRAMDISK resides in RAM at $540 to $573 and $600 to $6FF.

Under SOURCGEN the Fram-disk remains intact after pressing <RESET>. In all other cases, the Fram-disk can be reactivated after a reset by a jump through $600 (JSR $600). The content of the Fram-disk remains intact.

If you want to use the Fram-disk without SOURCGEN, you need only load the file FRAMDISK to initialise the Fram-disk !


A New Menu iten for SOURCGEN

When you load SOURCGEN V.3.2 you will see the new menu item U. UTILITY.

The U. UTILITY function serves two purposes:

  • You can enter a chain of commands.
  • the use of the Fram-disk

Command Chains

After hitting <U> you can enter any command chain by using the following syntax:

/;<COMMANDCHAIN>

The command chain will be executed by hitting <RETURN> and can be repeated any time by hitting <@> (<SHIFT-8>).

For example, entering /;FD:FRAMDISK^OD:FRAMDISK^P540^H540 6FE/F: will do the following:

The file "FRAMDISK" is opened.
The corresponding symbol file is loaded into memory.
SOURCGEN prepares the labels.
The source code is written into the Fram-disk.

The character "^" is interpreted by SOURCGEN as "<RETURN>".

Command chains can easily be entered into the symbol table and then saved as an SMB file. You can use the addresses $100 to $1FF for this; since the 6502 stack is located in this address area, it is unlikely that there will be any normal symbol entries there.
Using a symbol, you can give the command chain a name. The actual command chain begins after the ';'.

To call an already existing command chain:

  1. Use the A or L function to list the command chain on the screen.
  2. Hit <U>
  3. Move the cursor to the line of the command chain.
  4. Hit <RETURN> to execute the command chain.

Hit <@> (<SHIFT-8>) any time to re-execute the command chain.

You might wish to save all your command chains to the AUTOLOAD.SMB file so that they will always be accessible immediately after loading SOURCGEN.


Using the Fram-disk

After hitting <U>, you can enter a command with the following syntax:

[<SIZE>]/[FILENAME]

Type the name of a disk file and hit <RETURN>. The file will now be copied into the Fram-disk .

By entering a value for <SIZE>, you determine the number of double-density sectors in the ram-disk . (A double density sector comprises 253 ($FD) Bytes.)

Entering a value less than $39 or entering nothing at all will cause the size of the ram-disk to be $38. This corresponds exactly to the free memory under the operating system (from $C000) and suffices for a file with 113 ($71) single density sectors. (A single density sectors has 125 ($7D) bytes.)
E.g. To load the program TURBO-BASIC (that's 145 ($91) sectors on disk) initialize the Fram-disk with $48.
( By the way, Turbo-Basic will not run with FRAMDISK because it too uses the free RAM under the operating system. )

If no file name is entered the last file opened using F. FILE will be loaded into the Fram-disk.

When a file is loaded, the start address of the Fram-disk is displayed. $BC00 to $C000 remain unused since this is usually the location of the Display List and the screen RAM.

If you simply want to set the size of the ram-disk without loading a file, just enter <SIZE> followed by the character "/".
Do this when you are creating a large source code listing that you wish to assemble with ATMAS-II. Use the H. HEAD function of SOURCGEN to write the source code directly to the Fram-disk . Then quit to DOS, load ATMAS, and from there type "<ESC>RF:<ESC><ESC>" to load the source code into ATMAS.

A larger text buffer for ATMAS-II

When using ATMAS together with SOURCGEN it may be a good idea to configure ATMAS-II to have a larger text buffer. For this the following ATMAS addresses are important:

$38CD: copy register - begin ($60)
$38CE: copy register - end ($64)
$38CF: text buffer- begin ($64)
$38D0: text buffer- end ($A8)
$3695: U-function - jump address ($A8)

The numbers in brackets are the original values. Thus the text buffer usually occupies the addresses $6400 to $A800.
Use the BYTE-change function in SOURCGEN to change these values directly on disk. Try the values $24,$28,$60,$AA,$AA.
This increases the size of the text buffer by 6 pages (6 times 256 Bytes) to $4A00 bytes.

If you use SOURCGEN to initialize the Fram-disk to $4A, you will see that the begin address of the Fram-disk is $AA00. Thus via the Fram-disk you can easily transfer a listing of length $4920 to ATMAS. Of course you must not try to assemble the listing as usual at $A800 but at $AA00, (and don't be surprised that the content of the Fram-disk initialized with $4A will then be lost!)

SOURCGEN now reads any type of file.

F. FILE

<NUM> <ADR1> [<ADR2>]/D<x>:<FILENAME>.<EXT>

Any disk file is opened. <ADR1> is the start address. The value for <NUM> is unimportant but a value must be entered.
Hit <RETURN>. SOURCGEN reads through the file and then displays the appropriate end-address. If you are not using a ram-disk you should make a note of the end-address. The next time you open this file you can also enter the end-address <ADR2>. Then SOURCGEN will check the end-address without first reading through the whole file. Entering an incorrect value for <ADR2> will cause an error message.

This option can be used when a machine language program is not in the form of a load-file. Sometimes a larger file will be loaded into RAM by means of a small loader program. Only the loader program is in the form of a load file. In this case, you must find the address (<ADR1>) of the main program by first investigating the loader.

<NUM> <ADR1> [<ADR2>]

The file name need not re-entered when you repeat the function.


Quick Search

C. CODE-search

<ADR1> <ADR2> <WORD> /W

Searches from <ADR1> to <ADR2> for the double byte <WORD>. This function is much faster than the other two CODE-search functions because it does not take into account the way the code is displayed.


Improved HEAD function

The H. HEAD function now works correctly when the address range of a load-file spans several segments. Let us assume for instance that the following segments are displayed when a LOAD-File is opened:

4DOO 4EOO  1
2E0  2E3   2
2200 4C07  3
600  6FE   4
540  573   5
5100 54CD  6

When you use H. HEAD you can now enter 600 573 as an address range.. It doesn't matter that the second address is lower than the first. (The same applies to the functions P. PREPARE labels, G. GO and J. JUNK?)

<ADR1> <ADR2> A/D<x>:<FILENAME>

The "A" after ADR2 causes the listing to be saved as an ATARI ST or PC-compatible ASCI-file.

 

E. EDIT

<ADR1> [<ADR2>]/<CHAR>

From address <ADR1> the code will be displayed according to <CHAR>.
The characters "(" and "." are new in SOURCGEN V.32:

(   :Normal code. E.g. LDA #LABEL
     where LABEL <= $FF and represents a constant or a zero page address.

.   :ASCI Listing (for viewing ASCI files.)


New Function Key

<SPACE> lists the next line.