(Premier Login iorr5t) Forum Owner Posted Nov 30, 2006 6:20 AM
Lots of blink-lights on the screen. Remember some old joke going around about "Watchen Der Blinken Lighten", meaning for newbies to stay away from the computer and don't touch any buttons?
Anyway, I found a use for -0. Remembering that memory was tight....
I was analyzing a program to reduce size. It had routines which would set condition bits in a 36-bit word. We thought we were clever to get 36 conditions recorded in a single word. Save memory, right?
Well, I noted that to set and clear and test the bits required 36 masks. Not to mention complicated tests (AND and OR, etc.).
So I changed the system to just say SSM in order to set a condition and SSP to clear, and so I used separate words for each condition (wasting, to the horror of my comrades, the other 35 bits). It actually saved memory. Rather than a couple of instructions to set a bit, one could just use SSM, setting the word to negative. And testing was a piece of cake: just BZE.
Luckily, zero was no exception. It set nicely to -0. If that were not the case I would need to waste some memory setting the conditions to some non-zero value. As it was, a simple SSP loop sufficed. Who cares what was in the other 35 bits? (Probably zero if the program was loaded fresh).