[chbot] Anyone seen this error ? avrdude: verification error, first mismatch at byte 0x3c000 on atmega2560

Volker Kuhlmann list57 at top.geek.nz
Fri Apr 24 06:25:37 BST 2020


On Tue 21 Apr 2020 14:20:39 NZST +1200, Peter Ellens wrote:

> I of course used good old never fails BODMAS...  (until C! )

BODMAS? Is that edible?!???

> Addition (0x3FFFF - 0x4000 +1) becomes (0x3FFFF - 0x4001)

Uhhmm... no.

> But C doesn't do this...

Maybe there's a very good reason it doesn't... Operator precedence in C
can be dicey in places, but not regarding addition or substraction.

Back when I was at school and C was a letter not a language,
(0x3FFFF - 0x4000 + 1) was ((0x3FFFF - 0x4000) + 1),
or ((0x3FFFF + 1) - 0x4000), but most
definitely not (0x3FFFF - (0x4000 + 1)). Addition is commutative,
subtraction is not.

Or, if you want, (+0x3FFFF + -0x4000 + +1) in any order of evaluation.

If you're referring to the "+" in "0x4000 +1" being a sign and not an
operator, the expression no longer has an operator. That's a no-go.
Mathematical notation allows to leave off an operator, then it becomes
multiplication. No programming language I've had contact with, including
C, have ever allowed that.

Are you blaming C, when your math is... in a bubble of one? ;-)

Unless some virus has turned my brain to mush, in which case you can all
have a laugh at my expense.

Volker

-- 
Volker Kuhlmann
http://volker.top.geek.nz/	Please do not CC list postings to me.



More information about the Chchrobotics mailing list