I am learning C and C++. That's how I came across the warning in post #1.
And as for Nano Every or UNO R3: the instruction set is almost identical. The main difference is in the registers.
By now the question from post #1 has been answered: char is a signed number and byte is unsigned. I now expect functions like Serial.print to react the same to int8_t as to char, and uint8_t the same as byte. I will keep using int8_t and uint8_t because the names are less confusing.
This discussion has clarified quite a bit, thank you all.
Aaaaand… the confusion is back. Type char can be signed or unsigned.
"…most efficiently processed on the target system" may include EBCDIC and such.
The system to which int8_t and others belong, was invented to end the ambiguity of the old system with int and long a.o.
Aaaaand… Arduino translates it back! typedef uint8_t byte; means that when I declare a variable uint8_t, the compiler reads byte before compiling.
01101101 in binary, to negate, flip the bits and add one
10010010
00000001 =
10010011, or 0x93.
Now that I've typed all this, it looks like you were the one who turned it into a 32 bit number. Did you happen to use an on line calculator? The step you forget was to chop your result down to 8 bits one byte which is all you have.
alto777, if you want the complete sketch, see post#21.
There is a possibility that the extra Fs were added in my computer, not in the board.
JCA34F, know the difference between the Nano and the Nano Every.
To accomodate for the boards I have, Arduino decided to load versions 1.8.6 and 1.8.8, not 1.8.5.
I still have 5 versions of arduino.h on my computer.
Is it really that important whether char is signed or unsigned?
You are supposed to use it to store characters...
And you can use the fact that they are represented as a number to sort characters alphabetically...
Why would you do a calculation that causes an overflow?
Is it the DUE hardware or the Compiler that treats char keyword as an unsigned data type? Compiler differs MCU to MCU; whereas, ALU circuit remains the same for all MCUs except the processing size.
A processor has no knowledge of the type of a variable. The compiler does. When moving data, the type is irrelevant. Neither when adding or subtracting. Things are different when multiplying or dividing. The AVR has different instructions for multiplication with signed and unsigned. The compiler needs to choose the right one. Thus varC = varA * varB will generate different machine code depending on signed or unsigned.
Also for comparison, the compiler needs to differentiate between Z, C, N, V and S statusbits and choose the right ones.
To make programs portable, higher languages (like C and C++) have been invented and rules for behavior of the compilers established. But as comprehensive these may be, some things fall between the cracks. Like the definition of char, apparently.