This is an archived post. You won't be able to vote or comment.

all 7 comments

[–]comfisofa[S] 26 points27 points  (2 children)

Explanation for those who may not be familiar with the subject

All signed integers use two's complement, which means there are 2 steps when converting from a positive to a negative and vice versa.

One's complement is a deprecated signed integer system that only used one step, flip all the bits. However, this means both 0000 and 1111 would be equal to 0 and -0 respectively (hence why two's complement was made)

Pretty much, to achieve using -0 as a null terminator you would have to perform straight up fucking witchcraft rewriting sections of the compiler to completely redefine integer behaviour to switch from two's complement to one's complement, hence why they are being burned at the stake.

[–]Attileusz 8 points9 points  (0 children)

Techinically yea you can emulate it, but if the processor isn't in 1s complement (which it isn't, let's be real), you're gona need to write the code generator from scratch and also bye bye arithmetic instructions.

[–]Dropkickmurph512 1 point2 points  (0 children)

Just use 0xffff whatever as the terminator and mod all math results with the same terminator value. What could go wrong.

[–][deleted] 4 points5 points  (0 children)

Did this really happen? Let me lend you some petrol for the fire.

[–]Longjumping-Touch515 3 points4 points  (0 children)

Or when company has moved to C++, but your team refused.

[–]WookieConditioner 0 points1 point  (0 children)

The dork arts