Integer overflow: Difference between revisions

Content added Content deleted
No edit summary
Line 131: Line 131:
DS 0F alignment
DS 0F alignment
BITFPO DC BL1'00001000' bit20=1 [start at 16]</lang>
BITFPO DC BL1'00001000' bit20=1 [start at 16]</lang>
=={{header|6502 Assembly}}==
Signed overflow (crossing the 7F-80 boundary) is detected by the CPU setting the overflow flag.
Unsigned overflow from 255 to 0 is detected by setting the carry flag.
In either case, if the programmer expects either to occur, a branch can be taken depending on the status of the flag after a calculation where overflow could cause a problem.



=={{header|Ada}}==
=={{header|Ada}}==