Hi Skimask,
I tried that first but I got 12 errors:
Error[113] c:\pbp\pbppicbasic14.lib428 : Symbol not previously defined (big_number).
Should I do any changes in pbppicbasic14.lib?
Thanks,
Nick
Hi Skimask,
I tried that first but I got 12 errors:
Error[113] c:\pbp\pbppicbasic14.lib428 : Symbol not previously defined (big_number).
Should I do any changes in pbppicbasic14.lib?
Thanks,
Nick
edit this line
toCode:@ MOVE?CN 1000000, big_number
Code:@ MOVE?CN 1000000, _big_number
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Thank you Darrel, Steve and Skimask,
No more errors.
One more clarification on the line:
@ MOVE?CN 1000000, _big_number
Does it make my big_number=1000000 in decimal?
If that is true should I see the counter going down from 1000000 to 0?
Am I processing the big_number right in my HSEROUT statement because when I run the program it starts counting down from 1516960.
How do I insert a new big_number
I will be away from the computer for the next 2 hours.
Thanks in advance for all the help.
Nick
Yes, it loads 1 million into big_number.
But it's a 32-bit binary number, so you can't just display the high/low WORDs with DEC.
The hex representation of 1 million is F:4240.
Then change each word to Decimal F=15, 4240=16960
So it looks like it starts counting from 1516960
To convert the big_number to a readable decimal output takes a little more work.
Code:HighDigits VAR WORD LowDigits VAR WORD ;---[add this with the other macro's]--------------- ASM PutMulResult?N macro Nin MOVE?WW Nin, R2 MOVE?WW Nin + 2, R0 endm ENDASM ;---[add this to your main loop]-------------------- @ PutMulResult?N _big_number GOSUB SendBigNum ;--------------------------------------------------- SendBigNum: HighDigits = DIV32 10000 LowDigits = R2 IF (HighDigits > 0) THEN HSEROUT [DEC HighDigits, DEC4 LowDigits] ELSE HSEROUT [DEC LowDigits] ENDIF RETURNThat depends on where the new big_number is coming from.How do I insert a new big_number
You said you're reading the file length from the USB device.
What format is it in, what variables are you storing it in.
DT
Thank you Darrel,
I will add the new code to my program and report the results.
On the refreshing the big_number question:
I’m using a Viniculun device to read an USB storage media that lets me read one byte at the time, n bytes or the entire file in one shot.
The very first line in my data .txt file is the total number of records, 0 - 2,000,000, in fixed length (10 digit left padded with zeros.I used 10 digits to allow for up to 31 bit numbers if need be in the future), decimal format. The rest of the file are the records in fixed length (78 bytes) starting with "#" character, right padded with "~" character and ending with CR/LF. The data is only numerical and I do not process it, I just pass it to the Hserout. Every few records I must pause about 1 second to let the receiver process the information.
I can read the 10 digit number byte by byte, strip the leading zeros and transfer into my big_number variable. How am I going to do it? This is the $10,000,000 question.
I will fix my code right the way and work on the other problem.
I must commend you guys for taking my “what if?” question and make sure I get the best solution. I learned a lot with your help.
Regards,
Nick
Last edited by Nicmus; - 26th January 2008 at 01:55. Reason: Add more info
I added the changes Darrel suggested and it all works fine.
I need to make small changes to the code to better fit my application and i will post it tomorrow.
Thanks again and good night!
Nick
Bookmarks