📜 ⬆️ ⬇️

One byte history

Preface.
This story has a long history. For many, it may be a terry button accordion, but it seems to me that it is worth it that new people read it.
In all sources, where I met his information about the author were simple and unpretentious: Dmitry Galuscenko. If someone can specify a website or e-mail - write in the comments, I will gladly add.
So, let's begin.

I lacked a byte. Just one. Yes Yes. The one that consists of eight bits. What? No, I'm not crazy, although only God knows how thin the border separating me from this state was. But all in order.

I am a programmer. But not just a programmer. I belong to the caste, which is sometimes called the system analyst, sometimes the crystal. Do you know what it is? I will explain if you are patient. I can not do without specificity, but otherwise you will not be able to understand further.
')
We program single-crystal chips, roughly speaking, this is when the whole computer is in one crystal. Program memory and data memory are separate and do not interact with each other. The program can not be run in RAM. The depth of the software stack is limited. The maximum that I can count on is eight levels of nesting, and I cannot change the maximum stack depth. Oh, you do not think what! I have an abyss of resources. RAM already 128 bytes! It's all about everything. Variables, there and there ... Presented, yes? With program memory is also not bad. Already eight kilobytes. And it is quite easy to use. First you need to programmatically cut in the necessary memory bank, run the necessary procedure in it, and after leaving it, do not forget to return where it was. Yes, it must also be borne in mind that within the bank I can move only by jumps and procedure calls, and transitions under the conditions are possible only within one page, i.e. 256 bytes

This means that if I compare two bytes and need to branch, but if the label is not within 256 bytes, then this letter will go to the village to the grandfather, and the compiler will warn you half the time, they say, you’re walking a wide belt, you’ll take care of your pants. And these are just flowers! Berries I will now lay out to you, what would you fully enjoy them. I do not have a subtraction command. At all! add only Oh, about the luxury of multiplication or division, I generally keep quiet, this is for lazy people. But I need to provide decimal math. Do you penetrate slowly? Codes of such toys are licked so that you never dreamed of, especially if you have to solve problems at the limit of operational and program memory. Sources are rewritten more than once. It is not enough for me just to solve the problem. I have to shove her into this damn crystal! Restriction on variables, on the size of the code as a whole, on the size of each procedure and on the number of calls. The slightest oversight and ... the stack is knocked out, and the devil knows where to throw it out. And the compiler will not help. He doesn't catch that ... Do you think this is all? ;-) Hey, my dear. My toy works in real-time ... This is when, in front of each tiny procedure of my code, you need to calculate and write down the time of its execution in milliseconds. My modules should not work more rigidly fixed time, because I still have to scan the cybord and the display, keep up with the sensors and issue control signals, and everything else should work without interfering with the scanning, otherwise I will miss the button press, or the display will flicker unpleasantly flicker by changing the brightness. But that's not all! I have an interface.

Regular writing RS232C, the so-called comport. But if you think that it is a separate chip, they say, thrust a byte to it, took it from the byte buffer, then you are mistaken. Cost price. I do all this with handles, telipaya the only bit of the port. Handles twist the chart of starts, stops and data. So:

If I rolled the code of the solving task, but it does not fit into the memory - the problem is not solved. If at the same time I created a greater number of variables, and they do not fit into the RAM, the task is not solved.

If all Oki-doki, but the procedures are too long, the real-time diagram is destroyed - the problem is not solved. If the procedures are too short, there are many of them, the stack is exhausted - the problem is not solved.

Any average programmer, put it in such conditions, shoot himself on the second day. In general, in my opinion, the guys working in this field have nerves of steel and an indomitable will to win. We rarely communicate with regular programmers — we generally have nothing to talk about. And not because we are snobs or proud. Not necessarily. It is hard for us to imagine programming under inexhaustible resources in high-level languages. Little screw? Buy another, what's the problem? Little frame? Buy more, push into the slot. Mega codes? And I do? This compiler is to blame. Buy a bigger car. These are like different planets and I hope you understand why.

It's like a beautiful white ocean cruiser in the vast expanses of the ocean, swim wherever you want. And you try to steer it in Finnish skerries. ;-) Or thread a needle in the middle of the night. Moreover, the black thread.

Of course, we also have sets of crystals and choose them before working out with greater meticulousness than the bridegroom, and we guess at the coffee grounds and other available means, but is there enough? But, if the choice is made ... Backward move, as a rule, no.

Well then. I introduced you to the subject area and can continue my story.

I didn't like the crystal right away. I immediately understood - cramped. All at the limit. The legitimate 20% of the reserve for the resource, for possible errors - do not comply. However, the remaining candidates were highly redundant, and therefore expensive and irrational. The cost price decided everything, I finally gave my consent and the powerful and proud beauties Intels and Motorola of the latest models were left behind.

At first, everything went as it should. A couple of months of work and the crystals were stuffed with code, the tests went well, the boards were divorced and worked out, the gears slowly rotated and, gathering speed, spun, putting into operation a complex and cumbersome production machine. And only I occasionally had a little heart, because everything was done very tightly! Three on the strength of five percent of the resources left free. And that damn little, take my word for it.

Although the work was done quite well, and I received my rightful reward in the form of a portion of the pleasure of what was done. Of course, a couple of places are quite adventurous, in some places looser, but on the other hand a few highlights have turned out.

And here ... Here it all began. There is a lack of a very important function of the device, which the producers missed. And not even they, but the customer. It was he who suddenly remembered that here, they say, guys, here still there should be such a trifle. Well, sheer nonsense, honestly, but without it in any way. Well, forgotten when staging about her, who does not happen? But is it easy to add at all, compared to the rest of your frills? Again, thank God for not having forgotten the sensor. This is just a program!

These producers !!! Their karma to understand what the customer needs! Even if for this you need to cut his skull and sift through its sieve all its contents!

But screaming the case will not help. And I sat at home for two weeks, forbidding me to bother. There was a little siren and a traffic light in the brain. Beep! A flash of red! The first software bank is exhausted! Repacking. Optimization of code placement on pages and memory banks. Beep! RAM exhausted! Revision of the functionality of the procedures. This variable nafig. And you can do without these if you take a different path here.

Beep! Stack failure! Straight snout in the bottom. Like this!? I'm already on the eighth level !?
Beep! Going beyond the limits of visibility of intra-page transitions!
Beep! Violation of real-time conditions, procedures are eating too much time!
Beep! Exhausted second bank memory!

And so many, many times. Painstakingly, byte by byte I pushed the body of this
Damn new function, continuously repacking the placement of code on pages, banks, optimizing the size of the code, the real-time graph, the use of RAM,
and that, and simply rewriting modules from scratch.
Maybe you think eight kilograms of binary code is not enough? Ha! The instructions are one and two byte. This is not a three-byte log or even Intel's eighty-byte. From time to time a friend ran to me, as, they say, and that, but I was a little inclined to the “for life” idle talk.

After a week and a half, I realized that the matter was bad. I had more than half a dozen decisions and was already standing still. I knew every procedure and function by heart, and every byte in the face! It was all in vain. The picture stopped ... She did not want to come to life!
I missed one byte. It showed all the solutions. Just one byte!

Having run over to a friend, I threw him all the solutions with the time charts and plans of the banks and returned to my den. Sleep. By all means - sleep. Need a clear head. Need a new idea. I'm devastated. The next few days gave nothing. I assembled and disassembled the code, stringing it like glittering beads, and wrapped it in various shapes of the figure, trying to find a form in which all these puzzle elements would form into one whole without a single gap and also without a gap would fit into the place prepared for them.
There was not enough space ... one byte ... I crushed the code, like clay, I made everything with it, but ... one, only one byte!
Probably something similar is experiencing a musician writing a symphony, trying to find a single note that would make your work sound. Or the artist is looking for the same, unique stroke, which will revive the picture. And without this, everything is dead and all the work is good only in the trash ...

Somehow I got dressed at dusk and went out into the street. Underfoot disgusting squealing snow. Everything around was gray and somehow dull. I no longer needed a computer or a printout. The whole scheme was in me ... Or outside of me? She blinked with multicolored mallow flowers, having the form of fancy and something even beautiful three-dimensional shapes, or is it some kind of openwork design?
Thinly scribbled control markers of time marks hanging tightly to these crystals of strange, some fascinating forms. And all this flew, moving and spinning somewhere, in some strangely changing shape of the channel? Pipe? It rushes right up to all its walls, as if by an invisible navigator's command, at the right moment, turning around according to some incomprehensible whim so that the protruding edge does not catch on the obstacle. But what is his captain or who is there? Navigator? After all, will not pass the same! There can not pass! But no! Miraculously, the entire structure somehow gracefully turns around, at exactly the right moment and silently slips ... no!
Stately bypassing the obstacle ... And ahead is next ... And suddenly, the edge of the openwork structure clings with its tiny protrusion. Screeching and crashing! The glittering threads burst and crumpled, and everything is broken up into millions of fragments ...

Good lord This is a stack! It bypasses the stack! That means what it looks like!
When I run out of depth, it apparently clings and collapses with a bang, breaking its openwork constructions ...

In some place I notice a bench with some lonely old woman on it. I need to sit too ... On the contrary, the flower saleswoman stands, dancing against the cold. I do not like old women ... And this ... Some unpleasant, almost nasty. Well, she stared at me? Who is she? What is sitting here? Probably from nothing to do. That they always crowd in the store, and because of them you do not have time to buy anything. And screaming in the trolley bus, what would they have given way. Probably watching these stupid newfangled series, how are they there? Maria? And who is crying there?
What do they all understand !? Who can understand how much knowledge and labor is needed to build this? How many sleepless nights do you need to spend? How much to read? And every day and not at all idiotic novel about love and friendship?

Who is able to understand this at all !? These new-born dudes who call themselves programmers? Sloppy writing on Foxpraps, clippers and BASICs? And everywhere asking questions: but tell me, what team do I need to dial? And what help to read? And when will the manual be translated into Russian? And this is their so-called "software"? Great hundred thousand storey warehouses and accounting? Imperishable creations. All on one person. If there are differences, so in the clumsiness and buggy code. Glitch on a glitch sits and chases a bug ...
That would make them carve their codes in stone, like the ancient stone masters, that they would think a little about what they were writing ... Or are these technocrats? Well this is necessary, to write viruses, what would mean by the filth people made famous for! Ugh!

No I do not want to sit on this bench, in the company of this ... Where am I going? I remembered. I am going to a friend. Can tell what? Damn byte! Why did I get this wrong? Everybody is engaged in their business, why should they be worse than me? Talented people missing everywhere. Something has seen me so much hot ...
A friend, opening the door, silently looks at me. “Well?” “What is well?”
"Tell me only one thing," I say gloomily, walking into the apartment. "Can you give me one byte?" Only one. I am ready to give you anything for it. I do not have enough bytes, you know? Well, I do not fit into the crystal! "

A friend is silent for a while. "I watched your codes."

"So what? Found something? "

"Not." he says softly, and after a pause, he continued: “Immaculately tied lace. Not a single loop. Joints are not visible. Filigree. Piece. Straight lepota. You can put a quality mark on each line. And carve in marble. And everything is uniform, neither seals nor voids. Monolith, but elastic. But .. "

“But 'but'? .. Do not drag the cat by the tail! Do not shake your soul! And without you, sick! ”I explode.

“I can’t understand most places ... I don’t understand ... I just see how it is ... beautiful. Intangible somehow. Do not grasp the consciousness ... It seems that here, but it flies away ... It's like a snowflake when you try to take it in your hand. Or how the sounds of still incomprehensible, but already realized music .. "

“What nonsense are you talking about !? What the hell is a snowflake ?! What music!? Can you help me or not !? ”I roar. “You are a friend to me. Help, eh? You just tell me where to squeeze this byte .. ”I look at him hopefully. “After all, a fresh, unpresented eye. After all, one, only one operator, without which you can do without it! EVERYTHING! Problem solved, understand? And I’ll give you the coffin of life ... forever .. ”I whisper, seizing him by the sleeve,“ After all, there’s up to the line of lines, but I’m just a person, I made a mistake, missed, didn’t notice ... eh? And I do not need anything. No glory, no praise. I just want it to fly away ... What would let me go ... eh? Well, I have no more strength. Well, let's go, let's see some more codes .. ”
“Give up,” he says. "Refuse? From what? ”I do not understand. "Take another crystal."
"You are crazy!!?? How is it different !! ?? Heaps of made boards, installers, installers, salaries, parts !? What is this, jokes !! ?? Do you think it is on a computer, I want, I added a couple of lines, and no one will notice !! ?? Spend zero, but add at least megabytes of code !? And the people? They believe in me! I said - "Yes!" I did agree, although I saw that the resource’s reserve would be almost zero, and they’re ready for everything! Shells, metal, food. They’re just waiting for the code! You know what the change of crystal can lead to ? You know how much this byte will cost! One byte !! "
I myself was deaf from my cry ...
"Fool." The word slap falls to the ground like a bale of wet laundry. “Get back! Forget! We have been with the guys for three days, as we look at these codes. I gathered everyone I could. I immediately realized that there was something wrong with you. You have no mistakes! None. Moreover, we do not understand how you managed to push it at all. ”
My knees buckled and I either sat down, or slid into a chair.
I knew it from the bottom of my heart. And then I began to speak ... It was a strange monologue ...
It was as if someone shouted, whispered and shouted again in my voice:

"... I thought all this time. I realized that this project is not so important as the measure of my responsibility. Well, he will not be solved, well, everything will be altered there somehow. Damn it! Not so important. My shame is there ... The thing is different. In me. You know that I have not been a slave for a very long time, what they say, justifying it is making money for a family. For a very long time I am a mercenary. My services, my programs are very expensive. You know , I don’t undertake simple things. Let them at least make money. I work for myself and for myself. Yes, I don’t care about money for a long time! I have power over me! I need something else! And I carefully hide it. Because I’m ready to do an interesting task for free, but I will also pay for it. You yourself know what it is like !? Well! you make money! There is only one thing that I have never told anyone. When I do, I’m treating ... And don’t lie to me that you don’t know what it is! Everybody knows it! They just prefer not to remember or not to believe! ! It's like in children's dreams. Do you remember? We soar high, high and rushing, squealing from overwhelming delight! And beneath us rush forests, mountains and seas! Do you think it was a dream !? Not! And I realized it a long time ago! Only afraid to say. I was ashamed, you fool! But now I do not care! This is our soul flies! For real! And the mind says that we sleep. Do you understand? And why, when we grow up, stop flying? BUT!? Why?! Why do we stop having this dream? Do not you know? And I know! Because our soul is heavy, because the values, money, conventions of this society seize power over us and our soul is no longer able to lift this burden! How so! Well we are straight, we spread out, what would become a rug, about which they wipe their feet! Oh, what are good reasons, such a reasoned explanation, why it was necessary to bend this way, and how we do it for the sake of someone.
We time ourselves every day, convincing ourselves that we live right. And I do not want, I can not lie more! You do not understand how this relates to this devil's byte !? Everything is very simple. I can fly for a long time! And work helps me in this. Yes Yes! I take off at the peaks of higher voltage in solving my problems. It is impossible to describe!
But I can't fly all the time. I go down again ... And so to the new code in which you need to invest something.I do not know what. What a piece of yourself, or something. But this time I got caught. I was killed by pride. Well, of course! I'm a guru, who knows how to indulgently poke teapots with his nose and in passing to solve their problems! I so like their views on me as a deity. After all, we are vain and I am not an exception.
But now everything is not so! Do you think the problem is in this one byte and how to shove it? Not!I can not push it! But it can not do me! Do you understand?

There is a solution! I can feel it! Only I can not find it! For this, I have to be different! Not by yourself! And someone or something clearly caught me, on this one byte!
You know perfectly well that I am smart and cunning! If the problem had not been solved, I would have gone, slipped away, fell off the hook! But I thought that it was solved, and I was hooked! Caught on this byte, as in the network. And this byte is the size of the grid cell, through which I can not slip away. I went too far ... And I cannot leave and be free again if I do not change something in myself! Completely change yourself, understand? Become a different person! And then maybe the door will open before me ... I don’t know where ... I don’t know what is behind it ... And I don’t know how and what I should do for this ... Yes ... And also the price ... I understood that ... I can’t to be as before ... I can not fly more ... Everything will be over ... "
I slowly stood up and, slouching, went to the door ... "Farewell .." I said dully into the emptiness ...
"... Nerd!" rushed after me, "

" You will die over this program! You will die! Look at yourself in the mirror! Look for you - mercy! Do something! Go to the women, drink smithereens ... "
But I don’t hear anything. "Lord, if you are - help .." Only on the street I realize that I forgot gloves and a hat. And why do they need me? Is this the main thing? And what is the main thing? Why is everything? Who needs all this?People? Yes, they do not care! I need it! Personally to me! I myself have driven myself into a trap and I myself can not get out of it. What is it?Punishment? Lesson, what would continue to ask? Yes, more likely so. Honor I have more than enough. Stop, stop ... How did he say? “To the women?”

The office is warm and cozy. Heater. Clean. Buzzing computers. Daddies, small stands. The girls give me coffee, put buns on me, which I devour greedily, smeared in chocolate. They pour and enclose, looking sternly at his fallen colleague. The girls are also programmers, something out there stuffed, to the delight of personnel and accounting. They are neat, with make-ups, great, in a word they look, especially in contrast to my multi-day stubble, and maybe already a beard? I briefly and reluctantly answer questions that, they say, brought me to life. “Not solved. AssemblerWith a stack of problems. Byte is not enough. One of them, Oksana, seems to be her name, speaks with Ukrainian pleasantly roundish reprimand: “What kind of stack? Why do you need him? Olya and I, she's on the clipper, I have no stack on Fox. Maybe you do not need? Forever you guys are dirty tricks you make up. And you yourself are tormenting, tormenting us, tell Olya? ”
“ What ?! ”Only the chair prevents me from falling on the floor. Some nasty, croaking scream breaks out of me ... "Do you write without a stack !?"

But this is already hysterical ...

I'm on the street again. Dear, dear, our ladies. How pleasant you are in your ignorance. And how great it is that you do not know. You don't need to know that. To go crazy with unsolved problems, like philosophical questions, is the privilege of men. Of course, there are exceptions. But they rather confirm the rules. If ladies still come across in the upper-level languages, here and assemblers almost disappear, then in our area I have not heard of them at all. And it is right!There is nothing to blame on women and these problems.

And my legs carry me somewhere, thoughts flow by themselves. They are not interesting to me, I'm a goner. I can not live with it. I will eke out the existence, it doesn’t matter who it is, but I’ll not go to a computer with a gun shot, that's for sure. Shared There was nothing to be cool about. And this is my indulgence snob? Like, I know everything, everything is on my shoulder ... Yeah. Got it ... a goat? I am delirious in this absolutely alien world for me, in which not a single living soul can understand me. A friend and he could not ... And no one cares about me ...

But what is it? Was I kind of here? Flowers Bench. And grandmother on her. As if she did not leave. After all, the frost? I hesitate to sit on the edge of the bench. Wow!hands are cold and soup too. And then, as if something had pushed me, I got up, walked over to the flower saleswoman and at the last treshka (and why did she tell me?) Bought roses and walked over to my grandmother. In my head the thought convulsively beat: what am I doing? What for?She waited, raising her face to me. And I squeezed out: “Sorry. Can I give you flowers? I ... thought badly of you ... then .. "

She was not at all surprised. And she said ... "Where have you been for so long, son?" I froze to wait for you .. ”!!! ??? To say that I was surprised means to say nothing ... I was shocked, stunned, crushed! And she continued: "Is it bad for you, son?" She looked at me with participation. Wisdom, kindness and ... love shone in her eyes. You understand!? Love to me ... And then I said: "Yes! I feel bad. I feel very bad .. ”I was not afraid and was not ashamed. Something seemed to fall off me, bouncing off like a husk. And I began to tell ... Confused, hurrying and choking.

I told my grandmother how I program single-chip microprocessors ...

She listened carefully, without interrupting. She understood everything! My every word! This I saw in her eyes. I spoke and spoke. And she led me somewhere and I ate something very tasty, and then we drank tea, with some unusual jam, in a tiny, but so cozy kitchen.
It must have been a very strange picture. A half-crazy programmer and an old woman listening attentively to him ... And then she said. I do not remember what. I only remember that it was very important and necessary for me, that I drew from this well of wisdom, which can be gained only by losing so much, but finding love ...

And suddenly ... Again, a strange, weightless and at the same time solid construction began to unfold inside me. She unfolded powerfully and gracefully, surrounded by the splendor of lights. Every face of it, every element was perfect and unique! And vibrating slightly, she spawned music. And all this together filled me with extraordinary trepidation and delight! It's me! I created it! This is me polished all its facets! Why does nobody see this !? Well, look! Share with me my happiness! Now I was not afraid. I knew she would fly! And she will help me off the ground. With her and I will fly to the stars!
...

And I walked down the street again. But completely different. Or rather just in another world. Because this one was beautiful! The snow was splashing with multicolored sparks of thousands of unique paints and sounded under such feet with such unique music. It's like your old computer with a CGA monitor, suddenly began to show millions of colors. However, what nonsense am I carrying? This is many, many better.

Create your ships. And may they travel in extraordinary worlds. I was wrong. Each of us can travel and live in these worlds. And it doesn't matter how or where you create them. We create programs as much as they create us. And these programs do not create cunning and for this little intelligence and intelligence. They have to go through the heart, because they are the product of our love.

Because the programs that we create are pure product of creativity. That is why they are so attractive. You do not need a hammer, chisel, brushes or paints to express yourself the main thing - yourself! And it doesn’t matter that not many people can understand the beauty of your codes. If writing our program we have become better, then this is the right and good program! But if you think you need less labor, then you are mistaken. And if you are not ready, or do not want to leave part of your soul and love in your creation, are not ready to change yourself, then it's better ... do not write programs. Look for yourself in something else ...

Dmitry Galuscenko, ank@mail.ank-sia.com , 2: 5100 / 13.4

UPD. Thank you DileSoft

Source: https://habr.com/ru/post/27055/


All Articles