Quote:
Originally posted by Dave Flowerday
The Stamp that we're using is based on a Scenix SX28AC microcontroller which is an 8 bit unit. Typically when someone refers to the "bits" of a processor it is referring to the maximum size of integer that the processor can operate on. What this means is that, at the assembly language level, an 8 bit processor can only perform operations on 8 bit numbers. So the assembly level "add" command on an 8 bit controller can only add 2 8 bit numbers. However, you can still do 16, 32, or whatever bit math by operating on the numbers in 8 bit quantities. So if an 8 bit processor wants to add 2 16 bit numbers, it first adds the lower 8 bits of the two numbers then adds the upper 8 bits of both numbers plus the carry bit from the previous operation. I hope I'm making sense here as I can tell I'm not explaining it very well.
Anyway the bottom line is when the Stamp works with 16 bit values it is really being translated into a series of 8 bit operations inside the microcontroller running the stamp interpreter.
|
Ah, that makes sense.
What would the resultant of this be, does it overflow, whats the actual resultant though in binary?
01001010 10011101 +
11001010 10100101
^^
20010101 01000010
1 00010101 01000010
00010101 01000010
... any ideas? I haven't had time to look this up. The question always comes up when I'm away from my computer.