Article 34914 of comp.sys.cbm:
From: pbg@hk.mobitel.telia.se (Pontus Berg)
Newsgroups: comp.sys.cbm
Subject: The actual text, so prevent mixing it with a letter!
Date: 17 Mar 1995 04:14:50 -0600
Organization: UTexas Mail-to-News Gateway
Lines: 494
Sender: nobody@cs.utexas.edu
Message-ID: <72011171305991/261166@RHK>
NNTP-Posting-Host: news.cs.utexas.edu

------- Forwarded message

Date: Fri, 17 Mar 95 11:10:23 +0100
Subject: c:\tmp\xass.txt

TurboAssembler - The full documentation!

After the release of XMem Ass we've had a lot of queries about the features of
it. I've found that A LOT of the users, and even the kewles ones, know very
few of the vast range of features the original TurboAssembler can bring.
Therefor I decided to type those docs in for you! First the docs for the
normal 5.2 version:

Most functions are activated through the * (left arrow) followed by an other
key. (Note that some of them are CAPITAL letters, meaning you have to press
shift along with it!). All commands below need to be preceeded by g

1	Back to basic
2	Separator line
3	Assemble
4	Print (? - print, name - to file, ' - To Screen)
5	Produce object file (ass to disk) Be careful: The * doesn't work a second
    time here!!!!
6	Input part of the memory as data!
7	Set tab (Cursor pos after Return)
8	Position of mnemo column.
q	Cursor to the left edge
w	Write as SEQ file (Save)
e	Enter a SEQ file (Load)
r	Replace: ... By: ... Finds the first occurance.
t	Executes first replace (See "r")
y	Executes ALL replaces. (See "r")
u	List labels (? - To Printer, Name to disk, ' to screen)
i	Initialize memory (Zero fill unused)
o	Change colours
p	Protect file (Enter an EOR for the file - Stupid!!! Some versions had $33
    as default. Beware!!)
@	Diskstatus
*	Directory
+	Additionroutine
-	Subtractionroutine
*	Put row in the line buffer
v/#	Insert buffer (See *)
a	Enter controlcodes (Abort with *)
l	Load file in PRG format
s	Save file in PRG format
d	Diskcommand
f	Find: ... (See "H")
h	Hunt next (Define with "F")
g	Goto mark (See "M")
j	Hexdump specified memory area
k	Redefine F3-F6 (followed by the key you wish to redefine).
:	List marks
c	Coldstart (Like "NEW" in basic)
v	Memory map (DON'T use with Action Replay as the LDA $DE00 hangs the 
    computer!!!)
b	Block command (A block must be defined with the "M" command first). You can 
    from here copy, write to disk, kill or save out the section previously
    defined.
n	Go to specified line in the source
m	Set marks (0-9 for bookmarks, S - Start of block, E - End of block)
=	Join lines (Hard to explain! Try!)
Return	Insert a line (undo "=")
;	Kill mark

L	Load data at address (return at question loads at the files default address)
S	Save data at address
F	Fill memory (specify range)
K	Keyclick on/off (yuack!)

F1	F-key reset (undo "*"+"k" edits)
DEL	Delete line
/	Delete the data the rest of the line, after the cursorposition. (Very
    useful to delete crap from resource files!)
INST	Line insert ON/OFF


To insert a "*" (left arrow), just doublepress the key!

F-Keys
F1	One screen up
F2	Go top
F7	One screen down
F8	Go bottom

The F3 - F6 are redefinable. If you find another "kewl version", it's almost
always only new F- key definitions they've added. Normally, i.e. they are
something like:

F3	.WORD/.TEXT/DIR  (Either of 'em)
F4	Assemble and start
F5	.BYTE
F6	Delete current row


Without other previous keypresses:

Inst	Insertmode ON/OFF (ie insert or overstrike)


Pseudo opcodes

.BYTE <parameterlist>

f.ex:

.BYTE "p", $ab,%100011001,49,&19

Enter data. Either within quotes (only one character), as hex ($E0) binary
(%10001110), decimal (45) och octal (&34). Separate numbers with commas.

.WORD

f.ex:

.WORD label, $1000, label+$f8/2, *-9

Enter 16 bit/2 byte address in the normal 6502/6510 way, i.e. lowbyte,
highbyte. Any label and expression is valid!

* = $XXXX

XXXX is here the start for your code. Can be used any number of time, but
beware while assembling to disk ("*"+"5").

label	= myarse
borderco	= $d020
memptrlab	= *+3	;Offset from prgcount
andtest	= $213&127	;Logical AND
ortest	= %1000:$03	;Logical OR
lowtest	= <irqptr	;LowByte of sth.
hitest	= >irqptr	;Guess ?
screencol	= bordercol + 1	;Define label.

Calculations or absolute numbers work just as good.


.TEXT "Some text"

Enter some text in ascciformat. Beware that there is no obvious way of
entering pokecodes, but for this purpose I recomend my own method. Either AND
#$3F or:

Enter your monitor. Type the text to the screen and transfer it into a safe
place in the memory.  Enter TurboAss and insert the data with "*"+"6"

;

A comment for information purposes. Enter any comment after the semicolon.
Truely good for you when you want to understand the crappy, ununderstandable
code you produced when you were lame (last week! :-) or when you were too
smart for you to remember right now.

.OFFS XXXX

This is a toughie, that relocates the code. The value after the offs is a
value added to the *= value. F.ex. *=$1000 followed by .OFFS $0800 makes the
code land on $1800 and .OFFS $F800 makes it land on $0800. Inserting things
like drivecode, is a joy thanx to this feature, even if it could have been
done a bit easier to understand. The trick to make it work is this piece of
code:

label1

	*=$0400	;Start for f.ex. drive code

	.OFFS 0-(*-label1)

label2	LDA label2
	RTS

This will result in the code landing at label1 in memory (right after the rest
of your code!) and the code will be exactly as if assembled to $0400, so the
result at "label2" will be LDA $0400.


Versions:

The latest version we released is 5.2 . New in this one is just the
possibility to interrupt the directory listing with run/stop. Also you can
poke in the end of the code (near $CF00) thedevice you'd like to use. It took
some time to dig out all the hardcoded #$8's in the code, but here you go. No
memory left to add an input option (which is available in "X-Mem ass 3.3")


The X Mem assembler:

Coding is an art which can be heavily disturbed by insufficient tools, which
cannot do what you want them to. This was the feeling the FairLighters have
felt many times, while pushing our utilities to their outer limits.

As the Assembler and the ML monitor are the utilities we use the most, we
tried to improve them as much as possible. The  main problem is that having
the assembler, the source, music, data, graphics and so on on the memory makes
you realize that 64Kb isn't all that much.

To overcome these limits you can produce an assembler porting the code through
a cable (As Bonzai and Chromance did/do), but this requires an additional
machine. It can aslo be done on another machine like an Amiga or a PC. Never
the less, we all hate cables and we all hate not having enough room on the
desks, don't we?

The other way is to adapt the assembler into working with the 17XX expansion
memories.  This is the way we have chosen. XMem Ass is a system which removes
all limits you've felt before in your coding deeds. The XMem Asm 3.3 is so far
THE asembler for the C64. XMem Ass features the same commands as the original
TurboAssembler 5.2 (see above), but forther "*"+"p" (Protect). We've found
this command not only unnecessary, but also truly stupid!!  Beware of early,
unfixed,versions of the assembler. They might contain $33 as the EOR value.
(Read more on the subject "eor protect" later on in this text!)

All memory commands are now directed to the expansionmemory, rather than the
internal memory. So the fill, load, save, "*"+"6" datafetch and all the others
work on the bank selected. The assembler now uses two banks in the expansion
memory, called objectbank (for all the data and the code) and one called the
source bank, containing the source, a monitor (optional), the main assembler
and the 17XX communication routines.


Some new commands are supported: ("*" and the following characters. Note that
they are all shifted!)

M	Go to TronMon (17XX monitor)
P	Enter page for return routine. Default page in memory is $0800, but this
        is now changable.
B	Select objectbank. Default is 1.
D	Select diskdevice (From 3.3) 
H	Hunt for a specified label, NOT all the references to it.

Bankselect is for selecting which banks in the memory to use (default is
recomended!).  Default is bank 0 as source bank and bank 1 as object! Banks
from 0 to 7 are supported (512 KB memory). None of the FairLighters have any
bigger one, so we found no need for further expansions. Anyone with a 2 MB one
that needs support?

Page is the routine dumped into the object bank when you select "s" after
assembling! When you start this roiutine, you will go back to the assembler!
(The three bytes are NOP's, so it's OK to put it at $0800, even if the three
first bytes get destroyed at a reset here. You only make it back 6 cycles
faster by sys:ing 2051 ($0803)

More on TronMon later (special doc section for it!).


XMem Operation

Since the computer cannot address the Expansion Memory as TRUE memory (thus,
you can not LDA from it nor execute code in it) it is necessary to "flip" the
source and object banks back and forth when switching between the assembler
and the finished code. It works something like this :

*       When you start editing the source, the assembler, source, x-mem
	routines (and monitor ?) resides in the c64's conventional RAM. It
	also exists as "a backup" in xmem bank 0.

*       Upon performing any memory-using action such as loading, saving,
	filling and assembling, all access is redirected to the xmem, into the
	OBJECT bank (default is 1!).

*       When starting your assembled program, the assembler will copy the RAM
	to the SOURCE bank (0) and then copy the OBJECT bank (def.1) into the
	RAM, and then start the program. None of these actions will be visible
	to you, as virtually nothing has changed, except for the memory
	redirection. It is necessary though to understand what actually
	happens to be able to comprehend the following.

*       Along together with your Object Bank, a "return" routine has been
	transfered. To return to the assembler, you simply start this routine
	with a SYS, JMP command or whatever. The routine uses 1 page of memory
	and resides at the page specified by using the "*"+"P" (shift+p!!)
	command.

*       NMI is also automagically redirected to the "return" routine (Not on
	all versions!), so pressing RESTORE will also allow you to go back to
	the source bank. Once in the "return" routine, you will  be prompted
	to specify what to do with the current RAM bank.  The coded working
	here is the so called "return routine".

*       Pressing CR will send it back into the OBJECT bank, and everything
	will appear as usual.  You may want to save it in another location
	just to study the effects on the RAM after a crash or similar, without
	fucking the original object bank up. In this case just select a spare
	bank!  This is one of the biggest advantages of using the XmemAss
	system. Both the source and object banks are safely protected inside
	the xmem. (Remember to assemble once so the source lands in bank 0).
	If something was to destroy the whole contents of your standard 64 K
	RAM, you would still be able to get it all back by copying it back
	from the xmem. If the RAM is so badly mutilated that even the return
	routine has gone bonkers, you may load it from disk. On some disks
	it's called "!", on some "xass(!)" and again on others "obj.transfer".
	It might be handy to have this one available on your work disks!

*       New features from X-Mem Ass 3.3 are the ability to select your
	workdevice, to something else than 8. It took Tron and me (Bacchus)
	some time to hack all the hardcoded 8's, so we know why it wasn't done
	before on any version!

*       Also the new main advantage: We had some trouble as Tron's first
	TurboAssembler was a 5.0 with the EOR code set to $33, and this wasn't
	found until MUCH later. Swapping sources got to be a pain in the arse,
	as we had removed the "*"+"p" option and therefore had to convert them
	by loading some old and normal version of the assembler.

	We got fed up with this! I coded a EOR hacker, a few weeks ago.  This
	program gave the correct EOR code  for the file, if it had the tab set
	to $09 (99% of them have!). From this idea Tron built in his
	implementation of the same idea, but he did a more advanced one.  (As
	usual, he wanted to brag ... =o) This new feature will AUTOMAGICALLY
	deprotect the source you load, and it will base it's guess of the
	EOR-code on the macro on F6 (99.9% have row delete here). You can see
	the EOR code used while loading! All saving will be done with a $00
	EOR.

*       Also, the DIR routine is now also interruptible. Pressing R/S halts
	the output!


TronMon 2.0

First of all:

TurboAssembler is a heavily MODIFIED version of the Omikron original program.
TronMon is on the other hand FULLY coded by Tron of FLT, for use with the Xmem
Ass package. It's mainly a normal monitor, inspired by the one in
ActionReplay. Mind one thing first:

You may use either commas or space to separate the arguments for the different
commands.

Eg :	s "pelle",8,0800,4000
	s "pelle" 08 0800 4000
	s "pelle" 8 800 4000
	s "pelle",8 0800,4000

These four examples do EXACTLY the same thing. Note the possibility to MIX
the spaces and commas, and also the option  to ommit the leading zero(s).

I have the complete list of command for the 1.1 but the 2.0 ones I was in
suggesting but never got any real docs from Tron. These are command I hacked
out myself. Don't expect this list to be complete in any way!

Commands:

O       Bankselect. All operations are made to the bank you are currently in,
	unless differently stated! Banks from O0 to OEF are supported. OFX
	means internal RAM with the X value in $01 at the operation.

A	Assemble. eg
	A1000 SEI

D	Disassemble eg
	D1000 (2000) (D1000- is not implemented yet)

M	MemoryPeek. As the D for the options!

I	Screencode interrogate. (Works as I* in AR).

IZ      Show all bytes but for the zeros. Very handy for scanning the
        zerofilled memory for small pieces of data.

	IZ 1000 2000

	Mind that IZ 1000 and scrolling up and down is not a valid option. 

L	Load eg

	L "FOOBAR" 08 (1000) (3000)

	The last option is for the load to brake at a certain point, if you
	just want a part of the data.

S	Save (Remarkable, isn't it?  :-) Eg.

	S "FOOBAR" 08 1000 2000

	This command is notorious for sometimes missing the end and this is
	not a bug Tron has fixed yet. However, you can press RunStop to abort
	the saving, which will properly close the file at the address is was
	while pressing.

H	Hunt eg.

	H 1000 2000 10 (20 30 40 50)

	No more than 8 bytes and no text yet!

T	Transfer ex. T 1000 3000 -4 6000

	This transfers in memory and also between banks. The number after the
	- selects the destinationbank. Default is the current. It now works to
	transfer both upwards and downwards in the same bank. At last, Tron!!
	:-)

F	Fill memory eg.

	F 1000 2000 00

C	Compare. Same syntax as T, which enables comparisons between banks!

N	Number conversions! eg.

	N $FCE2

	BIN convert bug removed! Also, the monitor quits if you don't send a
	parameter.  Ooops! ;-)

@	The alfa sign for DOS commands eg.
	@ -  Read channel
	@X - Switches to device X (100%)
	@$ - Directory (Only $, also!) Dir now features pattern search
	eg.@$o.* or $pelle*

	Since V2.0 we also have blockcommands available.

	@BR 12 01 C0
	@BW 12 01 C0

	This is standard Action Replay syntax! Mind that if the program finds
	a link to another sector, the command to read this sector is generated
	for you!

G	For GO

	This command uses a routine, a dwarf of the assembler's "return"
	routine, you might say. It resides in $0380-$0400 (easy to
	destroy..).  The BRK vector and NMI vectors are automatically set to
	$0380 and also the adress is pushed onto the stack for RTS. The
	routine provides no selective storing, it will simply copy everything
	in RAM back into the bank that you jumped to. Unfotunately still
	rather buggy!

E       EOR an area with a specified value. No option to EOR with a mask from
	another area is implemented.

	E 1000 2000 33

R	Shows the current resisters.

*       RAM/ROM mode. If you have selected internal RAM using the O command,
	this will switch between F0 and F7... (I.e. $01 set to either $30 and
	$37)

X	For Exit

	Detects if the Assembler is in the memory. If yes; go to the assembler
	or else do a warmstart.

IN	Increases a range

	IN 1000 2000 08

	This command adds 08 to all bytes in the range. You expected a DE
	command?  You won't get it! The reason is very simple:

	IN 1000 2000 F8

	This subtracts 08 from every byte in the range!

LS	Load Seq file.

	LS "name" 09 1000

SS	Save Seq file.

	SS "name" 08 1000 2000

LL      This is a VERY kewl command. List Labels! It checks the labletable for
	the results of the most recent assembly.

	LL ir

	This lists all lables starting with the string supplied, and also the
	value they represented during the last assembly. This above MIGHT
	result in something like;

	IRQ =$EA31
	IRQLO = $0314
	IRQHI =$0315
	IRQOWN = $1008
	IRINA =$FCE2

	You could swap to the XAss system for this feature alone!

FM	Memdump from a file.

	FM filename ,08


Known bugs

There is a problem when you assign a label to a zeropageadress in some cases.
I'll fill in more here later. Sorry for the lack of information.

Final words

That was all for this time, dudes!

If you have suggestions for improvements of if you have found that these docs
have been wrong or uncompleat in any way then do not hesitate to send me a
letter

The current adress is:

Bacchus of FairLight
Pontus Berg
Sveavagen 88, 5tr
113 59 Stockholm
SWEDEN

or call:
SWE +46-(0)8-6125464

E-mail:
Bacchus@FairLight.Com

These docs were fully typed in by Bacchus of FairLight in my very own
texteditor, Eddie Delux. Converted to the PC, and printed out at work!

As you might notice a 2.0 version of TronMon is present. I'll update the docs
as soon as I find the time! There are quite a few new commands, but mainly is
can't be run without an X-mem, but the advantage is SPEED! You fill a bank in
.5 secons, for example! I'll update soon! Also try the LL for List labels!

FairLight#1

------- End of Forwarded message
