Author Topic: [A story] One byte  (Read 2033 times)

Offline Lohmatiy

  • Full Member
  • ***
  • Posts: 150
  • DI HALT / CLI HLT
    • View Profile
  • Rated:
[A story] One byte
« on: June 19, 2008, 10:24:48 AM »
One byte.

I needed only a byte. Just a single byte. Yup, yup. The very byte consisting of eight bits. What? No, I'm not nuts, but only the Lord knows how close I was to this state. Let's keep the order though.

I'm a coder. But not just a coder. I belong to the caste which is called low-level coders. Or chip programmers. Do you know what it is? I will explain it, if you're patient enough. I can't do it without the specifics, otherwise you wouldn't be able to understand the story.

We program single-chip systems, roughly speaking, computers on a single chip. Data storage and program memory are separated, and they don't interact with each other. A program can't be run in random-access memory. The size of callstack is limited. The maximum possible stack size I can use, is eight frames, and I can't modify the size. Oh, please don't think of something weird! I have a lot of resources. Even 128 bytes of RAM! For everything. Integers, strings, this and that. Have you imagined it? Program memory is quite large too. Eight kilobytes! And it's not hard at all to use it. You just need to select the correct memory chunk, execute the function you need, and return to the address you were before. And yes, within the range of memory chunk you can move using only jumps and procedure calls, and conditional jumps are possible only within the range of memory page, i.e. 256 bytes.

That means, if I compare two bytes and a branch is needed, and a label can't be accessed within the 256 bytes range, this is yak shaving, and the compiler hardly warns you about it - hey, you best tie your shoe laces, 'cause you be trippin'! And yeah, this is nothing compared to what is to come! I will tell you more, enjoy it. I don't have a subtraction operation. None at all. Only addition. And certainly I can't afford such a luxury as multiplication or division, this is for lazybones. And I have to implement decimal arithmetic. Is this inspiring the spirit into you? These toys are tweaked as much as you could never imagine, especially if a problem is solved at the limits of data and program memory. Source codes are rewritten not even twice, not even thrice. A fucking solution isn't the only thing I need to make, it has to fit the fucking chip! The amount of variables is limited, program size is limited, procedure sizes, amount of calls, and other things are limited as well. A little mistake and... you get a stack overrun, and hell knows what your code is doing. And the compiler won't help, it can't catch such errors. Do you think this was the end? ;-) Naaaaw, my dear friends. These toys are realtime. That is, every single small procedure has to execute during the specified amount of milliseconds. My modules shouldn't work more than set amount of time, because you also have to scan I/O ports, be in time for sensor signals, and control something outside the chip, and you must be exact, otherwise you would miss the moment when a key is pressed, or the monitor would blink, or whatever. Even more! It has an interface.

The usual PC RS232C, the so-called COM port. If you think it's a separated chip, like, you send it a byte, read a byte from a buffer - you're wrong. Cost price. I do everything manually, scanning the single port bit, manually tweaking start diagrams, stop diagrams, data diagrams. So...

If I've written a working code, but it doesn't fit the memory, problem isn't solved. If I've made a lot of variables, and they don't fit RAM, problem isn't solved.

If everything is okey-dokey, but procedures are too long, the realtime diagram is destroyed, - problem isn't solved. If the procedures are too short, there are a lot of them, you have stack overflow. Problem isn't solved.

Any average programmer would commit suicide in several days, attempting to work in such conditions. Well, I think, the guys who work with it, have steel nerves and a great will to win. We don't talk to average coders often, it's like, there's nothing to make a conversation. We are not arrogant, we are not snobs, not at all. It's just hard to imagine high-level programming using a lot of resources. The hard drive is too small? Buy another one, what's the problem? Not enough of RAM? Buy more, stick it into the slot. Megabytes of code? Don't blame me, blame the compiler. Buy a better computer. This is like different worlds, and I believe you understand why.

It's like a big beatiful yacht in the Ocean. Try to steer its wheel in Finnish skerries. :-) Or thread a needle at night. Yeah, a black thread.

Of course, we have a lot of chips, and we choose them more thoroughly than a guy chooses a girl he wants to marry, and we try to tell fortunes by coffee grounds and other things, if the chip is good enough. But, when you finally made a choice.. there is no way back.

Oh, well. I'm done with the internals and I can continue on my story.

I didn't like the chip first time I saw it, it seemed pretty tight. Everything was within the limits, the usual 20 percents reserved for possible mistakes. But other chips were way too large, and thus, expensive and unreasonable. The cost price determined it, and high-performance Intel and Motorola chips were left outboard.

At first everything seemed to be okay, a month of working and the chips were filled with code, the tests passed, boards wired, the industrial pinions made their first turn, starting the manufacturing process. But occasionally my heart was missing a beat, you know, everything was done pretty tight, three to five percents remained free, and this is hella little, take my word for it.

Nevertheless, the work was good, and I was enjoying the pleasure from doing it. Sure, some parts were pretty risky, dirty hacks here and there, but some special thrills also.

And right there... Right there it has started. The device was short of a very important function, missed by the managers and the customer. It was the customer who suddenly recalled, like, "Hey guys, there must be a small thingy here, honestly, a real trifle, but it's impossible to miss it.Come on, we only forgot it while making a task, happens to everybody. But it's not difficult at all to add it, compared to all your previous work. Again, thank Lord, it wasn't a sensor we forgot to add, just a program!”

Those fucking managers!!! It's their fucking job to understand what a customer wants! Even if they have to saw up a customer's brain and discover all its contents to get the task!

Oh well, pointless to cry, and I set to work for two weeks, asked people not to disturb me. I got a small alarm and a small light signal in my mind. Beep! The first memory chunk exhausted. Repacking.. Optimizing code by pages and chunks. Beep! Not enough of RAM! Rewriting the procedures, what is this variable for? fuck it. And fuck those too, we can use a different way to do it.

Beep! Stack overflow! WTF? Like a face in a floor. How the hell is it on the 8th frame?
Beep! Labels aren't within the range of page visibility.
Beep! Realtime conditions are wrong, procedures take too much time.
Beep! The second memory chunk is filled.

And many, many times like it. Laboriously, byte after byte, I was pushing the body of the fucking feature into chip, constantly repacking the code by pages, chunks, optimizing it, realtime diagrams, RAM using. You probably think 8 kbytes of binary code isn't enough? Ha! Operations are one- and two-bytes long. It's not some fucking three-bytes Zilog, or Intel 8080. Sometimes a friend of mine was dropping in, but I didn't feel like chatting for nothing.

I had over a dozen of solutions and couldn't do anything. I memorized every single procedure by heart, every single byte. I was doing everything down the drain. The picture was fading, unwilling to brighten.
I was missing only a byte! Each solution, ONLY A BYTE!

I came to the friend, dropped time diagrams and charts, and returned to home. I need to sleep. By any means, sleep. I need a fresh mind, a fresh idea. My spirit is drained. The next few days gave nothing, I was gathering the code chunks together and taking them to pieces, threading them like flaring beads, packing them into different forms, trying to find out a pattern to solve the puzzle, without a space, without a mistake.

Jesus Christ, give me the memory... only a byte.. I was blunging the code, I was doing with it everything I wanted, but.. one, only one byte!

Probably a musician experiences something like it, writing a symphony, trying to get the only note to make his music ringing. Or a painter trying to find the very stroke which would revive his painting. Without them, either music or painting are dead and their work costs nothing.

Half-asleep, dabby, dozy, I put my clothes on and went outside. Snow, lousy scratching under shoes. Everything is dull gray around, so common. I don't need a computer anymore, neither assembly listings. I have it inside myself.. Or around myself? It's blinking with different colours, sparkling, in a form of fanciful and beatiful three-dimension figures, or are they some tracery patterns? Thin voices of control markers, hanging in air by those strange crystals of charming shapes. And it's flying somewhere, rotating, inside an odd varying channel? A tube? Flying by its walls, like at commands of invisible master, in time, unrolling by some inspiration. Hey, who is the captain of it, or whoever? A master? Come on, it will crash! You can't do it! But, hey, what's it? Miraculously, the shape is gracefully moving around, a moment, silently crosses the mess... NO! Suddenly, a tiny edge hooks up the tube. Rumbles, and rolls, glaring threads crack, and everything splits up into millions of pieces.

My Lord! It is a stack! It's overflowing a stack! Oh my, it's what it looks like! When I go too far, it happens like it..

Somewhere around, my sight catches a bench and an alone old woman sitting there... On the opposite side, a shop girl selling flowers, trembling with cold. I hate old women.. And this one.. She's kind of sloppy, nearly vile. Who the fuck is she? Why is she sitting here? Why the fuck is she looking at me? She has nothing to do probably. It is them who always make crowds in shops, and you can't be in time to buy anything. And it is them who always shout on the streets. No doubt, she watches the dumb modern TV series, what the fuck are they called? Maria? And someone simplemente crying there? Oh my, do they know anything? Who would understand how much knowledge and labour you need to build something like it? How many sleepless nights do you need? How many books? Yeah, daily and not the stupid novels about love and friendship.

Oh fuck, who would understand it!? Those novices who call themselves 'programmers'? Those who use Visual Basic, FoxPro, Clipper? Those who make dumb questions everywhere: could you tell me what command I need to type? And a manual to read? And when will it be translated into Russian? Yeah, and their so-called 'software' also. Giant accounting software, thousand-state machines, and so on. Undecayed creations. Tney all look alike. Even if their software have differencies, it's their levels of bugginess. A glitch sits on a glitch and manages a bug...
Damn, we need to make them carve their code on stones, like ancient sculptors, so that they would think what they write.. Or, those technorats? WTF, writing virii, to achieve fame by playing dirty tricks on people? Pah!

No. I don't want to sit on the bench next to the woman.. Hey, where was I going to? Oh, I recall, to the friend. Maybe he will tell me something? Bleeding byte! Why am I so angry? There are probably talented people everywhere, I've probably gone too mad..

The pal opened door, silently stares at me.
- So?
- What 'so'?
- Tell me, please, can you give me A BYTE? Only a byte. I will give you anything for it, I need only a byte, do you hear me? I can't fit it into the crystal..
Silentium..
- I watched through your code.
- And? Anything? To solve it?
- No, - he speaks softly, - Ingenious lace. Without a single knot. A filigree. Excellent piece. Every string is to get quality mark. A flexible monolith. But..
- What 'but'?!. Spit it out! For fuck's sake, Jesus Christ, what do I do!
- Most places I can't understand.. I do not get them... I just see, this is like, beatiful, beyond my mind, like, it's here, but I can't touch it... Like a snowflake when you try to get it into hands. Or like the sounds of music, you don't understand it yet, but you feel it..
- Christ, don't talk rubbish, what the fucking snowflake? what the fucking music?! Can you help me or what? - I'm yelling, - Lad, we're friends. Help me. Please. Only tell me where do I put the byte, you're my last hope.. You have a fresh eye, don't you? It's one, only one operator to remove, and that's all, problem is solved, do you get it? - I whisper, catching his arm, - There are lots of lines, I'm only a human, I could've done a mistake, a miss-type, you know? I don't need anything, no fame, no praises, I want it to go away, I wan't to be free.. hey, lets go, I'll let you watch the code one more time...
- Reject it, - he says.
- Reject? Reject what?
- Take another chip.
- Are you fucking stupid!!?? How the hell - another!?? You think, it's some, laughing matters?!! You think, it's like modern computers, you add some strings and noone will know of it? Do you know of these people? They believe in me! I said, 'Yes'! I agreed to do it, though I saw the chip was too small! They're all fucking ready! Cases, wires, power. They just wait for a program! Do you understand what it would cost, replacing a chip? Do you know how much the byte would cost! ONE BYTE!!!
I nearly became deaf of my own shout..
- What a fool, - the word slaps me like a package of wet washing linen, - Forget it! The guys and I were reading the code for three days. I've done everything I could do. Straight away I've understood there's something wrong with you. The code has NO errors. None. Furthermore, we don't even get how you managed to write THAT.
It seemed to be a shock, I either sat or slipped onto a chair. In the innermost of my heart I knew it.. I started a monologue. It was strange. Like someone shouted, whispered, and shouted again with my voice:
- ..thinking all the time. I understood the project isn't that important, well, hadn't it been solved, it would come to the point somehow. God damn it! It's nothing... The thing is, I need it. You know, I haven't been a working slave for a long time, who does what he's told to do, making the excuses, ‘I need money to feed my family’. My work, my programs cost a lot of money. You know, I don't get down to simple things, despite the promises to load me with money. I work for myself. Money is nothing for me. I need other things. When I do anything, I fly.. Don't tell me you don't understand it! You know it! It's like childhood dreams, you remember? Do you think these were dreams? No! And I've got it long ago! This is our soul flying. Really! And our reason tells us, ‘You’re just sleeping’. You get it? And why, when we get older, we don't get such dreams? You don't know? Eh? Why?! And I know! Because the soul grows heavier, it becomes fat, because the society captures our souls, by money, by social conventions, whatever. You think, the problem is this byte? No! I can't do it, but someone else can! You get it? Solution exists, and I feel it! The problem is, I can't see it, offhand. I have to become a different person, not just myself! You fucking know, I'm smart and skillful, but something catched me with this byte, and I've to change myself to become free, I don't know how I'll do it... Fucking... I can't fly anymore... It's the end...
I slowly stood up and, stooped, walked to the door. 'Farewell', I said faintly, to the void.
- Idiot! - he yelled, - You will fucking die cuz of the program! You will die! Get a fucking mirror and look at yourself! Loony bin is a favour for you! Do something! Get drunk, get a girl...
I hear nothing already. 'Jesus, if you hear me, help me...' On the street I realise I forgot my gloves and cap. Wtf, what are they for? Is it important? What is important? What is everything for? Does anyone need it? People? They don't fucking care! I need it! I need it personally. I had driven myself into a maze and I can't escape from it. What is this? A punishment? The lesson to make me shy? Heh, yea, probably.. Wait, wait.. What did he say? 'Get a girl'?

It's a warm and comfortable office. Neat as a new pin. Computers buzz. Foldies, posties. Girls are feeding me with coffee and buns, running tenderhearted eyes over their degraded colleague. They are programmers as well, they write something for the office, to personnel department's joy. They're accurate, made-up, looking nice in one word. Especially compared to my days-long bristle, or beard? I give short answers to their questions, 'Can't solve it. Assembler. Stack problems. A byte is missing'. One of them, I think, Ann, speaks softly, "A stack? What is it? Me and Mary, she uses Clipper, me FoxPro, no stack here. Maybe
 you don't need it either? You guys always invent some weird stuff, torturing yourselves, torturing us too, yeah, Mary?"
- What?! - a naughty carwing scream escapes my throat, - You don't use stack!?

This is a fit of hysteria...

I'm outside again. Dear, dear ladies. You're so nice when you're unaware of the things. And it's so cool you don't know it. You don't need to know it. Going crazy with unsolved problems, philosophical questions, is what men do. Yeah, there are exceptions too, but they confirm the rules.

I'm walking down the street, thoughts are slipping my mind. Nothing interesting, not one could understand me. The friend, even he wasn't able to do it.

Hey, what is it? I was here before, wasn't I? Flowers. A bench. An old woman. She didn't go anywhere? It's cold, isn't it? I came to the bench, sat on it. Something slipped my mind, I stood up, went up to the shop-girl, spent my last money on roses, and came to the old woman. I was like, what am I doing? What for? The old woman was waiting, and I said, 'Excuse me. Can I give you these roses? I.. had a low opinion of you... then..'

She wasn't amazed at all. She said, 'Where were you for so long, sonny? I've been frozen while waiting for you..'
!!!???
Saying I was amazed, means saying nothing. I was shaken, surprised, stunned. She continued on speaking, 'Do you feel bad, sonny?' She was looking at me with sympathy, with wisdom in her eyes, kindness, and ..love. You understand? Love for me. And I said then, 'Yes! I feel bad, I feel very bad..' I wasn't afraid, wasn't ashamed of something, a load has been taken off my mind, and I went with my story, hurrying and breathlessly.

I was telling the granny how I code for single-chip microprocessors..

She was carefully listening to me, without interrupts. She was understanding everything! Every word! I saw that in her eyes. I was talking and talking, and then we were drinking tea, in a small warm kitchen. This was, probably, a strange picture. A mad programmer and a granny carefully listening to him. Later on, the granny was speaking, I don't remember what she told me, I only remember it was something important and necessary, listening to her wisdom I lost a lot, but found the love..


All of a sudden.. The brilliant shape appears again, it unfolds between hundreds of lights, every edge, every node is perfect and unique! Slightly trembling, making a tune. And this made me happy, it was me! It was me who created it! Why isn't anyone watching!? Share the happiness with me! I knew it would fly! I knew it would touch the sky!
...

And I walk down a street again, but down a different street. Even more exact, in a different world. Because this world is beatiful! Snow sprinkles with thousands of shiny speckles, rings under my shoes. This is like your old computer with a CGA monitor suddenly shows millions of colours. Wait, what am I saying? It's better, far better than it!

Create your own ships, and let them discover fantastic worlds. I was wrong. Each of us can travel these world and live there. And it doesn't matter how you create them. We make our programs and they make us. And the real programs aren't created with mother wit or knowledge, they must be held in our hearts, because they're creatures of our love. And if you're not ready to leave a part of your soul in your program, you'd better not code. Find yourself in something different...


(c) 2003, Dmitry Galuscenko, http://www.wasm.ru/article.php?article=onebyte

Translated into English by Lohmatiy (c) 2008;
Thanks to Kingsize for correcting grammar mistakes, thanks to Quadz for 'system programmer' synonyms, thanks to the people who read it.
« Last Edit: June 19, 2008, 06:44:43 PM by Lohmatiy »
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
Dinanzi a me non fuor cose create se non etterne, e io etterno duro.

 

El Box de Shoutamente

Last 10 Shouts:

 

RyU

September 03, 2024, 05:15:49 PM
And wow Derrick is still playing lol
 

RyU

September 03, 2024, 05:15:15 PM
Just know yesterday is gone and soon tomorrow will be gone too  :)
 

Lejionator

August 08, 2024, 07:28:01 PM
It's tiem to QuakeCon!!!  ;)

https://www.youtube.com/watch?v=ThQd_UJaTys
 

ImperiusDamian

July 26, 2024, 09:34:53 PM
In nomine Quake II et Id Software et Spiritus John Carmack, Amen.
 

QuakeDuke

July 26, 2024, 05:10:30 PM
Hey, shout, summertime blues
Jump up and down in you blue suede shoes
Hey, did you rock and roll? Rock on!!  ...QD
 

Yotematoi

July 24, 2024, 01:31:20 PM
Ayer me mato 5 veces para robarme en la vida real hará lo mismo? [img]<iframe src="https://www.facebook.com/plugins/post.php?href=https%3A%2F%2Fwww.facebook.com%2Fzoloyoze.torito%2Fposts%2Fpfbid0wXU2VgS7atesBcSoMz5BWMJCJajeZFVT6GzSU6TtpJGddN9kLTvWNgcZaskkbKFQl&amp;show_text=true&amp;width=500
https://www.facebook.com/plugins/post.php?href=https%3A%2F%2Fwww.facebook.com%2Fzoloyoze.torito%2Fposts%2Fpfbid0wXU2VgS7atesBcSoMz5BWMJCJajeZFVT6GzSU6TtpJGddN9kLTvWNgcZaskkbKFQl&show_text=true&width=500" width="500"
 

Yotematoi

July 24, 2024, 01:25:59 PM
hi ya está la basura de Martin, se cambió el nombre es un ladron estupido, asi llegó a 10000[img]<iframe src="https://www.facebook.com/plugins/post.php?href=https%3A%2F%2Fwww.facebook.com%2Fzoloyoze.torito%2Fposts%2Fpfbid03hZrkDUBJPZKCuFgy5hRUy831ekKJYVRzC7ajXaKQbJ6xcPgKftLukUDfovFyEq3l&amp;show_text
https://www.facebook.com/plugins/post.php?href=https%3A%2F%2Fwww.facebook.com%2Fzoloyoze.torito%2Fposts%2Fpfbid03hZrkDUBJPZKCuFgy5hRUy831ekKJYVRzC7ajXaKQbJ6xcPgKftLukUDfovFyEq3l&show_text
 

Yotematoi

July 24, 2024, 01:25:59 PM
hi ya está la basura de Martin, se cambió el nombre es un ladron estupido, asi llegó a 10000[img]<iframe src="https://www.facebook.com/plugins/post.php?href=https%3A%2F%2Fwww.facebook.com%2Fzoloyoze.torito%2Fposts%2Fpfbid03hZrkDUBJPZKCuFgy5hRUy831ekKJYVRzC7ajXaKQbJ6xcPgKftLukUDfovFyEq3l&amp;show_text
https://www.facebook.com/plugins/post.php?href=https%3A%2F%2Fwww.facebook.com%2Fzoloyoze.torito%2Fposts%2Fpfbid03hZrkDUBJPZKCuFgy5hRUy831ekKJYVRzC7ajXaKQbJ6xcPgKftLukUDfovFyEq3l&show_text
 

-Unh0ly-

July 05, 2024, 05:20:36 AM

Show 50 latest
Welcome, Guest. Please login or register.
September 20, 2024, 03:04:07 PM

Login with username, password and session length