0 Members and 3 Guests are viewing this topic.
Ok, so you could be in one of two situations:1. You have a text string with the numerical data If this is the case, the answer is pretty easy, copy low nibbles of the text data into the data section OP1. Then, take the number of nibbles you copied, add it to 7F, and store that in the exponent field.Example: Text = 12345 = $31, $32, $33, $34, $35 Copy this into OP1, OP1 = 00 84 12 34 50 00 00 00 00
Quote from: thepenguin77 on October 02, 2011, 06:53:28 pmOk, so you could be in one of two situations:1. You have a text string with the numerical data If this is the case, the answer is pretty easy, copy low nibbles of the text data into the data section OP1. Then, take the number of nibbles you copied, add it to 7F, and store that in the exponent field.Example: Text = 12345 = $31, $32, $33, $34, $35 Copy this into OP1, OP1 = 00 84 12 34 50 00 00 00 00This is the way it will be. The issue is, the numerical string MAY contain a decimal point.
Hmm, I just realized that you'll also have to properly handle non-significant zeros, like if they type 01337 or 0.0001. The only FP value that is allowed to start with a 0 nibble is zero itself. Leading zeros before the decimal point can simply be ignored, but leading zeros after the decimal point should also decrease the exponent.