(no subject)
Jan. 20th, 2013 06:02 pmIt's still printing no number -- not even the wrong number -- for the 38911 bytes free.
It has a clever shortcut for multiplying by 10, since the exponent covers powers of 2, it can multiply a number by 4, add to the original number to get the original times five, and then multiply that by 2. It wasn't very obvious because of all the 6502 shortcuts they used...
The first part of the display routine multiplies the number by 10, over and over, until the number is just under 1,000,000,000. It keeps track of the number of times it does this, so it knows where to put the decimal point or the power-of-ten exponent. Then it adds 0.5, regardless of scale, so that the number will be rounded to the last digit printed. And this seems to be where it's breaking down.
This means that the adder works, mostly, except when adding 0.5, for some reason.
It gets to 389,110,000 without error. When it tries to add 0.5, it gets (38,911,000 - 32.5), which indicates that maybe it's copying the memory from some previous result as part of its screw-up.
It has a clever shortcut for multiplying by 10, since the exponent covers powers of 2, it can multiply a number by 4, add to the original number to get the original times five, and then multiply that by 2. It wasn't very obvious because of all the 6502 shortcuts they used...
The first part of the display routine multiplies the number by 10, over and over, until the number is just under 1,000,000,000. It keeps track of the number of times it does this, so it knows where to put the decimal point or the power-of-ten exponent. Then it adds 0.5, regardless of scale, so that the number will be rounded to the last digit printed. And this seems to be where it's breaking down.
This means that the adder works, mostly, except when adding 0.5, for some reason.
It gets to 389,110,000 without error. When it tries to add 0.5, it gets (38,911,000 - 32.5), which indicates that maybe it's copying the memory from some previous result as part of its screw-up.