|
ZX Review #11-12
26 ноября 1997 |
|
New Programs - Xas Review editor-assembler 128K (v5.05).

NEW PROGRAMS
Music by ZET
Xas editor-assembler 128k
(V 5.05)
(C) Max Petrov
I offer you a description of the latest version, the
differences from the previous specified and marked with "*".
1. Background
1.1. What is it, why should
and why
Now, as you know, for
our long-suffering, but dear friend, there are several similar
programs with the undisputed leader Tasm'om (there is some
Zxasm, but I have not seen him). However Tasm from the moment
his appearance repulsed some users (me) its 64simvolnostyu, and
today all outdated and its over'nostyu
bunch of glitches. Actually, that's
and the whole reason for the appearance of my
program, thanks Rst 7.
Based on experience
in Tasme, on which was written
The first version of the program, as well as on their own
dreams and wishes of the VL, IK, and AB, has turned such a
thing:
- Assemble in 4,4 times
faster Tasm 3.x.
- Disc surgery is 2-3 times
faster, with a large number
files on a floppy disk - up to 10-20 (!)
times.
- Search text - almost instant (respectively, 20-30
times (!))
- The buffer to 1820 labels (* 1500)
(Tasm - 740).
- Editing the two texts
simultaneously with the ability to move blocks from one text to
another.
- The text of the program in 1.79 times
less than the equivalent in tasm.
- The number of buttons that
should press for a set of the same text, 1.333 ..
1.5 times smaller.
- The amount of text that can
otassemblirovan be without a single
treatment to the drive - in 2.23
times more than in tasm (!)
- The maximum amount of one
text to 1.12 times greater than in
tasm.
- The time taken to search
a string containing an error that emerged during assembly - 50
.. 1000 times smaller;).
- Work with the half-ix and iy;
- The possibility of assembling
selected area n-th number
time (* - no);
- Macros that at any moment, you can edit;
- The big Russian, and large and
small letters;
- Modes ins and ovr;
- 42 characters per line;
- Save the current position in
text for all operations;
- Avtotabulyatsiya;
- Download at cursor, time
loading and saving does not depend on
count of files on a floppy disk (which
not be said about Tasme, which, when
the disc with a 40-files
just goes to sleep);
- Called Xas [ksas];
- Lots of friendly, unexpected,
new things ...
Disadvantages:
- Do not merge; (but more than compensated by the possibility
of transfer of labeled blocks of text from one window to
another);
- There is no substitute for find;
- Tags to 7 characters (the other characters in the assembly
ignored), (Tasm - up to 14);
- Defb does not like strings;
- Silly equ (in terms
should not be indefinite
labels);
1.2. Loading and Running
On the drive there are two files: xas myself and (to be
recorded immediately after it) STS 3.21. If You came out of
XASa in basic, then back can be performed RUN, if the program
is alive at BASIC (first row can be
delete), usr 23465, if you do not
touch the printer buffer to the addresses or 23465-23471 usr
49152, including Bank 1 (out 32765,81).
1.3. Memory location
Ramtop installed on
address 24575, but it can be rearranged in any address to 32768.
Xas is page 1 in
page 3 - the first text,
Fourth - the second text in the 6-th macro, table tags, and a
buffer for block transactions, in the seventh page is STS. At
the entrance / exit is also used Xasa memory addresses,
23440-23471. You can use page 6
(Even killing a macro), as well as
Page 4, if you do not load in her second text, and if
assembliruemoy Program no options loadtext.
By the way, we should say that
loadcode and save code used
screen memory STSa (ie bank 7).
In general, you can make a muck of and
Third bank - to hang it is not
lead.
And, naturally, at your disposal the entire 48-I memory
(page 0, 2 and 5), except for some BASIC system variables.
If you have a 256/512K
Port # fd bits 6 and 7, then use the 2 nd Bank of 128K (ie, # 10
bank instead of 0, # 17 - 7th ...),
that usually leads to conservation
text in memory even after you reset ...
2. Entering text
2.1. Download
When using any disk
border color change means
read / write error. After four attempts, it asks:
Error t / s. Retry, Ignore, Abort.
where t / s - a track / sector
with an error.
If you answer Retry be made 14 more attempts ...
Interruption of operation with a - space.
When you run the editor-assembler (the p-a), if the memory
is not text, on disk for a file XMACROS.XaS (macro) and loaded
in the presence (and lack of memory). Then, if the disk has
files with XAS, xAS and XaS, before You get them spisochek and
the amount of free disk space sectors. You can select file
using the cursor keys and entera, or refuse to download by
clicking edit (removal of load) or ext mode (removing Text from
memory). Space - perezachtenie directory. If the file no hard
drive, then the p-and immediately released into the editor.
2.2. Screen
Going into the editor, you will see
Several bukovok and tsifirok bottom of the screen.
INS - mean that enabled
insert mode (CS / 3), OVR - replacement; LAT - selected Latin
alphabet (edit), RUS - Russian; 0 / 1 - The first number
indicates the number the current row (from scratch), second
- Number of lines in the text
(Ie the maximum value for
the first number). The text can not be less than two lines;
The most right number - shows the number of the current
text:
1 - text in a bank, 3
2 - 4 and in the bank
3 - a macro in the bank 6.
Color figures indicates the following:
White - You have not edited the text after the load,
Yellow - The text has not been edited after the recording
red - the text is edited, and with the next record
it on the disk will increase the number,
indicating the number of editions;
number, which - number of revisions
the text is in front of right
number, and if it is zero (new or newly transcoded), it is not
shown.
At the bottom is a row of
29 characters in length. This is a comment
which is stored in the text.
The third bottom line is often printed model search
(* No).
2.3. Editor
Quite a tricky thing: when you try to go beyond the line, he
will pack it, check the elementary syntax, and if all the
procedure will avtotabulyatsiyu (Ie, a line like
LabEL lD Hl # 4000; MDAAA ..
turn to
label LD HL # 4000; MDAAA ..
If syntax errors
such as: two labels in a row at the start line, the use of names
Registers and conditions as
labels, more than 3 marks in a row
(A Z80 no teams with four parameters) (by def-s restriction
does not apply), editor chtoto propischit nowhere to go and not
allow it.
Be careful
nested quotation marks in
defm: if you have two standing next to quote, since they
continue to recommend putting the following line: for example,
need text: "a" "b" - it must score at defm "" a "" b "", and
defm "" "
defm "a" ""
defm "b" "
Operations in line
ext mode - exit from the editor;
ss / q - rus / lat; location
Russian letters 'yaverty' in isdos;
ss / a - tab (very rarely
button that is used);
cs / 2 - ovr / ins;
edit - home / end (start / end
line);
cursor - the cursor;
graph - the prefix macro (see
below);
delete - guess, if
click at the beginning of a blank line,
the line is removed;
break - removal of the cursor;
ss / w - delete rows;
ss / enter - restoration
string, and returns the string form
that she had to edit;
ss / e - tag line for
block operations do not necessarily mark the line in a row, to
unmark, press again
mark another kind of mark
(See cs / ent), or press enter;
(See also ss / s);
cs / ent - tag line for
memory, the same mark marks
line assembler, if it detected an error, uncheck -
see ss / e;
Operations in the text
cs/3/4 - page up / down;
ss / g - start / end of text;
ss / y / u - find predyd. / trace.
marked lines, if such
No, nothing happens;
ss / s - cancellation marks;
ss / f - search for the next model, if it does not,
something is changing Border color; (see find);
graph ent - search from the beginning
Text of speech, which is
pointer with a very handy thing to
Search tags, not necessarily
put the cursor at the beginning of words -
this is done automatically;
to find the next such
word, press ss / f;
Block operations
ss / d - delete marked
ss / e lines;
ss / i - copy marked
ss / e lines, if labeled
No strings, it is inset
text from the clipboard;
graph ss / i - Copy the marked lines into clipboard, for
example, to transfer them to another text;
(* - A slightly different arrangement of keys:
edit - rus / lat;
cs / 2 - tab;
cs / 3 - ovr / ins;
cs / 4 - home / end;
ss / q / a - pgup / / pgdw).
To copy a row from
one text to another, it is necessary
first put them in a buffer.
Labeled lines are placed in
clipboard by pressing ss / i or graph
ss / i. Followed by a move to
other text (or download it
simply switch to another
window), remove it yellow mark (ss / e) and push ss / i.
When assembling a large number of tags they can
to collide with the buffer.
(* In assembly buffer
cleared)
2.4. Teams Xas
When you press ext Editor
you get to the command line.
Back in the editor, you can press ext. Teams are selected by
pressing the appropriate keys:
aUto (respectively, - 'u') -
Cancel / inclusion need
confirm enterom team (this team is, in fact, rudiment, and the
next. versions it will not, so enjoy now);
Edit - a return to the editor;
Save text - the text to write on
drive; offers to change the name, in
When entering the name of the command can be undone by pressing
the ext, while name change is saved, if such a file on disk is,
it removed and if the drive is not
space communications shall not be issued
changing the color of the red curb.
Load text - file download at
directory, if the disc has no files with the types of XAS, XaS,
xAS or xaS, then the directory does not appear and
xas vozrvaschaetsya in command
line, when selecting the file running the following keys:
space - perezachtenie directory
edit - removal of load,
ext - delete text from memory;
Files starting with a
'' - Remote, but they can be
free download, file type
'T' means the text, 'M' - macro
(It is automatically loaded into
Box 3, regardless of the current);
sTs - access to the sts (* - No);
pressing cs / t in the pc address will be recorded starting
otassemblirovannoy program, and in memadr - recently printed in
the calculator (for sts 4.x);
Quit - exit at basic, which
still runs sts;
Find - enter the model search
by ss / f and search for the first since the early
text;
ext - Undo
model and the search for the old model;
when entering the model must take into account
that if the input words are not limited to quotes and are not
comments, if they are the names of operations or operands, it
will be found exactly operations and operands, which means
that to find the register "A" you must dial "A", to find the
same the letter "A" (the register will not be found), we need
to introduce "; A"; example: enter "IN" - will be found all
Operation "IN"; entered "; IN" - all
words, including "IN" (but not
operation IN); if you need to find
word, not the name com.
or operas., then the symbol "" is not necessary, and if
necessary to find model, starting from character
";", Then you can enter with ";;";
search tags and enter their numbers
large letters;
Run - run the program from last otassemblirovannoy ent
or, if entov not the last org or if orgov no,
# 8000; if the program intends to return to xas, it is not
should spoil the memory address
23465-23471, system variables associated with the flow of N2,
and finish its work operation ret; cs / r - after returning
from the program and to clear the screen would be expected when
any keys;
remarK - editing comments;
Assemble - assemble;
fullCat - complete directory of the drive; cs / c - all the
data displayed in decimal form;
neW - delete text from memory, must confirm the 'Y';
laBels - displaying table tags, sorted by
the first character; to interrupt
press the space; if you used when assembling the block
operation 'copy' and labels were so many, you
see not all tags; cs / b - print in decimal form (* - not
supports tap-cs, and asks the question 'hex?', which
should answer 'n', if needed
print in decimal);
save cOde - write the object code, with code length over
# C000 record is not made,
as such lengths in the memory of 48K are not
happen;
Mac edit - Edit
macro file, which is located in the 3 rd box;
aNother - switching to another editing window: 1, 2,
2> 1 3> 1;
comPute - calculator. Can
type of expression as well as in program text (the names of
tags, binary and character constants ...), the result will be
printed in decimal, and hexadecimal systems; calculator can be
used to transfer numbers from one system to another,
view label values, set the address on the importance sts
tags (see sTs) (* - No);
3. Assembling
Assemble in two passes, but not traditional. On the first
pass is a table of labels. At the end of his message on the
length and end object code.
Almost all errors are announced on the second pass.
Assembling can be interrupted in the second pass, pushing cs.
Second passage ends with the sound
signal. Now the program can be run (see run) or write to disk
(save code).
Want to note that the time
assembly, mainly depends on the number of labels, and from,
say, the length of the text - much smaller. From this very
simple conclusion: do fewer labels, and a formula for
approximate computation time assembly: t = 0.000163 * n ^ 1.72,
where t - time in seconds, and n - count
tags.
3.1. Errors
When an error is detected, the
It prints a line with the error below - its number, name
errors and, if the text is loaded loadtextom or simply found on
the second page, it name. In this line is marked in red (see cs
/ ent), that it can be easy to find
and edit ((c) I).
Error List
No Label - there is no such label;
Syntax In Number - syntactic
Kaya error in number;
Label Exists - issued on the first
PTO pass; label with such
Kim name already exists
(See introduction);
Syntax - Syntax error
in the parameters of the operation (in
Example (ix +));
Target Too Far - surgery or jr
djnz can not jump
so far;
Number Too Big - in operations, not
related to (ix / iy + d) -
just a warning,
that the parameter is
number beyond the admissible
timoe for the opera
tion (for example, bit 3 +15,
a), in this case will be taken
number of significant bits, in
The parameters for (ix / iy +
d) may indicate an error;
Fatal Error - usually an error in
parameters of the operation, which
Paradise exclude the possibility
its assembly (ld
sp, bc);
LTB Over - no more space in
table tags, is showing
Camping on the first pass and
stops assembles
tion;
No File - file does not exist in teams
loadcode and loadtext;
Skipping - warning
ignoring commands
loadtext, if it is encountered
tilas in the text in the second
rum window (see below) or
Team loadcode, if
file is missing (in the second
rum pass); Prevention
assertion of the attached! assm;
Attention! At Fatal Error
Error object code is
so flawed that it
can not be used (this
due to the inability to determine the length of the operation,
in bytes, which leads to incorrect
drafting table tags. Other district and if such errors
generally stop assembling.
3.2. Program text
Text can be typed small and large letters, with or without
tabs instead of commas, you can type spaces (Except for def-s).
Small letters typed with the cs. Macros are typed by pressing
the graph and then any key. When you try to
go beyond the line, it will transcode; gaps where
necessary, replaced with a comma tags
to improve readability (perhaps first you will be impacted, but
then, I hope you appreciate my effort) will be printed in small
letters. If the line there are errors, you can not go beyond
it, do not fix it.
Russian letters can not be used in labels.
Instead, (ix / iy +0), you can dial (ix / iy); halves ix /
iy denoted by hx / y and lx / y.
In the ex af, af 'apostrophe can
not to.
At a set of hexadecimal numbers instead of icons '#' you
can press '..'
In the operations ld (adr), rp; ld
(Adr), a; out (n), a; in a, (n)
bracket set does not necessarily
(Ie you can ld l01 +50 / 3, de).
In out (c), r and in r, (c) '(c)'
You can omit the (out l). (* -
no).
Push or pop a few in a row can be replaced by one, listing
the pair through register comma: pop af: pop iy: pop bc =
pop af, iy, bc.
Numbers
Instead of any numbers you can dial the expression, where
- Letters in quotes - a number
consisting of the codes of letters (in
quotes (except defm) can
be one or two letters)
where the first letter - Star
shy of bytes, the second - the younger.
If the letter a, the first
byte is equal to zero;
- Parentheses and operator precedence
are not supported;
- Admissible operations: +,-,*,/
and! - Xor (example: "B"!
# 80, 1520! Label1! # F001).
Supported by the binary number
la, they must begin with
'%' character and be in the range
Zone 0 .. 65535.
Another two logical operations:
'L - to take only low byte
'H - to take only the most significant byte,
placing him in the minors, ie
# 5cf4'h = # 5c;
'L - the result of a cyclic shift to the left,' r - the
same right, ie # A703'r = # d381. If have moved several times,
then operation is simply a duplicate.
Features
(Def, work, ent, org,
loadcode, loadtext,! assm)
defs - supports up to two
parameters, if the second parameter is no, then it is accepted
zero. The second option -
two-byte number, which will fill the memory defs. Examples:
1) should be 15 zeros - defs 15
2) have 31 push af - defs
31, # f5f5
3) should be 10,0,10 - defs 3,10
4) have 32 ldi (ed a0) -
defs 64, # a0ed
work - you can create
program, working not with those
addresses to which they will assemble. Parameter indicates the
address from which you will run the program. Applies to the
whole program and All org'i and retains its influence to work
without the option parameter. Recommend to put it at the
beginning program after org'a. Example:
need otassemblirovat program to work with address 0:
org # 9000
work 0
lab1 .....
org # a005
lab2 work
lab3 .....
lab1 label will have a value of # 0000, lab2 - # 1005, and
lab3 - # A005.
ent - allows you to specify the address from which this
program will run the team run. Used without an argument.
org - indicates the current address for the location of the
program. Org'a If not, the address will
is # 8000. Attention! If the
the beginning of your text org'a no
but org'i is on, and if they
more # 8000, the length of the object code will be calculated
wrong! (Will not be counted org
# 8000). Therefore, if you wish to save code, then
in this case should be put in
the beginning of the org # 8000.
loadcode "name" - the name must
be quoted; boot file
type code;
loadtext "name" - if in
second page already have a file
with that name, the reference to
ROM does (!!!), if
is not, then it is loaded
there, removing the text that there
was before. From the second page, for obvious reasons, does not
work. If someone does not know what such loadtext - this option
allows you to have a program in assembly, consisting of a set
texts that are loaded and assembled one by one, with They use
the same table tags, so some of the files may be freely refer
to the labels from other files.
! Assm! On /! Off
Still has the original option! Assm, which may have
parameter! on or! off. It gives
able to allocate chunks of text that should be otassemblirovat
only once, or do not have to assemble. Parameter! On means that
the option ! Assm ignored, but after assembly it will be
translated into! Off. ! Off also causes Pass the text to an
option! cont. Example: You write drayverok press, which enjoys
a downloadable fonts. So why did it load at each assembly? You
can download it only once, and then it will sit in memory:
...
font org # 7000
! Assm! On
loadcode "font51"
! Cont
org # 7300
...
or you do not need to assemble some of the code, and
not to score all the lines in
comments, simply limit the
their options! assm! off and! cont.
! Assm n (* - No)
The parameter n - number of repetitions. Allows
otassemblirovat piece of text to an option! cont n
times. Recalls defs Tasma, but
an order of magnitude steeper than it:
! Assm 128
ld hl, 0
push hl
! Cont
! Assm # 50/2-% 0101
"I zachem eto?"
ld hl, 0
all 1
! Cont
Instead of n may be a label
if it is defined above.
Put between tags! Assm n and
! Cont is not recommended. Use $.
Nesting! Assm with any
parameters is not allowed!
defm - instead defm "string"
You can simply type "string",
In this case, the number of characters per line will increase
to 40.
defb - if you defb
only hexadecimal
you can instead defb # n1, # n2,
# N3, # n4 ... just dial # n1n2
n3n4 ... Here, the first '#' character
optional, and each number must be typed using two digits
(0 = 00, # a = 0a ...); numbers for clarity, we can share the
icons '#' (# n1 # n2n3 # n4 ... - as whatever) and, of course,
instead of '#' You can press'. "
4. Macro
Macros are typed by pressing the
graph (cs / 9) and then one of
Shift keys with or without. When
This screen will be printed on a string
is assigned to a macro file of this letter. Macro file
constructed as follows: he
consists of lines, where the first
character must be a ';'
second - a symbol, when clicked on the screen will be displayed
line, which is located at
this second (ie, up to 40 characters). If at the end of the
lines needed spaces, the latter space should be replaced with
underscores (ss / 0), otherwise they will be cut editor. If it
is necessary that after the withdrawal of the macro is
automatically pressed enter, finish the macro point.
The length of the macro file should not exceed # b20, then,
actually, quite enough to have a macro at all possible
characters (about 90). Length limit associated with the table
of marks: under the block copy operation is a macro cut to
specified lengths. If in your program a huge number of labels
(> 1500), the file macros in memory may be
partially or completely destroyed, which, however, to hang
will not, just if you
using macros, you will have to restart.
5. Text Format
Section for those who want to
Decoders and write their
others or to understand the work
p-a ...
The first 29 bytes of a file stored
comment, then 2 bytes - the address of the current position in
the text (Address _nachala_ current line);
on 2 bytes - the current cursor coordinates (x, then y); 1
byte sign ovr / ins; 1 byte -
Number of File Revisions (0 .. 127);
B # 01 - sign of the beginning of the text. Format of text
strings explained by example:
Screen:
label LD HL, # 4d00-"a"; EXAMPLE
Memory:
LABEL ', # ac, # d2,' # 4D00-"a"; Example ', # 0d
tags are stored in large letters;
tabs are not available; commas
can only be in the comments, quotes, or as
dividers in defah; gaps
can only be quoted or
in the comments, the last byte
line can be # 0d - Line
Conventional color, # 09 - yellow
or # 0c - red;
an example:
LD (IX + "1" / 2), "V"
in memory:
# Ac ,'(',# d3, '+ "1" / 2) V', # 0d
Russian letters: Similar in shape with Latin in the Fonte
do not duplicated and have codes of Latin, the other codes are:
DZHIYLPUFTSCHYEYUYA - from # 10 to # 1f,
SHSCHBG - with up to # 7b # 7e.
And thus the last byte in
the text should be # 00.
6. Programming Tips
Newcomers
May, of course, it's arrogance
on my part to give any advice, but still I have already written
two major programs, so that something could be you
useful.
1) Try to plan
software before writing it.
Similarly, decide what it will do and how.
2) Try to do less
labels - and will assemble
faster, and will not have problems with
Overflow table - use the icon '$', which means the current
address, if there are a few notches, it can be
turn to one using
+ name of the other shift.
3) to save memory, use the following things: if
you need a cell, then do not do
like:
label defb 0
....
ld a, (label)
....
ld (label), a
and replaced by:
label ld a, 0
ld (label +1), a
As the cells for storage of anything you can use variables
BASIC. For, For example, the press, through its
Driver can override the channel and use the rst 16.
About speed: remember
that works faster jp jr, ldi
faster ldir, the fastest
way to stuff into memory byte
or take it from there - it
push and pop.
4) On the '$': Remember that $
specifies the address of the beginning of the current
operation, ie
label djnz label is equivalent to
djnz $
rather than, say, $ -2.
7. Recoder
Recoder wrote hacker Cris, and the thing I can tell you
pretty cool: it encodes
of the gens, isdos assembler or
tasm 3.0 xas in and out of xasa in txt,
and text format (gens / isdos / tasm / xas) defines itself,
so I think in general not necessary.
In a conversion in it xas
writes the number of errors - overflow line (as in tasme and
isdose line 255 (?), but I have up to 42 characters long and
lines are cut in half. At the same time
line will be marked in red
color, and it can be easily found in
xase (at ss / y / u) and corrected.
After the conversion may glyuchok: when assembly is an error,
then as a string looks fine.
Here we have to just stand up to this
bar and hit anything other than the cursor up and down. For
example, you can simply press ss / u or y.
8. The End
Well, all over this destructive work on getting your helra,
Now you can relax and admit that all the help and all Xas
Max Petrov wrote from St. Petersburg in January 1996 with
phone 598 0159 (for which
You can report a glitch).
And also to say that recoder wrote hacker Cris,
seems not without the help of his
Virtual brother Johna Stunnera. Thank them for that, because in
time, the writings they have caught some
glyuchkov in Xase. Johnnu another
thanks for the acceleration of Pts. small, but very good.
important protsedurki, which resulted increase the speed of
assembly by 15% compared with baseline, but most of all I thank
him for the fact that its acceleration got me thinking about
another greater acceleration, and I got
another 32 percent reduction
time assembly ... As a result, the score in our favor
increased by half.
And, finally, to convey greetings
and wishes for happiness in the new year all users, players,
hackers and sympathetic.
*
Other articles:
Similar articles:
В этот день... 24 November