Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror

Comment: Re:Really? (Score 1) 368

Isn't cheating allowed? Write the original OS in C, then compile, and then work on the resultant assembly code, first on optimizing, and then on adding features?

Writing C code and playing with the generated assembly might be OK for a day or two's work in learning assembly on a particular architecture. However for any half serious project its probably a terrible way to get started.

Assembly programming is not about trying to out code generate a compiler. Its about thinking of implementations that are not restricted by the semantics of a particular high level language, of being able to leverage knowledge that can not be given to the compiler, of thinking in terms of the actual hardware architecture.

Comment: Re:Think of the legacy hardware ... (Score 1) 368

Well, you could optimize for current arches, too, if you wanted to squeeze all you can out of them.

Don't need to. Their performance was already good. Optimization of an old arch was only necessary to make its performance acceptable, to make it a minimum system requirement. To enlarge the potential market at the time.

To be honest support for the old arch (and WinXP) is being dropped from the next major release of the software. So the original reference C code is going back in to simplify maintenance. The old ASM is no longer needed. The segment of the market it served effectively no longer exists.

It would be fun to redo it for new archs, I enjoy such things, but its not justifiable. I will continue to occasionally compare it against the C code out of curiosity.

Comment: Re:Here comes the Internet of Kuerigs (Score 1) 270

by perpenso (#49699271) Attached to: Here Comes the Keurig of Everything

Single serving all the things! From flashlights to kittens, all protected with base64 encoded, dual rot13 encrypted DRM goodness!

Interestingly the k-cup patent expired and many other companies began to produce single serve packs for Keurig coffee makers. This led Keurig to redesign and produce a v2.0 coffee maker and packs, with all new patent protection. The CEO just admitted that this 2.0 plan was a total failure and they lost a ton of money.

Comment: Think of the legacy hardware ... (Score 3, Interesting) 368

And you're assembly is probably easy to beat with even pretty crappy SSE2 code.

Apparently not by compilers.

You don't seem to understand the purpose of writing in assembly language. Its not to optimize for the current state of the art box. It is to get acceptable performance from old legacy boxes. Some assembly in the right spot(s) can make the difference between an old architecture making the cutoff in terms of acceptable performance, of being able to include that segment of the market in your minimum system requirements.

My point is that such optimizations for the sake of the old boxes doesn't necessarily do any harm to the new boxes. That worrying about future architectures is a red herring of sorts.

Comment: Re:Floppy disk? (Score 4, Interesting) 368

It's an object lesson in using pure assembly. By the time you get anything useful done, technology has moved on.

Not really. I have some computational code that I wrote in assembly 4 Pentium architectures ago. Every new architecture I run it against the C implementation, freshly recompiled with a current compiler. The assembly is still faster given all the hardware and compiler improvements. Now the performance improvement is getting much smaller but it is still a win.

Comment: Entire OS in about 1/3 of i7 Cache (Score 5, Insightful) 368

I'm not reallyd sure that I understand that point. To me, thst would sound reasonable for educstionsl Ãr entertainment purposes, but are there any other meaningful reasons for writing an entire OS in assembler?

The entire OS would occupy about 1/3 of an Intel i7's cache. For ultra-high performance apps that might actually be useful.

Of course that includes user land apps and such so the footprint of the OS itself would probably be far smaller.

Comment: Re:Someone is making decisions for me regarding th (Score 1) 386

by perpenso (#49685739) Attached to: Criticizing the Rust Language, and Why C/C++ Will Never Die

To be honest, if your loop structure is that deep then you'd be better off refactoring the code into a function that performs the inner loop or loops. This is quite likely to make the code easier to read anyway. I've never written code with a triple-nested loop and found myself needing to break out of the inner loop, straight into to the outer loop. Perhaps I haven't lived :)

I guess it's a personal thing. I personally don't like goto, because it can go anywhere. Other people like it for exactly the same reason. So it goes.

Personally I think its a length thing. If the loops are very short, if all the nesting is simultaneously visible on screen, no scrolling necessary, then it might be OK. It all depends on the complexity of the code too, the logic would also need to be something readily understandable, the partial bailout something natural, not just some optimization trick.

Have I done so, in C/C++ not sure, in assembly probably. :-)

Comment: Re:Someone is making decisions for me regarding th (Score 2) 386

by perpenso (#49677871) Attached to: Criticizing the Rust Language, and Why C/C++ Will Never Die

* Cleanly breaking out of multiple nested loops

Tough one. I have to be honest, I've never used a goto in my code since I stopped writing BASIC, but I've sometimes missed this ability. Still, a language-level keyword like "breakall;" would be better than goto. Except insofar as it doesn't exist, and "goto" does...

The problem is break one and break all are not the only cases. Perhaps you only want to break some but not all levels of nesting.

MATH AND ALCOHOL DON'T MIX! Please, don't drink and derive. Mathematicians Against Drunk Deriving

Working...