
Originally Posted by
mackrackit
OK, misunderstanding.
I seem to remember this
The -"0" is what you need.
I think

Here is my success test of geting index from array.
After geting and ading decimal integer from example "10ABCDEF"
x3 will be decimal 10 and i can add it with 128(first place on first line on 4x20 LCD...
And there I can display rest of sting from array "ABCDEF"...
Thank's to all who make me to little more think with my head...
Robert
Code:
@ Device pic16F877, HS_OSC, BOD_ON, PWRT_OFF, WDT_ON, PROTECT_OFF
define OSC 20
ADCON0.0 = 0
ADCON1 = 7
DEFINE HSER_RCSTA 90h ' enable receiver,
DEFINE HSER_TXSTA 24h ' enable transmit, BRGH=1
DEFINE HSER_SPBRG 129 ' baud rate RS232 9600 Bauds
DEFINE HSER_CLROERR 1 'Clear overflow automatically
x1 var byte
x2 var byte
x3 var byte
y var byte[8]
start:
hserin [str y\8]
x1 = y[1]
x2 = y[0]
x1 = x1-48
x2 = x2-48
x3 = (10*x2)+(1*x1)
hserout [dec x3,13,10]
RCSTA.4 = 0
RCSTA.4 = 1
goto start
end
Bookmarks