
Operation book for

ATMAS - II

A macro assembler, editor
and machine language monitor
ATARI computer 400 / 600XL / 800 / 800XL
and Atari 130XE
with disk station and minutes. 48KByte RAM

The programs, diskettes and instruction manuals
the ATMAS-system
are Copyright

Ing. W. Hofacker GmbH
and
Dipl.-Ing. Peter Finzel

Any rights reserved



CHARGING INSTRUCTIONS
=============

1) Remove any plug-in modules from the
Cartridge slot of your ATARl computer.

2.) Turn the floppy disk drive and the
TV (or monitor) a.

3.) When the red LED of the disk drive
has gone out, place the floppy disk containing the
Inscription at the top and the oval window to the rear
in the drive. Close the door of the
Floppy bay.

4.) then Turn on your ATARI computer. at
XL models must during turn the
OPTlON button must be pressed.

5.) ATMAS-II is now loaded, after a short time
appears the bias, then notify the Editor,
charging is completed.

If the message 'ATMAS-II requires 48K memory'
appears, so there are several options:

a) There are still plug-in modules in the shaft.
b) OPTION has not been pressed (only for XL).
c) your computer has insufficient memory. ATMAS-II
requires at least 4BKByte.

FURZBEISPIEL FOR DEMO PROGRAMME
==============================
 
If you are in front of the reading of the operating
hand book short a demo program of ATMAS-II system
To view, so you can do that with the following
reach commands:

<ESC> RD: DEMO <ESC> <ESC> (Demo program is loaded)
<CTRL> -Y (program assemble)
<ESC> (back to the editor)
(Start program) <ESC> U <ESCK <ESC>
(End Program) <START>
Note: Press the Escape key <ESC>.
<CTRL> -Y hold Control key and
the 'Y' key.



INTRODUCTION
==========

ATMAS-II is a powerful development system
for machine programs on your Atari computer.
ATMAS-II consists of three integrated subsystems:
Editor, macro assembler and machine language monitor.
These components together provide for convenient
and rapid development program at the machine level.

All three parts of this integrated programming environment
match and only a
Keystroke away from each other. A comfortable,
screen-based editor that we Features
Copy-registers, repeatable command sequences and
space-saving genuine tabulators has facilitated
the input also extensive programs. The macro-
Assembler is working to achieve a shortest
possible Assemblierzeit with modern hashing
Algorithms, so that longer programs in a few
Seconds are assembled. Finally lhner stands
as a tool for testing of machine programs
Monitor.

Although someone who has never been in Assembler
has programmed quickly familiar with ATMAS II feel
is, it offers the user many advanced
Options: starting at the powerful
Editor functions to programming
Macro commands.

It should be noted that this
Users Manual no textbook of 6502
Machine language is and also can not be.
Reference is made to further reading,
in particular in the autumn of '85
upcoming book by the author of this operating
hand book, specifically on the Atari computer
tailored. In addition, also provide the
Examples in Part 4 of this handbook a small
Insight into the assembler programming
Atari computer.

Part 1: THE EDITOR
==================

When ATMAS II Editor is an image-
screen oriented editor that without any
Line numbering manages, essentially
similar to a word processing system behaves.
This eliminates the tedious entry of LIST
Commands like these from various other
Editors know (eg in BASIC). you can
simply with the aid of the cursor keys to scroll through the
Moving listing, which then from top to bottom or from
bottom to top scroll through the text window.

1.1 Using the editor
-------------------------

Once ATMAS-II has been loaded from disk,
giving direct access to the editor that were, the
Control Center is the ATMAS-II system. From
here you can the macro assembler and the
Calling machine language monitor, also brings
the <RESET> key always returns-in the editor.

After booting you will see the following screen
Mask Editor see:

         + --------------------------- +
         IP: 00000 T: 17408 C: 1O24 OK I <--- Status Bar
         + --------------------------- +
Cursor -> ICI
         II
         I text window I
         II
         II
         + --------------------------- +
         I .......................... I <--- commandline
         + --------------------------- +

The status bar
---------------

In the status line you are constantly information
on cursor position, free Textspexcherplatz,
communicated Kopierreqister and editor state.

From 'P: nnnnn' can be the distance (in characters)
remove the cursor from the beginning of the text, 'T: xxxxx' are
wages sent information about the free text space,
(Ie you can still max 'xxxxx' attacks
enter). 'C: yyyy' provides information on the free
Storage of the copy register (the so-called.
C register) of the still unused state 1024
includes characters. The last two characters of the
give status line wages sent a status message of
Editor again, if everything is in order, you will
find there '0K'. Any error or status
messages (eg when the copy tab is open)
be spent there, a list of messages
See Appendix B.

text window
-----------

The next 21 lines make up the text window here
you always see the current text you in the
Edit following discussed editing
can. In literally is this image
screen part to understand as a window in the text,
inter alia, with the cursor keys up and down over the
Text can be moved. All editing functions
are reflected in the text window.

command line
-------------

The letze line of the screen is for entering
reserved commands. Besides a number of
Direct commands directly in the text window
are added, there is additionally a
Command Mode of the editor of the <ESC>
is called. Here are usually commands
entered, the need additional information, eg
a word, is to be sought after. Even commands
Input / output of text to be entered here.

1.2 Text Input
---------------

They may be the same without assigning row numbers
start entering the text. Each typed
Mark is placed at the current cursor position
and the cursor moves one position to the right.
You can at any time a new row (RETURN)
begin. Rated more than 38 characters in a row
Enter, the cursor disappears from the right
Screen once you dive press (RETURN)
this again at the beginning of the next line. This
Behavior seems at first glance unusual,
However, you will soon find that it in
Assembler programs is quite advantageous. Of the
is essential part of an assembler program
always in the first 30 characters, because there the.
Assembler instruction can be found. Nominal you longer lines
want to edit (for example, the comment field), so have
To do this, a special function available (<CTRL> -V,
see 1.2 / Special functions), the maximum of 76 characters
is in two lines on the screen. you will be
However, notice that the normal
38-character screen much better for editing
is assembler programs, since all assembler
dictate contrary to the two-line mode uninter-
broken with one another are.

As usual, all keys have automatic re-
holfunktion, lowercase letters with the <CAPS> -
Button can be achieved.

1.3 editing commands in text mode
-------------------------------

As mentioned above, offering them the ATMAS-II
Editor two different levels of command entry.
The simpler of the two planes form the so-called.
Direct commands or commands in text mode
called. These commands are either
Special keys such as <BACK SPACE), or by
run control functions. The latter means-
simply that the <CTRL> key (For 600 / 8OOXL:
hold <CONTROL>) key while another
Press the key, very similar to how you in
ATARI BASIC move the cursor. So if you in
following <CTRL> Read -X, so this means that you
hold <CTRL> depressed, while the 'X' button
to press.

Cursor control
----------------

In text mode, you have the cursor functions
available:

To move the cursor to the right, press

	<CTRL> - <Right Arrow>

A Cursorbewequng left occurs with

	<CTRL> - <Left arrow>

If you are doing on the right end of a line
arrive, so the cursor to the beginning of the will
next line set. Drive on the left
End, then the cursor is at the end of
previous line.

To move the cursor up tap

	<CTRL> - <Arrow up>

The cursor will turn into, if it is not already on
left margin is, there first reset. In
this case leads only the second keypress to
above.

The cursor can with

	<CTRL> - <arrow down>

a line down to the beginning of the next
Line are set. All cursor movements
You can not start and end of the text
addition. Unlike other editors, you are
notice that the cursor does not run over the text,
but is inserted. This has the advantage that
You always know exactly where are actually inserted
can.

delete character
---------------

To delete a character to the left, press

	<BACK SPACE>

When the cursor is located at the beginning of the line,
then the return character is deleted, ie the line,
which housed the cursor is at the previous
attached. If this was a blank line and thus
only a return character was, the
Blank line deleted.

To delete a character right of the cursor tap

	<CTRL> - <BACK SPACE)

as in the above case, so that also the next line
be attached under the cursor on the current.
Is this a blank line, so it will be deleted.

Clear lines
--------------

If you want to delete a row, then press

	<CTRL> -X

The line from the current cursor position to
deleted beginning of the line. If the cursor
already at the beginning of a line, so is the whole
previous line deleted.

Cursor jumps
--------------

	<CTRL> -E takes you to the beginning of the text
	<CTRL> -D will bring the end of the text

tab
---------

The ATMAS editor features a real tab,
the space occupied to 9 depending on the requirements 1,
but has been saved only as a sign. in order to
tap to enter the next point vortabulierte
simply

<TAB>

If you later on such a tab with the
Move the cursor, you will notice that the cursor
it 'jumps', and also before a Einfqungen
Tnbulator the following text does not move.
The Tahulator is stored only as a sign,
so that you so easily readable Listings low
can customize Speicherplatzhedarf.

Copy register (C register)
----------------------------

The C register is a second, larger 1024 characters
TextBuffer you for transferring and copying
can use text parts. Position first
to moving the cursor on the lower end of the
Text part, then open the C register with

	<CTRL> -R

The left part of the status line is this state
the message 'CR' detained. Nominal now the
Move the cursor backward, so are the uncrowded
Parts of the text written in the C register. You can
following this operation in the status line with that
Number of free characters in the copy register ( 'C: 1O24')
decreases with the number of cursor movements.

Located yourself of all of the desired text in
C register, connect this with the command

	<CTRL> -F

Now you can copy the contents of the register
use any cursor position by

	<CTRL> -J

enter. The contents of the C register we not present
destroyed, that there are also comfortable multicopy
possible. Delete the copy-register with the
command

	<CTRL> -K

possible. The C-register is automatically by calling
the assemblers as well as an I / O command
closed.

A few comments on the C-register: You can
thus parts of the text to prepare for copying if you
this backward with <CTRL> - <Arrow up> or
<CTRL> - through <left arrow>. equally possible
You transfer blocks of text by cursor to
by the erase commands <BACK SPACE> and <CTRL> -X
move backward. The deleted text will remain in
Copy-register and can in any other place
be reinstated.

You can also buy a block of text from different
Text parts composed by the C register at
various passages opened several times and
is closed without intervening its contents with
<CTRL> -K delete.

Is the C-Reglster full ( 'C: 0000), indi- cated at
additionally on the top left, the error message 'C?'.

Special commands of the editor
--------------------------

The two-line mode, you can

	<CTRL> -V

turn on. Thereby lines longer than 38
Characters are shown on the screen with two lines. The
maximum line length, this mode is therefore 76
Mark, although shown only 11 lines
can be. Another <CTRL> -V puts you in the
normal one-line mode.

Control characters, especially Tabs and Return
Characters with

	<CTRL> -T

be made visible. are all control characters
'Reverse' is shown. Another <CTRL> -T switches
in the back normal mode.

	<CTRL> -G

used to repeat the in the command line
standing chain of command. Please read section
1.4.

Calling the assembler and the monitor
--------------------------------------

The ATMAS II Makroassembler is

	<CTRL> -Y

called. ATMAS-II will immediately start with the
Assembly located in the TextBuffer
Source code (see Section 2), after completion of the
Assembly will take any keystroke in
the Editor.

The machine language monitor can Duch entering

	<CTRL> -P

be called. He responds with 'MONITOR.' and
expects your input (s. Section 3). Back in the
Editor can be reached by typing 'E'.

1.4 Command Line
=============================

Apart from the direct commands in text mode has the
ATMAS II Editor via another powerful
Editing! The command line. You are here
primarily find commands that the except
actual call of the instruction further details
need, wanted about a string after
shall be. Furthermore, you will find some commands
find that you know from the text mode ago, this
but can in command mode with repetition factors
be provided and linked, a type of
'Command macros'.

Using the command line
---------------------------

You enter the command mode by pressing the <ESC>
as dollar sign ( '$') is shown. Now
you can individual commands (see below) Enter
while the <ESC> key to use as a delimiter.
The command line is executed as soon as you <ESC>
twice Press succession. Execution
with a hash mark behind the chain of command
acknowledged, you are then again in
Text mode. If the command line as
have proven faulty, you will in the
upper left corner indicated by an error codes.

All commands (except for the I / O commands R and W)
can preceded by repetition factors 2 to
be executed 255 times. In addition, a
complete repetition of an input
Command line carried by the text mode, press <CTRL> -G.

Errors in the command line itself can
be corrected <BACKSPACE). <CTRL> -X leads to
Delete the command line and return to the
Text mode.

Editing in command mode
----------------------------------

B: cursor one back
Q: cursor one forward
Delete one character to the left ': D
T: delete from the cursor to the beginning of the next line d.

These commands example is a fast cursor
Movement in the text possible. ffenen the command
line with <ESC> and enter '200F' followed by
twice <ESC>. Each repetition of the command line with
<CTRL> -G brings you now 200 characters in the text buffer
continue.

Other editing commands:
-----------------------

H <hex bytes>: insertion of any ATASCII codes
		in the text, for example, to the printer controller.
		EXAMPLE: $ $ H0F on EPSON printers
			  on Engschrift

S <String>: Searches for the string (string) from
		the current cursor position to the
		End of the text. If not available,
		appears 'S?' in the status bar.
		EXAMPLE: $ SLabel $ searches for word LABEL.

<String>: Sets string <String> on current
		Cursor position. Can relating
		with the S command to search and
		expanded exchange function (see below).

special features
-----------------

J: Repeats the entire Rommandozeile.
		For example you can search and a
		Exchange function to the end of text re-
		Get.

K: Deletes all text buffer.
		CAUTION: The entered text is
		deleted!

U: USER command. Gets a machine program
		which must be in memory at $ A8OO, per
		JSR Belehl on. CAUTION Use only
		if you are also a program there
		have.

@ <N>: Sets the tab width to <n>
		Sign (n 0-9). Without specifying
		a width of 8 is used.
		EXAMPLE: $ @ 6 $: tab size 6 characters.

M: Return to DOS. With 'B' - '* ATMAS-II *'
		join back in ATMAS-II.

Two more commands that affect the C-register:

E: Deletes C-register (as <CTRL> -K) _
Insert C register in text (<CTRL> -J): G

Commands for input / output of text
---------------------------------

If you are an in-TextBuffer Text
want to save disk, you can copy the
'W' do-command. You only need to
desired name of the file with a device description
Specify drawing.

Example: You want the current text under the
Save names TEST.SRC to drive. 1 Add
The following entries:

<ESC> WD1: TEST <ESC> <ESC>

The extension is added by .SRC ATHAS itself,
You can of course also another
Specify extension, about $ WD1: TEST.ATM $ <ESC>.

CAUTION: The text is always in the STARTING
listed ========= current POSITION THE CURSOR
		distinguished. Therefore always to store
		the whole text before <CTRL> Enter -E.

On similar Heise You can use a text file of the
License disk into memory. Given the command
'R' is used, which is as 'W' is used.

Example: Loading the demo files from the DEHO.SRC
ATMAS-II disk (in Drive 1):

<ESC> RD1: DEMO <ESC> <ESC>

The Extender .SRC will turn automatically angehng
The file will now be starting at the current
Cursor position is read. This results in two
Possibilities:

1) When a new file is to be loaded, then
delete previously the TextBuffer previously with <ESC> K
<ESC> <ESC>.

2.) You can also individual files in text
buffer paste (similar to the copy-registers), by
Move the cursor to the desired location and
then enter the load command.

If during an I / O command errors
to be shown in the status bar by the message 'RW'
displayed.

listings
--------

Printouts of the code can use the 'L' command
getting produced. There are several options:

'L': Listing scrolls across the screen
'L0': Output to RS232 port # 1 of the 850th
	interface modules (R1 :)
'L1': Output to the normal Printer handler
	'P', so as a rule on the Atari 850
	interface module.
'L7': Listinq is Centronics interface from
	the joystick ports 3 and 4 output. These
	Possibility is only 400/800 computer.

Notes to Editor advanced use
----------------------------------------------

The possibility of command chaining in the command
line allows very comfortable editing tools:

	$ SLDA $ 3D $ ILDX $ J $ <ESC>

This chain of command would all LDA commands from the
Change cursor position in LDX commands. As
it works? First, an LDA instruction is wanted
($ SLDA), the cursor can then be behind the
this string think stationed. '$ 3D' now deletes
three character to the left (remember: The
Repetition factor!), While '$ ILDX the string' LDX '
uses. '$ J' in turn causes the entire
Command line is executed until the text to
End, ie a 'south' - error (string not found)
occurs.

Part 2: The macro assembler
===========================

2.1 Use of macro Assembleres
----------------------------------

From the editor, the ATMAS-II Macro Assembler is with

	<CTRL> -Y

called. It begins immediately with the Assemblie-
tion of the source code of the in TextBuffer
Editors must be located.

The assembly is in three passes (so-called.
passes), wherein the second passage his
Activity by a rapidly changing signs in
the upper left corner of the screen displays. The third
Pass, a listing of the assembled program on
the printer or the screen output (s. OUT-
Directive).

The process of Assemblierens will continue as long
set until either the source code to the end is a
<CTRL> -Z mark is detected (assembler Stop
Mark) or an error has been detected. in the
latter case, an error message (s. Annex B)
displayed on the screen. Pressing any key
brings you back to the editor, and exactly at the
Body that has caused the error. You can
immediately improve the errors and the assembler
<CTRL> -Y restart.

This comfortable 'hand-in-hand' work between
Editor and Assembler is a key point of
ATMAS-II as a development system for Maschinenpro-
programs so powerful makes, and yet here the
Operation simple.

2.2 Input format of the assembler
--------------------------------

The ATMAS II Makroassembler knows all opcodes of
6502 CPU, as far as these in the 'MOS Technology 6502 pro-
ming manual 'are described. It follows in the
Notation of addressing modes of in that book
proposed notation (see below).

A Ouellteutzeile can have the following formats:

A) blank line:
-------------
It consists of only a <RETURN> character.

B) comment line:
------------------
Starts with a '*' in the first column.
Example: * Copyright (c) M. Huber

C) command line with label:
--------------------------

Begins with a label, followed by a separation
sign (space or tab), then a
6502 opcode or an assembler directive, finally
, an even for a further separator
follow comment.

Examples: LOOP LDA # $ 10
		DOSVEC EQU $ 000C DOS entry point

D) command line:
----------------

Must always start with a separator: To clean
to obtain listings, it is advisable to do this with
a tab starting allow. Then follows
6502 opcode or an assembler directive, as in
preceding case, also here according to a further
Delimiters are a comment.

Examples: <TAB> STA COLOR0 COLOR CHANGE
		<TAB> DFB 100,120,140

Addressing Modes:
-------------------

In the following a short Zusammeniassung of Cards
have the individual Adresslerungsarten, each with
an example is provided:

Implied battery <OPC> ASL
Immediate <OPC> # <EXPR> LDA # $ FF
Absolutely, Zero Page <OPC> <EXPR> STA $ 600
Relatively <OPC> <EXPR> BNE * + 4
Absolute X-indexed <OPC> <EXPR>, X CMP $ 3000, X
Absolute Y-indexed <OPC> <EXPR>, Y LDA TABLE, Y
lndirekt-indexed <OPC> (<EXPR>), Y EOR ($ F0), Y
Indexed indirectly <OPC> (<EXPR>, X) STA ($ F0, X)

<OPC>: Valid 6502 assembler command (opcode)
<EXPR>: arithmetlscher expression

As already mentioned, before each <OPC> a label
possible after each assembler instruction, a comment
stand, which is sold with a delimiter.
EXCEPTION: After implied battery commands the coming must
box, any be separated by a semicolon.

LABELS
------

Labels oestehen of letters and numbers, the
first character must always be a letter. The
maximum length is 8 characters, all characters
are significant.

Valid Labels: Invalid Labels:
--------------- -----------------
GRINDING 1LOOP
SCHLEIF1 GRINDING (9 letters!)
S12345

Constant:
----------

ATMAS-II has four types of constants: decimal,
Hexadecimal, binary and character constant.

A) decimal constant
---------------------
Existence simply from the number itself (in the range 0 to
65535).

	Examples: 10, 100, 3000, 65535

B) Hexadecimal constant
-------------------------
Consist of a dollar sign ( '$') and valid
Hexadecimal (O-9, AF).

	Examples: $ 10, $ FF, $ AB00, $ FFFF

C) binary constant
-------------------
Consist of a percent symbol with succeeding
valid binary digits (0.1).

	Examples:% 1,% 1001% 11110000

D) character constant
--------------------
If from an apostrophe with subsequent ASCII
(Or ATASCII) formed character. The characters are in
7-bit nerte converted (bit 7 is always zero).

	Examples: 'X,' # 'e,' "

Negative constant:
-------------------
All Vonstanten can by a preceding
interpreted minus sign as negative numbers
will. The depicted in a double
(-1: $ FFFF).

	Examples: -1, - $ 100, -% 101101, -'B '

Internal address counter:
----------------------

ATMAS-II leads during assembly a
internal address counter with which each of the Upcode.
the just translated statement showing (or on the
next available byte after the last calculated
Expression in DFB / DFW directives). This internal
Address counter may at any time by the '*' - symbol
be retrieved. This can result in a variety of ways
to be used:

A) space reservations:
	ORG * + $ 100 Reserved 256 bytes
B) relative jumps without a label:
	GNI * + 4 skips the next 4 bytes
C) Address Offset Labels for software Stackinq
	RETADR EQU * -1 current address minus 1

Expression:
---------

An expression can be a constant, a label, a
Macro parameters (see 2.4), the current address
Counter ( '*') or an arithmetic logic
thereof. Permitted links are: +, -,
*, /, The computing area is O-65535th Some
Examples:

	LDA # $ FF constant
	LDA # LABEL1 Label
	STA LABEL + $ A0 link
	LDA * + $ 10 Current Addr counter + 0ffset

In addition, also parentheses to clarify the priorities
ity possible:

	LDA # ($ A0 + 5) / 1O
	LDA # LAB1- (Lab1 / 256) * 256

2.3 assembler directives
========================

2.3.1 ORG
---------

Purpose: To determine the contents of the internal assembler address
		Counter.

Syntax: [<LABEL>] ORG <AL> [, <AP>] [<COM>]

Example: ORG $ A800

ORG determines the initial address of Dbjektprogrammes,
In the above example of the purpose for this is reserved
selected fourth storage area from Saboo.
In some cases it is not possible, the
Objekiprogramm directly into the desired memory
area to lay when this 2.8. occupied by ATMAS-ll
is (s. Memory-Map in Appendix). You can do this
Use the second parameter of the ORG directive, the
so-called 'physical address' <AP>.

	ORG $ 3000, $ A8OO

This 0RG command would assemble a program so
that at the address $ 3000 (logical address <AL>)
runs, but during assembly in
free space from the address $ A800 filed
becomes. For the program to be executed must
it will be moved to the right place, which can
2.8. happened to the SAVE command of the monitor, the
a binary file can store so that it renewed the
th reading to the correct space comes. In
simpler cases (2.8. when the program in the
to be stored address area where ATMAS-II
its symbol table has) also helps the
Block transfer command of the monitor.

2.3.2 EQU, EPZ (equate)
------------------------

Purpose: Assign a value to a label. _

Syntax: <LABEL> EQU <EXPR> [<COM>]
		<LABEL> EPZ <EXPR> [<COM>]

Example: GRUEN EQU $ A0
		CIOv EQU $ E456
		SAVHSC EPZ $ 58
		PLAYER EQU PHBASE + 1024

The EQU directive is used by a label with
to define a particular value, it may be
be either be a date or an address.
The first label of the example is as safe as
Newest be used for immediate instruction (LDA
#GRUEN), While the second example of a ROM-Check
jump address bezeichent (JSR CIOv).

EPZ (Equate Page Zero) has basically the same
Function, but can be used if, for
is meant to be expressed that the label a
represents Zeropage space. However, there is
no compulsion to use of EPZ as ATMAS-II
Zeropage-Adresslerungsarten automatically detects. EPZ
here serves only to illustrate, you can in
Use all cases EQU.

2.3.3 DFB (define byte)
-----------------------

Purpose: To define the content of individual bytes in
		Object code

Syntax: [<LABEL>] DFB <EXPR> [, <EXPR>] [<COM>]

Example: tabell DFB 1,2,4,8,16,32,64,128

		DFB 'A,' B, 'C
		DFB 'X + 128

The DFB navh following terms are as 8-bit
values ??stored in the object code. The first line of
Example would produce the following sequence:

	01 02 04 08 10 20 40 80

ATASClI values ??are stored as a 7-bit nerte that
hchstwertiqe bit is always zero.

2.3.4 DFW (Define Word)
-----------------------

Purpose: To define the contents of a 16-bit word in the
		Object code.

Syntax: [<LABEL>] DFW <EXPR> [, <EXPR> ...] [<COM>]

Example: ADRTAB DFW $ A900, $ AA03, AB06 $
			DFW ADRTAB-1, ADRTAB + 2

The foldenden to DFW expressions as 16-bit
Values ??stored in the object code. Here, the series
Following the 6502 addresses used, ie first
low-order (LSB), then the most significant byte (MSB).
The first line of the example would be the following accordingly
generate:

	00 A9 03 AA 06 AB

2.3.5 ASC (ASCII string)
------------------------

Purpose: adds a string to ATASCII- or image
		screen coding into the object code.

Syntax: [<LABEL>] ASC <STZ> <STRING) <STZ>
				[, <STZ> <STRING> <STZ>] [<COM>]

		<STZ>: string delimiter "/, \,%, $

Example: TEXT ASC "HELLO"
		MELD ASC / DISK ERROR /
			ASC "MACRO", \ ASSEMBLER \
			ASC Z Normal screen Code Z
			ASC S Inverse screen Code S

Strings to an ASC Dlrektive be byte for byte 
transmitted into the object code. Depending on the separation
sign (<STZ>) can perform various functions _
be selected:

	": Enter Text in ATASCII Code
	/: ATASCII code but bit 7 = 1 (inverse)
	\: ATASCII Code, the last character bit 7
	    set <end-identifier>
	%: Internal screen code is generated!
	$: Screen code with bit 7 = 1 (inverse)

Each string has valid two string delimiters
are enclosed. Start and Endtrennzeichen
must be equal.

Instead the quotation marks "(<SHIFT> -2), you can
also any other non-alphanumeric cartoon wind
use the above naturally excluded
sen. Possible measures could z. B.!, #, Or &, condition
is merely that the same string with the
Delimiter is completed. With this trick
it is possible that one quotation in the text
get.

In conjunction with the display list concept of Atari
Computer allows you the ASC command the convenient
table Programming of titles and headings, as
direct screen code can be generated. The example
ple program ASCDEMO.SRC on ATMAS-II disk
shows you how it's done.

2.3.6 OUT (Output Listing)
--------------------------

Purpose: To issue an assembly listing
Syntax: [<LABEL>] OUT [L] [N] [M] [P] [0] [1] [2] [<COM>]

Example: OUT L Listing on screen
		OUT LP1 Listing Printers
		OUT LNMP1 listing on printer icons
				no macro expansion

With OUT, you can determine whether you want a log of
want Assembliervorganges and the associated
specify output device. The following parameters are
rules:

	L: Listing generated
	N: Symbol table is output
	M: Macros are NOT expanded (printed!)
	P: Printer Options:
	PO: RS232 interface
		P1: Atari printers Centonics interface (850)
		P2: Joystick interface port 3 & 4 (only 400/800)

After each 66 lines is a form feed
generated.

2.4 Mahrofhigkeit
==================

ATMAS-II allows you the use of macro-
command. This refers to a series of
Assembly instructions, which in the context of Makrodefini-
tion a name has been assigned. When using
This macro name in the source code, the entire,
generates its associated assembly instructions, they say,
the macro command is expanded. With macros
If you would like some kind of additional Assemblerbe-
create missing, which in reality consists of a sequence
consist of individual machine instructions.

2.4.1 Macro Definition
----------------------

Before you can use a macro, you must
first define. For this purpose serve two
Assembler directives MACRO and MEND.

For a better understanding first an example that the
Basic command POKE mimics:

	POKE MACRO ADDRESS, DATA
		LDA #DATA
		STA ADDRESS
		MEND

The definition is with the MACRO directive
(Here: POKE) advanced standing name of the macro set
passes. This name is used subsequently for calling.
After the MACRO directive follow the so-called
formal parameters that are no labels in the actual
union sense, but only a placeholder for the
Call specified actually employed
Parameter. This process of parameter substitution
is in the discussion of macro call yet
explained in more detail.

Now follow the assembly instructions, as operands
both ordinary labels as well as in the
MACRO directive specified formal parameters
can use. Completed is the macro-
Definition by the MEND (Macro-end) directive

Syntax: <MNAME> MACRO [<FPAR>] [, <FPAR> ...]
			MEND

	<MNAME>: name of the macro syntax as label
	<FPAR>: formal parameters

2.4.2 Macro call Macro expansion
---------------------------------

The defined in 2.4.1 Macro can in code with

	POKE 752.1

be called. In the assembly then takes
following instead: ATMAS-II recognizes that it is in
POKE is an already defined macro and adds
the machine instructions in the object code of the definition
on. Here are the formal parameters of the definition
tion achieved with the actual values ??of the call
puts. The example thus ADDRESS by 752, and
DATA replaced by: 1. After macro expansion results
Consider the following machine program:

	LDA # 1
	STA 752

The general syntax of the macro call is:

	[<LABEL>] <MNAME> [<PAR>] [, <PAR> ...]

There have as many parameters (<PAR>) passed
be as formal parameter in the definition
were given. As parameters constant,
Expressions and strings are used. On
Example of using strings as parameters
Can be found in Part 4.2 (macro libraries).

2.4.3 Local Labels
-------------------

Next example, please see the listing
the macros below. These are
a program for deleting a memory area
by Max. 256 bytes (a page). Since the program with
a loop works, it contains logical that
a label. Hurdles this macro twice within
Calling a program so the label LOOP would
used twice, whereby the assembler the error
'SAME LABEL TWICE' reports.

	DELETE MACRO ADDRESS, LENGTH
		LDY #LANGE
		LDX # 0 
		LDA # 0
	LOOP ADDRESS STA, X
		INX
		DEY
		BNE LOOP
		MEND

Again offers you ATMAS-II support: A
Label, with the Happy-'a 'symbol (<SHlFT> -8) ends,
is regarded as a local label of the macro. in the
Example: instead of LOOP label LOOP @ has used
(also in the GNI command!). Intern replaced ATMAS-II
the Happy-'a 'symbol by a four-digit number, the
is increased each macro call by one. Thereby
also generates twice calling LOESCH different
Labels (namely LOOP0001 and LOOP0002).

2.4.4 nested macros
---------------------------

A macro definition itself can turn a macro-
call including passing parameters
contain. As an example, a double-Poke command
serve, the already discussed POKE macro described
uses:

	DPOKE MACRO ADDRESS, WORD
		POKE ADDRESS, WORD
		POKE ADDRESS + l, WORD / 256
		MEND

This interleaving technique is only by the hardware
ware stack limits.

2.4.5 Macros contra subroutines
----------------------------------

Surely you in describing the macros
the close relationship to subroutines noticed.
However, there are a number of important differences,
you should understand clearly:

Macros are universal in use since about
the mechanism of passing parameters feature. they
are therefore well suited for the synthesis of macro (program)
Libraries. Such macro collections can be
easy with the flexible ATMAS II Editor in
Embed code. Macros allow much
clearer Assembler programs, one may How-
recently not overlook the fact that all in the definition of
Macros specified machine instructions for each call
the macros are used in the program. The 
means if the ERASE macro five times in pro-
program use that as often in your program
is used, and of course accordingly
Space consumed.

The use of subroutines is essential
optimal in terms of storage space, which is How-
is recently more difficult the transfer of the parameters so
to make elegant as macro. Another, in
some cases crucial aspect is the
Speed: While macros here the better
represent solution for subprograms it takes a little
longer because JSR and RTS commands require time.

3. The machine language monitor
===============================

From Editor can be reached by typing

	<CTRL> -P

in the machine language monitor. The screen
deleted and the "MONITOR." - prompt appears in the
left corner of the screen. By ATMAS-II monitor
you can start machine programs on diskette
store, check the memory content, change and
disassemble and thereby a protocol printer
carry. Since the monitor on a conversational
Input features, you do not complicated
Remember graced command syntax.

3.1 General Notes on Usage
---------------------------------

All entries within the monitor be in hexadecimal
decimal notation (without the leading dollar
character!). If you make a mistake when entering,
these can always be abgebroched with 'X'.
If questions arise in dialogue, they are with 'Y'
(Yes) answered positively, any other keystroke
(Also <RETURN>) answered the question in the negative. Also
Here is an abort with 'X' possible.
File names must always set format in standard Atari
will give, that is, first a device name (D :, D1 :,
D2: ...) then the File name with max. 8 characters, which after
a decimal point nor a max. 3 characters long
must have extension.

Examples: D: TEST.OBJ, D2: CODE.COM, D1: FILE

3.2 Befehlsvorat Monitor
-----------------------------

The language of the machine monitor commands consist of
simple letter, the parameters, as necessary,
to query dialog.

3.2.1 M - Memory Dump

Hit the M-command to a storage area in
hexaderimaler spelling on screen or printer
go out, you can continue to an additional representation
setting the memory contents in ASCII characters
receive.

Example: Your input: Screen:
		M DUMP
		D000 FROM: D000
		D080 TO: D080
		Y ASCII? Y
		<RETURN> PRINT?

Now, the memory area of ??$ D000-D080 will both
hexadecimal number format as issued in ASCII
give. Would you have the question ASCII? easy
pressed <RETURN>, so would only hexadecimal
Writing output. Respond to the question
PRINT? with 'Y', then you need to look for a
Output channel decide:

(1): selects the serial port R1: the
	ATARI interfaces as output channel
(2): output channel is the Centronics interface
	ATARI interfaces (normal 'P' - Printer handler).
(3): Output Joystick Interface port 3 & 4 (400 / 8OO)

3.2.2 D - Disassemble
---------------------

With the D-command to the contents of a memory
range than 6502 commands reverse assemble (disassem-
lish) blank. As with M you can on the issue
the printer redirect.

Example: Your entry screen
		D disassembler
		D000 START? D000
		<RETURN> PRINT?

Now the contents of memory starting at the address SDOOO is in
disassembled form output, which always
a filling of the screen is interrupted.
Pressing any key (except 'X')
the next screen output. 'X' stops
Disassembly. For output to printer does not
Interruption of listings instead, can express
be aborted with <RESET>.

3.2.3 C - Change Memory
-----------------------

The C command allows you to change from
Memory contents. The entry is made in
hexadecimal notation.

Example: Your entry screen
		C CHANGE
		A900 ADDRESS? A900
		FF A900 => FF
		00 A901 => 00
		X = A902>
				MONITOR.

You can target individual bytes or together
one continuous memory blocks in hexadecimal form
give. By entering 'X' come back in
the command input mode of the monitor back.

3.2.4 F - Fill memory
---------------------

With the F-command to a memory area with
a desired value presetting.

Example: Your input: Screen:
		F FILL
		A900 FROM: A900
		AFFF TO: AFFF
		FF WITH: FF

Effect: The memory range $ A900 to $ AFFF is with
the value $ FF filled.

3.2.5 B - Block Transfer
-----------------------

The B command allows the displacement of entire
Memory blocks. This can be useful if you at
the assembly with ATMAS-II a different
logical and physical address have chosen. Of the
B command requires start and end address to supply the
-shifting region, and the start address of the
Target area.

Example: Your entry screen
		B BLOCK TRANSFER
		A800 FROM: A800
		A900 TO: A900
		AC00 INTO: AC00

Effect: The memory block of $ A800 to $ A900 in
the memory area of ??$ AC00 copied to $ AD00.

3.2.6 G - Goto Address
----------------------

With the G-command to a machine program
Start, whose entry point to enter.

Example: Your entry screen
		G GOTO
		A800 A800 GOTO

NOTE: You must itself ensure that a
executable machine program at the specified
Place is!

The control is returned to the monitor when
the machine program with either a RTS (Return
from Subroutine) or BRK (Break command, hex bytes $ 00)
ends. In the latter case, you get the Registrar
content and displays the processor flags, an out-
projecting way to a program for errors
to browse.

3.2.7 S - Binary Save
---------------------

To a signal generated by the assembler machine program on
save disk, you can either from DOS
go (via editor (ESC) M (ESC) <ESC>) or the
use Monitor Belehl S. The monitor stores
Machine programs so from that you the DOS-II (or
to compatible versions of DOS) can be reloaded
can.

Example:

	Your input screen
	S SAVE
	A800 FROM: A800
	AF00 TO: AF00
	<RETURN> INTO:
	D: TEST.OBJ FILENAME (D: FN.EXT)? D: TEST.OBJ

This example causes the memory area of
$ A800 off to $ AF00 as File TEST.OBJ in Drive 1
is stores. The file name must always standard
Atari format Enter.

the ATMAS-II Monitor The SAVE command does not have some
exhibit additives hinaus- over the standard
go:

A) Address Offset saving: you can create a pro-
program to save so that when re-reading in
another memory area is loaded. This is
very useful if you programs with separate lo-
ical and physical address (s. ORG directive)
have assembled.

You must help the questions FROM and TO the physical
cal address range specify (where the program currently
is filed) and logical in question INTO the
Address (to which the program should be loaded)
specify.

Example: 

	Your input screen
	S SAVE
	A800 FROM: A800
	A780 TO: A980
	4000 INTO 4000
	D: TEST.OBJ Filename (D: FN.EXT) D: TEST.OBJ

This example would be a program that from $ A800 to
$ A980 stands in memory, so put on the floppy
ben that when re-reading in the range of
$ 4000. to $ 4180th Had the program with
ORG $ 4000, $ A800 assembled, so it is now a
executable computer program. CAUTION: You should
not read this file in the monitor, otherwise
ATMAS-II would be overwritten!

B) append option: If you as the last character of the
Enter Filenames a greater than sign ( '>') then
the file to a possibly already existing with
same file name appended. You can thus com-
pound-Files (composed of several blocks
generate files) or files with INIT and RUN address.

Example:

	Your input Bidschirm
	S SAVE
	AA00 FROM: AA00
	AB00 TO: AB00
	<RETURN> INTO:
	D: TEST OBJ> FILENAME (D: FN.EXT) D: TEST.OBJ>

The File TEST.OBJ (from before) is in this example
extended by the memory block of $ AA00 to $ AB00.
Using the same action you can RUN and INIT
add addresses to a file: enter the RUN
Address (LSB, MSB) in the addresses $ 02E0, 02E1 $ (INIT:
$ 02E2, 02E3 $) and mount the respective 'storage
block '(consisting of only two bytes FROM: 02E0 TO:
02E1) to the file.

3.2.9 L - Binary Load
---------------------

Similar to the Save command can here a binary file of
the disk loading. This may be a
produced or generated from a DOS Save command
Binary File act even composite Compound-
Files are loaded. RUN and INLT be jumps
not executed.

Example:

	Your input screen
	L LOAD
	D: TEST.OBJ FILENAME (D: FN.EXT)? D: TEST.OBJ
			FROM: 5000 TO: 5190
			FROM: TO AA00: AB00

The Load command tells you the same, in which
Storage area, the binary file was loaded. in the
A File was loaded, which similarly
is to the generated in the Save-Beisplel.

3.2.9 E - Editor
----------------

With the E command, you return to the Editor,
the cursor is still at the location where you
have the editor exit.

3.2.1O I - Floppy Contents
--------------------------------------

The I command shows all file name of the drive
1 on the screen.

4. Examples
============

4.1 Demprogramm color scrolling
------------------------------

The following example you want the interaction
the individual components of ATMAS-II illustrate.
beneficial it would be if the Part 1 (The Editor)
this manual have been read and the
Editor are already somewhat familiar. Parts 2 and 3 were
not necessarily a requirement, but bear
certainly for a better understanding.

Although the night following demo program on the ATMAS-II
Disk is enlhalten (DEMO.SRC) you should nevertheless
yet type of hand to be better with the editor
to familiarize. In case of difficulty
should, you can then still on the finished
File Zuruckgrelfen.

************************************
* ATMAS-II Demo: color scrolling PF85
*
Demolition by START button
************************************

COLPF2 EQU $ D018 color register
HSYNC EQU $ D40A synchronous.
VCOUNI EQU $ D40B raster line
RTCLL EQU $ 14 VBI pm
CUNSDL EQU $ D01F Fct keys

*
* Program is located in the USER area
* (From Saboo)
*

	ORG $ A800 res. place

	LDA # 8 of query
	Preparing STA CONSOLD START button
SCRCOL CLC
	LDA VCOUNT screen counters
	ADC RTCLK plus raster line
	STA HSYNC syncronlsieren
	STA COLPF2 in Farbreglster
	LDA CONSOL function keys
	AND # 1 START button?
	BNE SCRCOL no further ->
	RTS

Reminder some pointers to type of product
grammes: Any line that starts with a
Star in the first column. Also have lines,
which are provided with a label in the first column
begin. In all other rows, it is advantageous
to use at the line start a tab.

Example:
---------
The first 'EQU' line so you should type:

	COLPF2 <TAB> EQU <SPACE.> $ D01B <RETURN>

After you have typed the entire program can
nen the first assembly by typing
start <CTRL> -Y. You see the copyright information
Assembler and if the assembly no mistake
has recognized the end address of Objektpro- generated
grammes.

If errors, so you are this
presented in plain text on the screen. You can
this using the error table in Annex B to the
Track down. Possible causes are only typos
in question.

First, press any key to return now a
to come in the Editor. The cursor is
immediately in the faulty line. A little
Tip: Sometimes the entering <CTRL> -T to help to
see if maybe a tab at the wrong
Body sitting (A line that only one tab
or a space there is as SYNTAX ERROR
reported!).

Reports of assembler no mistake, so you can
go ahead, the just assembled program
start. For this purpose, first press any
Button to enter the Editor, and enter
then <CTRL> -P a call to the monitor.

In the monitor you can generated the by the assembler
See program. To do this, type 'D' (dis-
assemble) followed by 'A800' and <RETURN> a. they
would now Disassembled listing of programs
mes see on the screen. Now press 'X' to the
cancel disassembler listing.

To start the program, enter 'G' (GOTO) and
the start address of the program, in our case
'A800' one. If you have done everything right, then
would you 128 colors run across the screen now
see. The spectacle of color can with <START> or <RESET>
be canceled. Press <RESET> to come
Automatically in the Editor, is with <START>
the program ends abnormally and control
goes back to the monitor. 'E' finally reactivated
Lich the editor.

4.2 Macro Libraries
----------------------

On the ATMAS-II disk, see two more
Files IOLIB.SRC and GRAFLIB.SRC whose listings on
the following pages are reproduced. It deals
thereby they are known as macro libraries, ie
contain (in addition to a small demo) only macro definitions
tions. The files contain plenty of comment, so
that a detailed description is not necessary.

GRAFLIB.SRC contains macros similar to BASlC-loading
missing GRAPHICS, COLOR, PLOT and DRAWTO work. On
Demo You can watch if you GRAFLIB.SRC
load, assemble and to the monitor on the street
$ A800 launch.

IOLIB.SRC contains macros, which similar to the BASIC-loading
missing OPEN, CLOSE, PRINT and INPUT work, and
two more, and bget BPUT, the loading and saving
allow binary files. Here is a
contain interesting demo, the same procedure as for
get Procedure GRAFLIB.

In the macro libraries, see examples
Nesting of macros and the handover of
String parameters. Understand the two files as
Excitation, which is feasible with ATMAS-II.

Of course, extensions and improvements
leave ments of your personal intuition.

************************************
* GRAFLIB.SRC
*
* Macro Library
*
* GRAPHIC
*
* For ATMAS-II
* PETER Finzel
************************************
*
* IOCB structure:
*
ICCOM EQU $ 342
ICSTA EQU $ 343
ICBAL EQU $ 344
ICBAH EQU $ 345
ICBLL EQU $ 348
ICBLH EQU $ 349
ICAX1 EQU $ 34A
ICAX2 EQU $ 34B

CIOv EQU $ E456

* CIO command

COPENHAGEN EQU 3
CCLSE EQU 12
CGTXT EQU 5
CPTXT EQU 9
CGBIN EQU 7
CPBIN EQU 11
CDRAW EQU $ 11

* ATARI graphics variable

ATACHR EBU $ 2FB
ROWCRS EBU $ 54 CURSOR
COLCRS EBU $ 55 POSITION

*
* GRAPHICS command
*
* Call: GRAPHICS <level>
*
* <Level> from 0 to 15 (XL's)
* 0 through 11 (400/800)
*
GRAPHICS MACRO LEVEL
	JMP GR1 @

DEV @ ASC 'S'

GR1 @ LDX # $ 60
	LDA #CCLSE FIRST CHANNEL 6
	STA ICCOM, X CLOSE
	JSR CIOv
	LDA #STUFE NOW NEW PRINTS
	STA ICAX2, X STAGE REDIAL
	AND # $ F0
	EOR # $ 10
	ORA # $ 0C
	STA ICAX1, X
	LDA #COPEN
	STA ICCOM, X
	LDA # DEV @
	STA ICBAL, X
	LDA # DEV @ / 256
	STA ICBAH, X
	JSR CIOv
	MEND
*
* Ausnahl the Zelchenfarbe
*
* Call: COLOR <color>
*
* <Color> from 0 to 255, depending on
* Graphics mode would have a
* be constant.
*

COLOR MACRO COL
	LDA #COL
	STA ATACHR
	MEND

*
* Positioning the cursor:
*
* Call: POSITION <x>, <y>
*
* <X>, <y>, depending on graphics mode, both
* Must be constant
*
*
POSITION MACRO X, Y
	LDA #X
	STA COLCRS
	LDA # X / 256
	STA COLCRS + l
	LDA #Y
	STA ROWCRS
	MEND

* Set graphic points
*
* Call: PLOT <x>, <y>
*
* <X>, <y>, depending on the graphics mode,
* Must be un constant
act *
*
PLOT MACRO X, Y
	Position X, Y
	LDX # $ 60 CHANNEL 6
	LDA #CPBIN
	STA ICCOH, X
	LDA #O
	STA ICBLL, X
	STA ICBLH, X 
	LDA ATACHR
	JSR CIOv
	MEND
*
* Graphic lines drawing
*
* Call: DRAWTO <x>, <y>
*
* <X>, <y>, depending on graphics mode
* constant
*
DRAWTO MACRO X, Y
	POST TION X, Y
	LDX # $ 60 CHANNEL 6
	LDA #CDRAH
	STA ICCOM, X
	LDA #CCLSE
	STA ICAXl, X
	LDA #O
	STA ICAX2, I
	JSR CIOv
	MEND

*************************************
* Demo program f. Graphics library
*
* Distinguished hash In GRAPHlCS 7
*************************************

*
* Located in reeervierten
* Space for object code
*
	ORG $ A800

	GRAPHICS 7 + 16
	COLOR 1
	PLOT 79.0
	DRAWTO 159.47
	DRAWTO 79.95
	ORAWTO 0.47
	DRAWTO 79.0

ENDLESS JMP ENDLESS
*
* Abruch with <RESET>
*

***********************************
* IOLIB.SRC
*
* MACRO LIBRARY
*
* Input / Output
*
* For ATMAS-II
*
* PETER Finzel
***********************************

* IOCB constant

CIOv EQU $ E456

ICCOM EQU $ 342
ICSTA EQU $ 343
ICBAL EQU $ 344
ICBAH EQU $ 345
ICBLL EQU $ 348
ICBLH EQU $ 349
ICAX1 EQU $ 34A
lCAX2 EQU $ 34B

* CIO instructions

COPENHAGEN EQU 3
CCLSE EQU 12
CGTXT EQU 5
CPTXT EQU 9
CBBIN EQU 7
CPBIN EQU 11

EOL EQU $ 9B

*
* MAKR0 FOR BERECHNUB THE CHANNEL NUMBER
* (Only internal use, is
* Usage example of comparison
* Nested macro calls)
*
KANNUM MACRO CHANNEL
	LDA #KANAL IOCB offset
	ASL; from channel no.
	ASL; (16 times)
	ASL
	ASL
	TAX; RESULTS IN X-REG
	MEND

*
* Name: OPEN
* Purpose: oeffnen a file
* Call: OPEN <Num>, <Aux1>, <Aux2>, <Filename>
* Example: OPEN 1,4,0, "D: TEST.DBJ"
*
OPEN CHANNEL MACRO, AUX1, AUX2, FILENAME
	JHP OP1 *
FNAME ASC FILENAME
	DFB EOL
0P1 * KANNUM CHANNEL
	LDA #AUXI
	SIA ICAX1, X
	LDA # AUX2
	SIA ICAX2, X
	LOA #COPEN
	SIA ICCOM, X
	LDA #FNAME
	STA ICBAL, X
	LDA # FNAME / 256
	STA ICBAH, X
	JSR CIOv
	MEND
*
* Name: CLOSE
* Purpose: Close File
* Call: CLOSE <Num>
* Example: CLOSE 1
*
CLOSE MACRO CHANNEL
	KANNUM CHANNEL
	LDA #CCLSE
	STA ICCOM, X
	JSR CIOv
	MEND

*
* Name: PRINT
* Purpose: Output one with 'ASC'
* Defined text, auss
* be terminated with EOL
* Call: PRINT <channel>, <label>
* Example: PRINT 0, TEXT1
*
PRINT MACR0 CHANNEL LABEL
	KANNUM CHANNEL
	LDA #CPTXT
	SIA ICCOM, X
	LDA #LABEL
	STA ICBAL, X
	LDA # LABEL / 256
	STA ICBAH, X
	LDA # 127 max. Length
	SRA ICBLL, X
	LDA # 0
	STA ICBLH, X
	JSR CIOv
	MEND

*
* Name: PRINTS
* Purpose: To direct output of a
* String to the screen
* Call: PRINT <String>
* Example: PRINTS "HELLO"
*
PRINTS MACRO STRING
	JMP PR2 @
PRI1 @ ASC STRING
	DFB EOL
PR2 PRINT @ 0, PRI1 macro above!
	MEND
*
* Name: INPUT
* Purpose: Read String
* Call: INPUT <channel>, <label>
* Example: INPUT 0, TEXT1
*
INPUT CHANNEL MACRO, LABEL
	KANNUM CHANNEL
	LDA #CGTXT
	STA ICCOM, X
	LDA #LABEL
	STA ICBAL, X
	LDA # LABEL / 256
	STA ICBAN, X
	LDA # 127 max. Length
	STA ICBLL, X
	LDA # 0
	STA ICBLH, X
	JSR CIOv
	MEND
*
* Nane: bget
* Purpose: reading a data block
* The length L from address A
* Call: bget <Num>, <L>, <A>
* Belepiel: bget 1, $ B000, $ 100
*
Bget MACRO CHANNEL LENGTH, BUFFER
	KANNUM CHANNEL
	LDA #CGBIN
	STA ICCOM, X
	LDA #LAENGE
	STA ICBLL, X
	LDA # LAENBE / 256
	STA ICBLN, X
	LDA #BUFFER
	STA ICBAL, X
	LDA # BUFFER / 256
	STA ICBAN, X
	JSR CIOv
	MEND

* Name: BPUT
* Purpose: To store a data block
* The length L from address A
* Call: BPUT <Num>, <L>, <A>
* Example: BPUT l, $ B000, $ 100
*
BPUT MACRO CHANNEL LENGTH, BUFFER
	KANNUM CHANNEL
	LDA #CPBIN
	STA ICCOM, X
	LDA #LAENGE
	STA ICBLL, X
	LDA # LENGTH / 256
	STA ICBLH, X
	LDA #BUFFER
	STA ICBAL, X
	LDA # BUFFER / 255
	STA ICBAH, X
	JSR CIOv
	MEND

**********************************
* Demo program I / 0 Library
* Indicates contents of
* Drive To 1.
**********************************

	ORB $ A800
	PRINTS "Contents Drive 1"
	OPEN 1,6,0, "D1: *. *"

NEXT INPUT 1, BUFFER read out line
	BMI END End of File?
	PRINT 0, BUFFER and print
	JMP NEXT next line

END CLOSE 1 Done!
	RTS

keep clear BUFFER ORG * + 20 place

**********************************
* START THE DEMOS:
* With <CTRL> -Y assemble,
Enable * Monitor with <CTRL> -P
* And start with 'G'oto A800.
**********************************

Appendix A ATMAS-II Memory-Map
============================

0000 - 007F: Betrlebssystem-Zeropaqe
0080 - 0085: *** free for users ***
0086 - 00DF: Editur / Monitor Zeropage
00E0 - 00FD: Assembler Zeropage but utilizable
		(Will be deleted from ATHAS-ll)
00FE - 047F: Stack, vectors IOCBs ...
0480 - 05FF: *** free for users ***
0600 - 06FF: *** free (PAGE 6) ***
0700 - <LOMEM>: DOS, <LOMEM> DOSII: = $ 1F00
			     DOSXL: = $ 2,700
<LO> - 27ff: *** free for users ***
2800 - 4AFF: ATMAS-II
4800 - 4BFF: Line Buffer
4C00 - 5FFF: Symbol Table
6000 - 63ff: copy register
6400 - A7FF: TextBuffer
A800 - <MEMTOP>: *** free for users ***
<Me> - BFFF: display list, screen RAM

For object code, you have several areas for comparison
available:

A) $ 600 to $ 6FF: the famous Page 6, particularly low
is when you write USR programs for BASIC
want.

B) $ 1F00 to $ 27ff: this range is from the DOS
Upper limit (in <LOMEM>, is to find $ 2E7- $ 2E8)
until the beginning of ATMAS-II program. That the DOS
About limit of DOS to DOS is different, you must
be here a little careful if you default the
DOS-II, this area starts at
$ 1F00

C) $ A800 to $ BC3F: standard range for object code,
reaches to the top of the display memory (or
the display list).

It is also possible, the space
the symbol table ($ 4C00- $ 5FFF) after assembly
as space for fields, fonts or as Player
benefit to missile range. The symbol table is
Finally, no longer described by the assembly
compels.

Appendix B: Error Messages
=========================

1. assembler error messages:
-----------------------------

SYNTAX ERROR: format error, for example if line number
		used or label starts with digit,
		Line consists of all or Tabualtor Space

NAME UNKNOWN: error in the Command field: eg SRA place STA

UNDEFINED EXPRESSION: error in the operant box. Joins
		faulty arith. Expressions and not
		defined labels on.

ADDRESSING ERROR: Adressierunqsart not match the
		Command, eg, STA # $ 6FF

IMPOSSIBLE BRANCH: branch instructions (GNI, BCS ...)
		rich only +127 or -128 bytes wide
		Use JMP!

DIVISION BY ZERO: Division by zero, eg LDA # 100/0

NUMBER ERROR: error in the numerical representation,
		eg LDA #% 30

WRONG DELIMITER: Separator for ASC command wrong or
		differently. <SHIFT> -2 use!

NO ASCII: ASCII character by character constant
		missing, eg LDA # '<RETURN>

LINE TO LONG: a line can not exceed 127
		characters.

MACRO ERROR: error in the macro definition or in
		Macro call (parameters)

ORG ERROR: error in the ORG directive (eg ORG missing)

TOO MANY LABELS: Symbol table is full

OPCODE DIFFERENT: Pass 3 detects other than opcode
		Pass 2, such as when the program by
		second, incorrect ORG command itself
		overrides.

2. Editor error messages:
--------------------------

RW: Error in disk I / O
CO: command line too long
E? : Error in command line
H? : Bad hex bytes
I? : Text buffer is full (T: 00000)
L? : Device Error in Listing Issue
S? String not found (search)
T? : Incorrect Tab value (only 1-9)
C? : Copy-register is full (C: 0OOO)
#? : Repetition factor is incorrect (only 2-255)

OK: There is no error, C Reg. closed
CR: copy register is open

3. Honitor error messages:
---------------------------

ADR ERROR: incorrect address when loading or
	   Storing a program. If the
	   Error in LDAD command, so is the
	   desired file is not in binary format (eg
	   a text file).

ERROR CODE: <80-FF>: Betriebssytemfehler, according to DOS
	    Manual. Error numbers are hexadecimal.

ATMAS-II REFERENCE CARD
======================

EDITOR COMMANDS in text mode
---------------------------
<CTRL> -E: cursor to the Tgxtanfang
<CTRL> -D: Cursor an_das text End
<CTRL> -R: open copy register
<CTRL> -F: close copy register
Insert Kopiernegister in text: <CTRL> -J
<CTRL> -K: Clear Kopiernegister
<CTRL> -V: Switching 1-line and 2-line mode
<CTRL> -T: Switching Control character representation
<CTRL> -G: Repeat the command line
<CTRL> -Y: Call ATMAS-II Macro Assembler
<CTRL> P: Call of machine language monitor

EDITOR-COMMANDS command line
--------------------------------
B: cursor one back
Q: cursor one forward
D: Delete character to the left
T: delete from cursor position to end of line
Insert any ASCII code in the TEXT: H <Hexbyt>
S <String>: Searches for string (String)
Insert string (string) in text: I <String>
J: repeated command line
K: Deletes TextBuffer
U: User command Haschinenpgm starts from $ A800
@ <N>: Sets tab size to <n> characters
M: Return to DOS
E: Deletes copy register

Insert copy register in text: G
N <D: FN>: Save text from the cursor position with <FN>
R <D: FN>: read text from the cursor position from File <FN>
output listing of the source code: L <0,1,2> (1: = printer)

ASSEMBLER DIRECTIVES:
---------------------
ORG: Start address Qbjektcodeufestlegen
EQU: Defining Constants
EPZ: Define Zero Page constant, not mandatory!
Insert byte values ??in object code: DFB
Insert word values ??in object code: DFW
ASC: put text in ASCII and screen code
OUT: control of output Listings
MACRO: Introduction of macro definition
MEND: completion of the macro definition

MONITOR COMMANDS:
----------------
M: Memory dump command
D: disassemble
Edit Change Memory, Memory: C
Q: Fill Fill memory, memory block with value
B: Block Transfer
G: Goto, restart machines Programme
S: Binary-Save, Save Machine Program
L: Binary load, load machine program
E: Return to the Editor
Show Contents Drive 1: I
