News for hackers. Stuff that matters.
Re:KolibriOS – operating system written entirely in assembly... by wenc on Wednesday April 15, 2020 @12:32AM (#22874524)
Just curious, is pure assembly harder to test for correctness? Are there higher level abstractions like functions?
Re:KolibriOS – operating system written entirely in assembly... by ajxs on Wednesday April 15, 2020 @12:59AM (#22874674)
Programs don't have to be particularly large complex to become relatively unweildy and difficult to understand in assembly. I find it takes me much more time to comprehend large portions of written assembly than higher-level languages. Your mileage may vary. Other engineers might be more talented than I am in this regard, however I think this is more or less everyone's experience.

Abstractions like functions are still present, just not in the way that you might think of them in a higher-level language. You use 'branching' instructions to jump from one part of the code to another. Either by referencing labeled sections of the code to perform 'absolute' jumps, or by jumping 'relative' to the current instruction. This forms the building blocks that can be used to implement more abstract constructs such as loops, functions and conditionals. This is a gross simplification, I hope it helps answer your question though.

Re:KolibriOS – operating system written entirely in assembly... by pjmlp on Wednesday April 15, 2020 @01:58AM (#22874994)
Yes and no.

You can write tests like in any language, they just happen to be more tedious.

If you make use of powerful macro assemblers, like MASM and TASM, you can write what looks like high level functions.

You can have a look here for a couple of MASM examples,

https://de.wikipedia.org/wiki/Microsoft_Macro_Assembler

Re:KolibriOS – operating system written entirely in assembly... by misja111 on Wednesday April 15, 2020 @04:41AM (#22875714)
You can code anything you want in ASM, so higher level abstractions as well. However while doing that you will lose some of the performance gain that ASM gives you.

Optimised ASM can still be tested but one problem is that when the code doesn't work, it can simply crash. This makes it a pain to debug.