News - I’m working on the NedoLang compiler, AmoNik measured the consumption of different devices
News
by Alone Coder
Now I'm mainly working on the NedoLang compiler.
The main part of the program (10 modules - previously there were more due to
header files) which directly compiles, I already
translated into NedoLang language, module by module. Into the language for this
I had to add some speed to import constants, variables and
functions (header files and#include are not used). But this
is still not the final version of the language, because NedoAsm is not yet
it is impossible to translate into this language - the lack of an operator affects
switch and definitions (you could get by with enumerations instead
them, but there are no enumerations either). However, it is already possible
summarize some statistics after 6 months of the project:
- 346 KB of sources, not including GUI. Of these, 191 KB - itself
compiler (produces assembly text). The rest is tokenizer
assembler, assembler exporter (detokenizer) and itself
assembler
- with comments disabled, output assembler text
compiler (which was 191 KB) turned out to be 500 KB. During
compiling the largest module uses 11 KB of memory under
labels (previously 10 KB were allocated for this matter, now not
enough).
- from this assemblerThe text turned out to be a 57 KB binary
(including memory buffer for tags and other buffers). During
assembly uses about 60 KB for labels (I highlighted
128 KB just in case, because assembler plays a role
linker and must know all the labels of all modules).
It doesn't make sense to release this yet. It’s worth tightening up the work with
files and the screen, how the compiler will fall out of the address
space, and the assembler has already fallen out. How many floppy disks do you need?
for self-compilation... three at the same time?
You can work in several directions:
- optimize the compiler source (for example, reduce
text messages, of which there are too many);
- improve code generation (at least register allocator);
- make support for far calls so that you can write as much as possible
any code;
- support far pointers so that you can highlight
as much memory as you like;
- during assembly, somehow throw out
local label tables;
- also assemble in parts and add a linker to the system;
- stream assembly text so that it does not take up space on
disk. To do this, you will have to buffer the contents in memory
variables and constants. Now it's just generated
in parallel to another assembler file. And then it won't be possible
compile the program in parts (is this necessary - that’s just
We'll find out when we measure the compilation speed).
It is unknown how long each of these jobs will take.There were
other suggestions - for example, making overlays (suggested
deathsoft, which manually counted about 4000
transistors in the VGshka, they are also withLord Vader in three different
C compilers have dug up some bugs in NedoLang). But I don't want to
tie the system to constant loading of overlays. Preferably
the entire system (editor, compiler, assembler and launcher
program) to be kept in memory at the same time. For this, of course,
support at the operating system level is required.
I would like to be able to start self-compilation earlier, so that although
I would like to know which parts of the compiler to optimize for speed. I
I don’t even know yet what the speed will be. Judging by the size
assembler file, in its existing form - clearly more than a minute per
3.5 MHz. But I would like not to go beyond a minute.
It may be more beneficial to integrate the assembler into the compiler.
Of course, inline assembler won't be as fast as
specialized (which assembles from tokenized
text). But the future scenario for working with NedoLang involves
prototyping a program in a high-level language, then
gradual translation of the slowest procedures into assembler. That's all
There is no point in translating the procedures. On the other hand, someone might
want to write straight away in assembler.
As a compromise, it can be built intoNedoLang tokenizer,
so the output will be tokenized assembly text.
To do this, you will have to add another 98 KB of source files to those 191 KB,
that it won’t fit into the existing binary.
Or the third option, the most user-friendly, but the most
difficult to implement - rewrite the assembler in such a way that
it will be able to compile as part of a compiler (i.e. a binary
the compiler will swell twice), and separately. But we need an opportunity
upload assembler text.
There is, of course, the option of cutting the language down to some kind of
Pseudo-C, where one loop statement, two types, no parameters
functions, modularity, etc. But then it will be impossible for them
use for real tasks.
There is still always the option of transferring the compiler to
assembly language, but then future development environment support
will obviously become more complicated. Wait and see. Maybe this will be enough speed.
Especially if you implement compilation in the background :)
* * *
This time I couldn’t go to eitherJohn or the film studio for general
meeting (more precisely, once I went to the studio withLouis, but
we didn't get to class, but to the game "What-where-when").John says,
what Mouzon writes. INHe mainly repairs computers.
While I was typing up this number, my PC just broke down - at first
the keyboard went crazy, then something clicked, the computer froze, and
Then it stopped turning on altogether. And the mouse started playing even earlier
Dasha. There are a couple of laptops left. And this is at the moment when to me
contactedWanderer (author of the games MURKЗЗ20, MURKЗЗ27) on the topic
copy Spectrum floppy disks with the source of the unfinished
games. Someone else will have to copy it. Suddenly realized that
All my work computers are at least 6 years old. B
sometime in 2000, such a situation was difficult for oneself
present, including on the Spectrum...
There are also notes on music from other authors, articles for the magazine
are also written. There are just no graphics.
Very possible material sentAmoNik - old archives, echoes,
memories.
In the meantimeAmoNik measured the consumption of different devices (saw
there are disputes on the Internet about this today) - this is in a separate
article. He also improved the IDE driver for iS-DOS, which
In 1999 it was madeOleg Grigoriev. He had the same problem -
does not work with modern devices. Or rather, specifically with his
by cardmemory that does not return sector coordinates at all
registers.
I give him the floor:
┌───────────────────────────────────── ─────────────────────────┐
The original driver came to me in the form of an archiveSMUC.ZIPin
mid-2000s directly from its author -Oleg Grigoriev.
Oleg wrote a fast and compact driver, but did not finish it for
his customizer, saying that he has iS-DOS partitions on the disk
a little and he simply wrote them all directly into the driver body before
its compilation. As far as I understand,Olegtook the driver as a basis
Valery Kozhevnikov and remade it a little. After this
The redesign of the driver has become shorter and more logical.
In 2006, I made an LBA version of it, but for some reason
reason, the new driver did not pass testing and I
I forgot about him for a while. In 2017, I cleaned the folderTEMPto
system disk from debug versions of programs and came across
this driver is in the folderNOTWORK.ING.No notes on this
I didn’t find any reason in the text. Therefore it wasit's not clear what exactly
doesn't work. Just in case, I compiled the driver and checked
its work on the test partition of the disk - and the driver completely
passed the reading tests but failed them while writing.
I dragged the driver into ALASM and sketched out a set of test procedures.
After spending a little time debugging, I found and corrected that fragment,
which does not work on modern devices. Then I remade it
connecting partitions to the driver, using HDDLSERV as a basis, and
after that I carried out comprehensive testing of the driver, by
copying your 8 MB system disk to the test one
section of MASTER and SLAVE devices. Checking the checksums
files on the copy, I made sure that the driver works.
As usual, the driver requires the SMUC IDE ports to be always open and
works in iS-DOS Classic and Chic versions. I think it has
it makes sense to switch to a new driver, since it is noticeably shorter (by
230 bytes) of my HDDLSMUC. Just in case I did
universal drive connection to the driver and called it
HDUNISRV. This program can work with both HDDLSMUC and
RHDDLBA. The driver name is specified as a parameter in the command line
line. For example:
hdunisrv Rhddlba - connects disks to the Rhddlba driver.
I’m also posting the author’s archiveOleg Grigoriev.There are several
versions of its driver,some rudiments of a configuration utility and
test procedures. Maybe someone will think this
interesting.
Share your thoughts about the article