another new assm...
ZXNet echo conference «code.zx»
From Alexander Bondarenko → To All 1 May 2000
Greetings, All!
In general, in the “Anomalous Zone” we have been brewing assam for about a month and a half, almost
the shell has been written, there are some things about the editor, but it’s still 100% complete
the implementation of the language concepts did not come to fruition. That's why I would like to publish
something about this, see how people react. Before it's too late
make changes to this...
══════════════════[ asm.tx .C ]═════════════════
Assembler.
1. Expression evaluator.
1.1. Prefixes:
# - hexadecimal value;
% - binary value;
"..." - character code (two characters);
For fanatics of the "bourgeois" type of defining non-decimal numbers, there will be
postfixes: NNNNh, NNNNNNNNb...
1.2. Unary operations:
- - minus;
! - logical "NOT";
^ - contents of the memory cell;
1.3. Binary operations:
+ - addition;
- - subtraction;
* - multiplication;
/ - division;
= - equality;
> - more;
< - less;
- remainder of division;
& - bitwise "AND";
@ - bitwise "OR";
| - bitwise exclusive "OR";
1.4. Functions:
def() - sign of label definiteness;
used() - sign of using the label;
inv() - bitwise inversion;
hi() - high byte;
lo() - low byte;rhb() - rounding up to the most significant byte;
type() - determining the type of expression;
0 - type is undefined;
1 - number, expression;
2 - macroline;
3 - structure template;
4 - structure;
5 - register;
6 - register pair;
7 - regular string in quotes;
ltyp() - the same thing, with the addition:
+16 - mark
+32 - in brackets
len() - the length of the macrostring, although, however, it will also give the length of any type,
for example - structures.
str() - converting a value to a macrostring;
1.5. Macros:
Did you see the #define directive in C? In general, this is a one-line macro, also with
parameters. Identified using EQU or =, the string is in apostrophes.
Label='12345' - string definition;
Metka='123'+'ABC'+Label - merging strings;
Label[1] - 1st character of the line;
Label[2 to 8] - fragment from the 2nd to 8th characters;
Label[to 4], Label[5 to] - ...;
*INIT Label - set a pointer to the beginning of the line;
*NEXT Label - move the pointer forward;
Label[.c] - current character of the line;
Label[.sc] - line from the current character to the character c;
^Label - the numerical value of the first two bytes of the line;
This is how things work with parameters:
Label='(IX+;0)'
LD A,Label(4) = LD A,(IX+4);You can compare two strings in expressions to see if
identity (=).
By the way, parameters in a macro are also macrostrings.
1.5. Existing definitions:
$ - current execution address (the one at which JPs work);
$p - current placement address (the one where the code is placed in memory);
$m - current posting page;
$r - starting address of the program;
$е - the first free address of the current segment, or,
end of object code in segment;
2. Translator
2.1. Conditional translation directives:
IF v - if v is not 0, turns on the flag
broadcasts, otherwise it turns off. Has no varieties, they
are specified using a set of functions;
ELSE - inverts the translation flag;
ENDIF - turns on the translation flag;
ASMOFF - turns off the broadcast flag;
PROC label - turns on the translation flag if the label is not
defined and used (definition of procedures in the library
kah).
2.2. Macro definition directives:
MACRO - set a macro with the name preceding the directory
ty label. All macro labels are local. Access to steam
meters:
.0, .1, .2 - 1st, 2nd, 3rd parameters. Also, access
parameters are accessed through the labels after the word
MACRO. All parameters are macrostrings in expressions;
.m - macro call address;.l - the label before the macro call;
.p - the entire line of parameters;
*INIT - set the pointer to the 0th parameter;
*NEXT - move 1 element forward;
.c - current parameter;
ENDM - end pointer for macro definition;
DUP v - repeat a piece of code up to ENDM v times;
*EXITM - forcefully exit the macro;
DEFCOM is a special macro definition. Mark standing
before the directive, must be a command. With the help
cabbage soup of this design, you can create extensions of the existing
current commands;
*ERRM is similar to EXITM, but sets an error flag.
Required if it is discovered that the extension parameters
mands are not supported by this macro. In this case,
the translator will move to the next extension of this command,
or, if all extensions are exhausted, it will display the message
about the error. In a normal macro, this directive interrupts
broadcast.
Example of using DEFCOM:
Emulation of commands like LD rr,rr
LD DEFCOM rr1,rr2
IF !(rr1="DE" or rr1="BC" or rr1="HL") and
!(rr2="DE" or rr2="BC" or rr2="HL")
*ERRM
ENDIF
LD rr1[1],rr2[1]
LD rr1[2],rr2[2]
ENDM
2.4. Directives for working with files:
INCLUDE "[d:]filename" - include a text file;
INSERT "[d:]filename[.ext]" - insert a file;MAKE "[d:]filename[.ext]" - further assembly
production (before the first ORG directive) to a file;
2.5. Placement and execution directives:
ORG v[,p] - place further code from address v in
page p;
WORK v - make the execution address equal to v;
UNWORK - disable the action of the previous command;
DEFSG name,v[,p] - define a segment with the name name,
starting at address v and located in page p;
SEGM name - place further code in the na- segment
me;
SEGHB name - similar to the previous one, except
that the location address is rounded to the most significant byte;
UNSEG - completion of the previous directive.
"Enables" the previously installed segment or the main one
Main, enabled by default;
ENT v - set the program launch address (for
mands Run);
2.6. Directives for working with tags:
EQU v - assign the value of the expression v to the label, can
be executed only once. The value is assigned to the label in
first pass time;
= - full equivalent of the previous command, except
ie something that can be used over and over again. Meaning
assigned to the label during the second pass;
*GLOB label1,label2 - make labels global. Is-
used in macros;
2.7. Data insertion directives:
DB n,nn,"..." - insert 1.2 byte data or
string;DW nn,nn,nn - insert 2-byte data;
DS v,n1,nn2, - insert a block of length v, filled
sequence n1, nn2, or zeros (default);
DU v, data - analogue of DB, repeated v times;
STRUCT - define a structure (template), with a name
label preceding the directive and with fields named
further labels, up to the ENDD directive;
ENDS - complete the definition of the structure;
Example of using structures:
1. Specifying a template:
Object STRUCT
XDB 0
Y DB 0
Energy DB 100
Flags DB %00010010
ENDS
2. Inserting a structure:
Man Object
Whoman Object
Objects DUP 100
Object
END...
3.Usage:
LD A,(Man.X);Field Access
LD B,(Whoman.Energy) ;...
LD B,(Whoman+Enerdy) ;Similar to the previous one
LD IX,Objects ;B IX is the address of the object buffer
LD BC,len(Object) ;In BC - the length of the Objects structure
ADD IX,BC ;Go to 3rd object
ADD IX,BC ;
LD A,(IX.Energy) ;Access to the Energy field
LD A,len(Energy) ;B A - length of the Energy field
LD A,Energy ;B A - field offset from the beginning
;structures
2.8. Service directives:
*PRINT v - print the value of the expression;*GOTO Label - go to the label, does not allow exit
from macros;
*POKE v,a - enter the value of a at address v;
2.9. Pseudo-tags:
Definition - @a, @b, @1, @2... Usage - ana-
logical. Can be defined several times and used
will be the last definition. They have all the properties of conventional
numeric labels.
════════════════════════ ════════════════════════
In general, I'm waiting for healthy criticism.
And may the Great Creator be with you, All!
From Slavik Tretiak → To Kirill Frolov 8 June 2000
Hello2 Kirill
KF> First, it’s worth separating the assembly from once and for all
KF> editor.
Do you mean asm in the image like on CP-M? Probably yes.
So, what do we have there: Editor, Assembler (in *.OBJ), Linker, whatnot
something. And everything is in different files.
Now let’s imagine the process of writing a COOL program
(healthy!). We write it in the editor. Let's compile... Oh, damn it,
mistake! We load the editor back, compile it back...
And so on and on. Then we successfully (?) link and our cool
the program immediately hangs :( And the whole process repeats again.
About twenty times.
What if asm+editor in one bottle? Firstly speed
work is much higher due to the fact that you don’t have to load a bunch
files separately. Next, how convenient it is to detect errors!
I pressed a couple of buttons, and... either OK or an error. moment of her
We'll fix it further.
And even on your favorite PC, the TASM package consists of a primitive
editor, assembler itself, linker and (!) program,
which combines it all in one bottle!
So, there is no need to lead people astray.
From Alexander Bondarenko → To Kirill Frolov 10 June 2000
Greetings, Kirill!
On Thursday, June 8, 2000, at 00:23:28, Kirill Frolov wrote to Dmitriy Nesmachny
about “another new assm...”. I would like to say the following:
AB>>> ORG ,page :)
AB>>> (too lazy to type #C000 every time...)
DN>> Then make the ASM itself print it, just so that it’s in the text
DN>> was!
KF> First, it’s worth separating the assembly from once and for all
KF> editor.
Mr. Frolov, of course I deeply regret it, but I’m afraid that you are a little out of place here.
right... ;)
If I use plain text (ASCII) format in my assembler,
then most likely this will affect the speed of assembly and saving space on
disk. Therefore, I have already finally and unconditionally decided for the text format
use the machine code format of the Z80 processor that was already invented a long time ago.
That is, roughly speaking, my compilation will occur after the introduction
line and pressing ENTER. Therefore, when selecting the "Assemble" option, there will be
there is a banal copying of pieces of data from one memory location to
other. Then, naturally, all that remains is to count the marks.
So, in this situation, the editor should already contain a compiler.
And I don’t care that the ASMO compiler is separate on the computer and in the CPUprogram. As for the pussy - that's their business, but as for the cp/m - I saw how m80 is there
works...
Come on, Kirill, don’t be glitchy!
From Kirill Frolov → To Dmitriy Nesmachny 11 June 2000
Press RESET immediately, Dmitriy!
08 Jun 00 23:02, Dmitriy Nesmachny wrote to Kirill Frolov:
KF>> First, it’s worth once and for all separating the assembly from
KF>> editor.
DN> On spec this is inconvenient, historically it has developed that the editor
DN> is integrated into ACM, it is not designed for editing any text
DN> and for the creation of an assembly program, therefore, in my opinion, such a system
DN> better than the current one on Mazda
Question - did you work a lot at Mazda? There are special editors...
But it never occurs to anyone to assemble directly into memory.
DN> and in isdos, where the general purpose editor is
DN> is used to write the source.
What do you think a general purpose editor is?
My 'programming' and 'text' editors are so different
very noticeable. For example, the first one requires virtually no transformations
It can’t do anything with text, but it may have other useful functions...
DN> For example, in a combination of “assembler + editor” in one bottle we have
DN> ability to get normal standard assembler text by clicking
DN> fewer keys (alas, this is not implemented in the storm),You remembered that assembler from 1982, where the mnemonics are like in BASIC
were introduced? Is it really so difficult to type a whole word? It's not difficult for me
I’d rather press 10 times more keys and get more readable text.
It takes many times more time to think about it than to actually enter the
keyboard, which in general, with a certain amount of experience, is performed without thinking
purely automatically.
DN> using a separate editor - asm you can only reduce typing time
DN> such a price as DL paid:
DN> storm sources cannot be considered an assembler program. :-(
Uh... wait a minute... These are the sources from XAS, ZXASM, STORM etc, it’s difficult
count
assembler programs. First of all, nothing is clear about them. A
secondly
An assembly language program is TEXT, not a jumbled set of bytes.
Yes, I already wrote - you can have a special editor, but not necessarily
When editing text, have a translator from assembler in memory. And what
It's inconvenient to load something on the Spectrum, because these are exclusively TR-DOS problems.
Well, for some reason all these zx-asmas are assembled into memory, but as a program in
memory
Nobody ever thinks about posting WITHOUT assembler. Why do I need a program in
memory?
Launch? Why should I launch directly from ASMA? If I debug it
I'm going tothen this is done from under the debugger. There is no debugger on the Spectrum... STS or
shadow
The service doesn't look much like a debugger, it's more like cracking-tools. In the debugger I
should
see the text of my program, local labels separately global,
disassembler,
memory dump, registers, machine configuration... What's in STS? Only or
disassembler
with half registers or dump.
And why this assembler is needed for TR-DOS is not clear, these assemblers are up to
There are all sorts of stupid things, but none of them are of any use. Before CP/M
M80 (C) Microsoft 1981 is far from them... Example - there is nothing on the Spectrum (without
CP/M) assemble Kondratieff DosX sources for Dickie. You can only
drag and drop into ZXASM, with a creak...
And for ALL Z80 assemblers on the Spectrum platform there is one global
The problem is that it is not clear how to load the resulting code into memory. Need some
a special format describing the placement of code in memory is needed
appropriate
loader and linker. For some reason no one encounters this, is it strange?
From Alexander Bondarenko → To Sergey Selev 29 June 2000
Greetings, Sergey!
On Saturday, June 10, 2000, at 00:06:10, Sergey Selev wrote to Dmitriy Nesmachny
about “another new assm...”. I would like to say the following:
SS> What kind of asm are we talking about?
Yes, I decided to move things forward here (in terms of soft emission),
and in general I wanted to have a more sophisticated ass and without defects, which are like
no matter how sad, there is in each of the currently existing assmas (in any case, and in mine
they will be, since everything that is created likes to become obsolete along the course of scientific and technical progress). A
so in a nutshell -
Directives, syntax - ala TASM on PC + something of its own; ;)))
Structure - mini-OS + overlays (or “applications”, depending on your choice);
Support from the top - yes;
System requirements (minimum) - 128K + 1 disk drive;
Pleasant little things - AY-musak, colorful editor, etc... ;)))
Estimated release date - autumn 2000;
Projected release date - New Year (2001);
The working title of the project is Asm-2000;
Come on, Sergey, don’t be a glitch!
p.s. Once I finish the session, I’ll push myself harder and cook up a demo version (editor + more
something...)