Function Understanding

a = "First"
b = a[2] //does this not the value "r" to b ?

does this work on numerical values?
Can I grab more than one at a time?

I am working on a project that will output a 16 bit hex value to some hardware. But I must only send 8 bits(one half of the total 16 bits) to two separate ports. how can I do this.
closed account (zb0S216C)
t1tmoney wrote:
"//does this not the value "r" to b ?"

Assuming "b" is of an appropriate type, yes, "b" will attain the numerical representation of the corresponding ASCII character 'r'.

t1tmoney wrote:
"does this work on numerical values?"

No, unless the numerical value is represented by a string.

t1tmoney wrote:
"Can I grab more than one at a time?"

In what way?

t1tmoney wrote:
"I am working on a project that will output a 16 bit hex value to some hardware. But I must only send 8 bits(one half of the total 16 bits) to two separate ports. how can I do this."

You need assembly to send/retrieve information to/from ports. We need more information about what tools you're using.

Wazzak
Last edited on
lets say some hex value
0x527E
i want to send the half[52] to port1 and the other[7E] to port2
Last edited on
closed account (zb0S216C)
I don't know what port1 or port2 are. As for sending the values, you'd have to send them the following way:

1
2
IN Port1, 0x52
IN Port2, 0x7E

Wazzak
Topic archived. No new replies allowed.