Integer overflow: Difference between revisions

Content deleted Content added
Line 99:
Overflow bugs are evident in computer games. In the arcade game ''[[Donkey Kong]]'', [[Kill screen|it is impossible to advance past level 22]] due to an integer overflow in its time/bonus. The game takes the level number a user is on, multiplies it by 10 and adds 40. When they reach level 22, the time/bonus number is 260, which is too large for its 8-bit 256 value register, so it resets itself to 0 and gives the remaining 4 as the time/bonus - too short to finish the level. In ''[[Donkey Kong Jr. Math]]'', when trying to calculate a number over 10000, it shows only the first 4 digits. Overflow is the cause of the famous ''[[kill screen|Split Screen]]'' in Pac-Man <ref>{{cite web|url=http://home.comcast.net/~jpittman2/pacman/pacmandossier.html|title=The Pac-Man Dossier|author=Pittman, Jamey}}</ref> and the ''Nuclear Gandhi'' in [[Civilization series]].
 
[[File:Error message due to an integer signedness bug in the stack setup code of MASM 1.00.gif|thumb|An integer signedness bug in the stack setup code emitted by the Pascal compiler prevented Microsoft / IBM MACRO Assembler Version 1.00 (MASM), a DOS program from 1981, and many other programs compiled with the same compiler, to run under some configurations with more than 512 KB of memory.]]
Microsoft / IBM MACRO Assembler (MASM) Version 1.00, and likely all other programs build by the same Pascal compiler, had an integer overflow and signedness error in the stack setup code, which prevented this program from running on newer DOS machines or emulators under some common configurations with more than 512 KB of memory. configurationsThe program either hangs or displays an error message and exits to DOS<ref>{{cite web|url=https://slions.net/threads/debugging-the-ibm-personal-computer-macro-assembler-masm-version-1-00.33/|title=Debugging IBM MACRO Assembler Version 1.00|author=Lenclud, Christophe}}</ref>.
 
==See also==