Lately elsewhere I saw people mocking the practice of writing explicit byte assignments in C, which brings me here now asking, anyone with an
8051 compiler want to try compiling the following code snippet? Possibly before I saw: 1) Some compilers actually involve 32-bit arithmetic, rather than moving bytes, ouch. 2) Some compilers allocate the unsigned long twice, once as a local variable, then again as a separate result, ouch. 3) Many compilers fail to produce the same machine code for both of these expressions of the same idea e.g. my 32-bit Linux desktop `gcc--version` 3.2.2 here now, when run as c.a.e. lately helpfully suggested:
gcc -c -fomit-frame-pointer -O3 -Wall -W hi.c objdump -dS hi.o
A frustrating failure of the C compilers for 8 and 16 bit microcontrollers to understand what I meant by what I said plainly and simply in the first place, yes?
Pat LaVarre
/// ways of fetching a potentially misaligned big-endian 32-bits ... /// (op x25 Read Capacity bytes[4:5:6:7] is disc bytes per read block)
long sub1(char * chars) { long result; result = (chars[4]