Thank you for the C++ code, I was wondering where all those new MPASM directives came from. I fed it to Visual C++ 6, with limited success. If I don't modify the values, I can get it to give me a 0-255 range 255 entry table. What I need is a 0-65535 range 255 entry table. So, first I modified the max_out_k value to 65535. This didn't do anything, at which point I realized the C++ code wasn't calculating the value of m_k, it was in constant form (I guess as a result of the translation between languages). So, I did the calculation in the Pascal code, and got a value of 258.01129, which I then defined as m_k. Now when I execute the code, I get about 3 relevant values, then a bunch of values way out of my range, then the locations from 9 to 255 are 0. I don't program in C, and to be honest I have no idea how this code works. I thought I had figured it out with the constant calculation that I did by hand, but clearly I didn't. Then again, perhaps just my constant calculation was wrong. Here is the equation from the pascal source: m = max_out ** (1.0 / (max_in - 1)); Does anyone have any idea what I'm doing wrong? I'll leave the C++ code attached, with my modifications. As per Olin, I've chopped the translation specific code piece. I'm sorry to keep bugging the list about this, but all this high math is above my head. In my mind, the graphing solution I figured out clicks, but I don't know if this will give me the correct values. Thanks, Josh -- A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. -Douglas Adams Olin Lathrop wrote: > And here is the MSVC++ C source code for Windows derived from above: > > typedef int sys_int_machine_t; > >/* extern void string_cmline_set ( > int, > char *, > char *); >*/ > /***************************** > ** > ** Start of program BR. > */ > #define max_in_k 255 > #define max_out_k 65535 > /* #define m_k 1.022056 */ > #define m_k 258.01129 > #include > #include > __declspec(dllexport) int main ( > int argc, > char * argv) { > > static sys_int_machine_t iv; > static double ov; > > /* > ** Executable code for program BR. > */ > string_cmline_set (argc, argv, "br"); > fwrite (" retlw 0 ; 0", 1, 16, stdout); > printf ("\n"); > ov = 1.0; > for (iv = 1; iv <= max_in_k; iv += 1) { > fwrite (" retlw ", 1, 7, stdout); > printf ("%3i", (int)floor(ov + 0.5)); > fwrite (" ;", 1, 3, stdout); > printf ("%3i\n", iv); > ov = ov * m_k; > }; > return 0; > > #undef max_in_k > #undef m_k > #undef max_out_k > } -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics