ngeronikolos
- 28th June 2005, 13:27
hello boys and girls,
I have two problems with my code.
First,I can not display the X byte using Herout command to my terminal.What I see is Address = ,after the = is blank.If I REPLACE it by DEC X everything is ok.Why it is happend?
Second,I would like to compere X with SerData[0].You can see it in my code.It does not doing this comparison.Why?
WHILE PORTA.3 = 1 AND PORTA.4 = 1
GOSUB ADDRESS
HSEROUT ["Address = ",x,13,10] ;USING X IT DOES NOT APPEAR NOTHING TO MY TERMINAL BUT IF I REPLACE IT WITH DEC X IT DOES
wend
DYNAMIC: IF RCIF = 1 THEN
HSERIN 500,MAIN,[STR SERDATA\18]
IF SerData[0] = x then ;compere X with SerData[0]
HSEROUT ["You typed: ", str SerData\17,13,10]
GOSUB OUT
gosub SERTALLY
ENDIF
endif
GOTO MAIN
...........................
ADDRESS:
FOR n = 0 to 50000 step 1
If PORTA.2=1 then
I = I + 1
IF I > 8 THEN I = 1
NICK1: pause 450
WHILE PORTA.3 = 1
SerData[i] = "1"
GOSUB OUT
PAUSE 400
WEND
WHILE PORTA.4 = 1
SerData[i] = "0"
GOSUB OUT
PAUSE 400
WEND
ELSE
GOTO NICK1
ENDIF
x.0 = SerData[1]
x.1 = SerData[2]
x.2 = SerData[3]
x.3 = SerData[4]
x.4 = SerData[5]
x.5 = SerData[6]
x.6 = SerData[7]
x.7 = SerData[8]
next n
RETURN
I have two problems with my code.
First,I can not display the X byte using Herout command to my terminal.What I see is Address = ,after the = is blank.If I REPLACE it by DEC X everything is ok.Why it is happend?
Second,I would like to compere X with SerData[0].You can see it in my code.It does not doing this comparison.Why?
WHILE PORTA.3 = 1 AND PORTA.4 = 1
GOSUB ADDRESS
HSEROUT ["Address = ",x,13,10] ;USING X IT DOES NOT APPEAR NOTHING TO MY TERMINAL BUT IF I REPLACE IT WITH DEC X IT DOES
wend
DYNAMIC: IF RCIF = 1 THEN
HSERIN 500,MAIN,[STR SERDATA\18]
IF SerData[0] = x then ;compere X with SerData[0]
HSEROUT ["You typed: ", str SerData\17,13,10]
GOSUB OUT
gosub SERTALLY
ENDIF
endif
GOTO MAIN
...........................
ADDRESS:
FOR n = 0 to 50000 step 1
If PORTA.2=1 then
I = I + 1
IF I > 8 THEN I = 1
NICK1: pause 450
WHILE PORTA.3 = 1
SerData[i] = "1"
GOSUB OUT
PAUSE 400
WEND
WHILE PORTA.4 = 1
SerData[i] = "0"
GOSUB OUT
PAUSE 400
WEND
ELSE
GOTO NICK1
ENDIF
x.0 = SerData[1]
x.1 = SerData[2]
x.2 = SerData[3]
x.3 = SerData[4]
x.4 = SerData[5]
x.5 = SerData[6]
x.6 = SerData[7]
x.7 = SerData[8]
next n
RETURN