A couple of items:
1) Hippy, thanks, I think you answered my question via: Peek $07,b0
I will try that out. But, then another question arises: Where could I have found out that register $07 contains the portC input pin data for the 14M? I did a search on "$07" in both manual #1 & manual #2 and came up empty.
Next, if I peek at $07 without having assigned any portC pins as inputs, will this just return zero? I could simulate to find out, but if you know the answer without having to do that, could you please indicate so here?
2) Westaust55, I simulated your program:
#PICAXE 14M
main:
pause 1000
dirsc = 24
let pinsc = 8
b0 = 1
b2 = 3
High 3
high portc 4
pause 1000
goto main
Although it is not about reading portC, it is interesting insofar as it does demonstrate default input & output pins reversed in those functions using the dirsc command. That operates as expected. The assignation of constants to registers b0 & b2 has no apparent significance (am I missing something?), and the statement 'High 3' has no effect, since Out3 has been converted into an input by the 'dirsc=24' command. What are those three statements in the program for?
Regarding pin assignation overrides (or lack thereof):
A) It is interesting that the 'dirsc=24' command is not overriden for the Out3 pin by the later-occurring High 3 'command';
B) if I comment out 'dirsc=24' and simulate, then:
1) 'pinsc=8' becomes ineffectual;
2) however, 'high portC 4' does take effect by converting In1 to an output port and taking it high;
3) 'High 3' then operates on Out3 as expected.
If I simulate the following program for the 08M:
Test:
Dirs=0
High 1
High 2
b0=Pins
Goto Test
Pins 1 & 2 are initially set as inputs, as expected,then High 1 & High 2 commands override the Dirs=0 command for pins 1 & 2.
It appears in some cases (at least for the 14M), when portC commands operate on pins that are not always referred to in the Basic code as portC pins, the subsequent pin assignation protocol priority during code execution is uncertain (for us users). It must be specified for the compiler, though, so, in general, how to know, for the 14M, for example, when pin assignation commands as inputs or outputs via port specificity will or will not be overridden by other pin assignation commands?
Thanks, Odessa