flat assembler
Message board for the users of flat assembler.
Index
> Main > Is handwritten asm more dangerous than compiled C code? Goto page Previous 1, 2, 3 |
Author |
|
fasmnewbie 26 Sep 2018, 18:38
And btw, if one think that C++ is free from "mysterious" behavior, then listen to this guy...
https://www.youtube.com/watch?v=3MB2iiCkGxg |
|||
26 Sep 2018, 18:38 |
|
revolution 27 Sep 2018, 18:01
I find in my assembly code that signed integers are almost never the correct type. Unsigned, using ja, jb, etc. is almost always the test I need.
If C made the amount of typing needed to specify unsigned, the same as signed (i.e. three characters i n t) then perhaps unsigned would be used more. People are basically lazy so if it needs more typing then it gets ignored. |
|||
27 Sep 2018, 18:01 |
|
Furs 27 Sep 2018, 20:39
Oh that's another topic where I fully agree with you. It's about signed vs unsigned.
The "signed everywhere" mantra is one of the most annoying I've ever laid my eyes on. I'm personally sick of polluting the beauty of code just to cater to a bunch of retards who might assume that signed values are "available", and unfortunately you got some top figureheads in C++ committee and Google who preach this crap. It's nice to see a few other people are of same mindset, so I'm not alone, cause it sometimes feels that way. This blog post is also on that topic: https://blackhole12.com/blog/signed-integers-considered-stupid-like/ |
|||
27 Sep 2018, 20:39 |
|
DimonSoft 27 Sep 2018, 22:26
One more funny thing is when students come to C after two other languages (x86 assembly included) and find out that char is an integer type (not a problem) and is usually signed by default (not a problem as well). The problem is negative values in the debugger, very convenient in the world where most encoding tables are either unsigned or hexadecimal. Anyway, they’re aware that 'a' is of type int by that time and that arrays are not first-class citizens, so they’re not surprised.
|
|||
27 Sep 2018, 22:26 |
|
Melissa 28 Sep 2018, 06:14
I see long debates about integer overflow when talking about C, as that is also undefined behavior ;p
|
|||
28 Sep 2018, 06:14 |
|
Furs 28 Sep 2018, 13:51
Melissa wrote: I see long debates about integer overflow when talking about C, as that is also undefined behavior ;p Unsigned overflow is perfectly defined (just like asm). |
|||
28 Sep 2018, 13:51 |
|
Goto page Previous 1, 2, 3 < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.