Hi Darrel,
I’m a bit confused by your last post.
I’m not sure were to add this code. Also I have the feeling that the big_number[0] and big_number[1] are switched from the way they are in my code.
Here is the code in “colors” format:
How do I process the in_low and in_high variables to get the big_number before entering the main loop?Code:<font color="#000000"><b>INCLUDE </b><font color="#FF0000">"modedefs.bas" </font><font color="#008000">@ device pic16F876a,hs_osc,pwrt_on, protect_on </font><b>DEFINE </b>OSC 16 <b>DEFINE</b> LOADER_USED 1 <b>DEFINE </b>HSER_RCSTA 90h <b>DEFINE </b>HSER_TXSTA 20h <b>DEFINE </b>HSER_BAUD 4800 <b>DEFINE </b>HSER_CLROERR 1 HighDigits <b>VAR WORD </b>LowDigits <b>VAR WORD </b>big_number <b>VAR WORD</b>[2] <font color="#000080"><i>; 32-bit varia </i></font>in_low <b>VAR WORD </b>in_high <b>VAR WORD </b>led <b>VAR </b>PORTA.2 ADCON1=6 CMCON=7 <b>ASM </b><font color="#008000">MOVE?CN macro Cin, Nout MOVE?CW Cin & 0xFFFF, Nout </font><font color="#000080"><i>; Low Word </i></font><font color="#008000">MOVE?CW (Cin >> 16), Nout + 2 </font><font color="#000080"><i>; High Word </i></font><font color="#008000">endm </font><b>ENDASM ASM </b><font color="#008000">PutMulResult?N macro Nin MOVE?WW Nin, R2 MOVE?WW Nin + 2, R0 endm </font><b>ENDASM PAUSE </b>1000 <b>HSEROUT </b>[13,10,<font color="#FF0000">"Waiting for Big_number"</font>,13,10] <b>HSERIN </b>[<b>DEC4 </b>in_high,<b>DEC4 </b>in_low] main: <font color="#008000">@ MOVE?CN 20000, _big_number </font><b>WHILE </b>(big_number[1] > 0) <b>OR </b>(big_number[0] > 0) big_number[0] = big_number[0] - 1 <b>IF </b>big_number[0] = $ffff <b>THEN </b>big_number[1] = big_number[1] - 1 <font color="#008000">@ PutMulResult?N _big_number </font><b>GOSUB </b>SendBigNum <b>TOGGLE </b>led <b>WEND PAUSE </b>5000 <b>GOTO </b>main SendBigNum: HighDigits = <b>DIV32 </b>10000 LowDigits = R2 <font color="#000080"><i>'IF (HighDigits > 0) THEN </i></font><b>HSEROUT </b>[<b>DEC4 </b>HighDigits, <b>DEC4 </b>LowDigits,<font color="#FF0000">" and "</font>,<b>DEC4 </b>in_high,<b>DEC4 </b>in_low,13,10] <font color="#000080"><i>'ELSE 'HSEROUT [DEC4 LowDigits,13,10] 'ENDIF </i></font><b>RETURN END </b>
Am I pulling them right as DEC4 or should I do it differently?
Regards,
Nick





Bookmarks